Support sass mixin and variables within component style
See original GitHub issueHi, Is it possible to use sass mixins and variables within component’s style?
For instance I import bourbon in the main style.scss:
/* You can add global styles to this file, and also import other style files */
@import '~normalize.css';
@import '~animate.css';
@import '~bourbon/app/assets/stylesheets/bourbon';
@import '~bourbon-neat/app/assets/stylesheets/neat';
I want to be able to do the following in app.component.scss
:host{
@include linear-gradient(to top, red, orange);
background-color: $primary;
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
mixin and @include - Sass
Mixins allow you to define styles that can be re-used throughout your stylesheet. ... are available within the mixin's body as the corresponding...
Read more >How to Use Mixins in Sass and Pass Arguments – With Code ...
But an argument allows you to define different styles by turning them into variables. It's like customizing each style for each element.
Read more >How to use CSS variables with Sass Mixins - Medium
CSS Variables and Sass mixins are each potent on their own. With some creativity, we can make them work together towards more flexible...
Read more >How to combine SASS color functions and CSS Variables
You can include CSS variables into SASS mixins and functions, but the code above would return an invalid value (--var(color) is replaced by...
Read more >SASS Best Practices: 9 frontend tips for CSS preprocessors
Introduction to SASS; SASS Architecture; Variables in SASS; Using Interpolation; SASS Extends; SASS Mixins; Imports and other at-rules
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Simply import it again wherever you need the function/variable. Just as you’d need to import any typescript function/variable you’ve exported.
They will not impact the build size in any way as they just contain mixins/variables.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.