admin管理员组文章数量:1391999
Let's assume I have files below in my src/style/
folder:
_fonts.scss
_globals.scss
_media.scss
_mixins.scss
_normalize.scss
_utils.scss
_variables.scss
And here is src/style.scss
:
@use 'styles/normalize';
@use 'styles/fonts';
@use 'styles/mixins';
@use 'styles/media';
@use 'styles/variables';
@use 'styles/utils';
@use 'styles/globals';
When I tried to use mixin from _mixins.scss
(in component.scss
) ,
.search__button {
@include reset-button;
}
then it throws error like:
✘ [ERROR] Undefined mixin.
╷
23 │ @include reset-button;
│ ^^^^^^^^^^^^^^^^^^^^^
╵
src/app/shared/components/search/searchponent.scss 23:3 root stylesheet [plugin angular-sass]
If I remove @use 'styles/mixins'
from src/style.scss
and import with '@use' directly in component (also in angular.json), it will works. However, I guess there might be a cleaner way.
Is there a way to import _mixins.scss
in style.scss for example (mean globally) and use it whenever I want?
本文标签: sassHow to import file with mixins globally in angular 19Stack Overflow
版权声明:本文标题:sass - How to import file with mixins globally in angular 19? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744608894a2615529.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论