You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR allows for custom selector strategies for icons.
Especially for Fontawesome Pro there are icons which share the exact same words but in a different order ("foo-bar" and "bar-foo" are 2 different icons). This wouldn't work using the default fui logic
i.icon.foo.bar::before {}
Now, it's possible to adjust 3 new variables which would allow different icon class selectors
1. Ordered selector
@iconClassSeparator: " "; // a space separator automatically forces order
// or
@iconForcedOrder: true;
results in
i.icon[class*="foo bar"]::before {}
2. Dashed one word selector
@iconClassSeparator: "-";
results in
i.icon.foo-bar::before {}
3. Use data attribute instead of classname (this was originally planned as default for 3.0) and optionall use a custom class separator
@iconClassSeparator: "_";
@iconForcedOrder: true;
@iconForcedAttribute: data-icon
results in
i.icon[data-icon*="foo_bar"]::before {}
I also simplified the generateIcon function so it can be reused for duotone icons (because the only difference is the pseudo selector)
0 commit comments