Question: Mixins
havenchyk opened this issue · comments
Hi,
Could you clarify, how can I use mixins with stylecow and is it possible to use mixins?
Thanks
Hi, sorry but there is not a plugin for mixins in this moment.
There is a plugin for @extend
that uses the syntax proposed by Tab Atkins (implemented only with placeholder selectors), so if your mixins does not need arguments, it's a solution. Anyway, we are working to improve this plugin to use variables like this:
%my-button {
background: var(--bg-color, blue);
color: var(--text-color, white);
}
.default-button {
@extend %my-button;
}
.invert-button {
--bg-color: white;
--text-color: blue;
@extend %my-button;
}
@oscarotero Cool, thanks for a quick response and your awesome work. I don't know, but maybe it would be useful to add this info on the home page. What do you think?
The home page contains the list of available plugins with links. But maybe you're right and some frecuent questions should be answered directly on the home page. 😄
There are some usage examples in the wiki that I'll update
https://github.com/stylecow/stylecow/wiki
Looks great, thank you!