gatsby-plugin-sass styles loaded as global css not as variable
See original GitHub issuehere for reproduce i’m using plugin gatsby-plugin-sass
create a file with name mystyles.scss the code import styles from ‘./mystyles.scss’
console.log(styles)
result
{ }
case two in mystyles.scss create a styles
.mybutton{
backgroud:red
}
the code
import styles from './mystyles.scss'
<button className="mybutton" />
i think this a bug
mystyles.scss is loaded as global styles, background color of button with class mybutton is red,
expect no backgroud because styles as variable no imported as global like import './mystyles.scss'
here an example styles as variable
import styles from './mystyles.scss'
<button className={styles.mybutton} />
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Include sass in gatsby globally - Stack Overflow
Only do this with Sass files that contain just variables, mixins, functions, etc (Sass features that do not output any actual CSS until...
Read more >gatsby-plugin-sass
gatsby-plugin-sass Provides drop-in support for Sass/SCSS stylesheets Install ... environmental variables (as Sass variables) or even prepend a global Sass ...
Read more >Styling Gatsby Site with CSS - Ibaslogic
Styling Gatsby Site with CSS Modules. In order to add some sort of global styles in our Gatsby site, we added a stylesheet...
Read more >CSS Modules + Sass Setup for Gatsby - Mediacurrent
CSS Modules provides a familiar approach to working with Sass -- even if you're not well-versed in Gatsby. Here's how to get started....
Read more >Adding Bulma CSS to your React application | Sanity.io guide
Bulma resets browser styles and exclusively styles based on CSS classes, meaning the HTML you compose has no effect on the styling of...
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
@xBau follow this document https://www.gatsbyjs.org/packages/gatsby-plugin-sass/ and follow this https://www.gatsbyjs.org/packages/gatsby-plugin-sass/#with-css-modules
@derit how did you solve the problem?
I’m having the same issue