-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Using mixins to create new mixins #1659
Comments
I am not entirely sure what you are trying to accomplish, but mixins are @mixin foo {
// declarations
}
@mixin bar {
@include foo;
// more declarations
} bar will include foo, and you can override undesirable styles from foo if |
Dynamic mixin declarations add a huge amount of complexity both for users and for the implementation, with relatively little benefit to show for it. Once we have #1289, it will be pretty easy to do something like this more explicitly by storing styles in maps and defining an |
If you really-really need dynamic mixins, you can peek into how Compass 1 was achieving that with ERB: https://github.com/Compass/compass/blob/354d6fffa43f79c020bf565f3ba42b75a577a34d/lib/compass/sprite_importer/content.erb#L45 |
Could not find any information on this and it doesn't seem to be supported. Maybe there is a better solution that achieves the same functionality, but it might be useful to be able to use mixins to create new mixins whose names and attributes are defined by the parent.
Here is a for instance.
In order to use helper styles in my projects, I usually implement a mixin which allows me to either extend them when outside of a media query, and simply include the styles when inside. Here is an example:
Now what would be nice if for every time I need to make a new helper style, I could use a helper mixin which creates a new mixin with the styles I need. Here is what it could look like:
So using this new method, this is how I could create a new equal-height mixin:
This would then create a new helper mixin called "equal-height" achieving the desired functionality.
Is this functionality something that could be useful to others -- or is it already possible and I am just missing something?
The text was updated successfully, but these errors were encountered: