This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require('lodash'); | |
const plugin = require('tailwindcss/plugin'); | |
module.exports = plugin(({ addVariant, theme, e }) => { | |
const events = theme('phxLive.events', []); | |
_.forEach(events, (event) => { | |
addVariant(`phx-${event}-loading`, ({ modifySelectors, separator }) => { | |
modifySelectors(({ className }) => { | |
return `.${e(`phx-${event}-loading`)}.${e(`${event}-loading${separator}${className}`)}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule HeroiconWithSurface do | |
@moduledoc """ | |
This assumes https://github.com/tailwindlabs/heroicons has been cloned as a submodule to svgs/heroicons | |
Examples: | |
<#HeroiconWithSurface variant="outline" icon="phone" class="w-5 h-5" /> | |
<%= HeroiconWithSurface.svg({"outline", "phone"}, class: "w-5 h-5") %> | |
""" | |
use SvgIcons, |