-
Notifications
You must be signed in to change notification settings - Fork 57
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
mixin to generate font-face and .material-icons #83
mixin to generate font-face and .material-icons #83
Comments
best I can think of is adding a WDYT? |
The main problem we had was with the font-face, since the way the Angular CLI re-writes CSS urls makes it hard for us to write it ourselves (but works when it comes from you SCSS, something to do with were the files are relative to the SCSS file). Currently the @font-face is not in a mixin (neither is the .material-icons class). A @main mixin would work for us. |
Sass itself provides no code-splitting options and it's not part of any of their goals: https://github.com/sass/sass/blob/main/accepted/module-system.md#non-goals Despite many libraries exporting top-level rules like this one, it's not suggested by the Sass developer: The take here is for the default @include mixins.fontFaceMixin();
.material-icons {
@include mixins.classRulesMixin();
} Then custom implementations can pick and choose how often they load where as the default implementation stays top-level as expected. But as the sass dev comment says, it can be brittle if you don't have an API strategy (ie: want to change |
I'm working on an angular library project that is adding support for @use.
We'd like to be able to control when/where/if CSS is generated. To do that it would be nice if there was a mixin that wrapped the SCSS in material-design-icons.scss so we could @use _mixins.scss and not generate any CSS until/unless we call the mixin.
The reason we want this is we don't want angular components accidentally regenerating the font face, etc. every time they @use our library. With the way the angular cli handles rewriting asset paths, it's hard to get the path right if we just try to generate the font-face ourselves.
The text was updated successfully, but these errors were encountered: