How to import bulma css globally with cssModules enabled
See original GitHub issueI’m trying to start a project in Next.js that uses CSS modules and bulma.io globally.
My next.config.js
is this:
const withSass = require('@zeit/next-sass')
module.exports = withSass({
cssModules: true,
webpack: config => {
// Fixes npm packages that depend on `fs` module
config.node = {
fs: 'empty'
}
return config
}
})
I’ve a styles.scss
imported in my component that is this:
:global {
@import '~bulma/bulma';
}
but when compiling I get the following error:
./stylesheets/styles.scss
Missing whitespace before :global (9:2)
7 | transform: rotate(0deg); }
8 | to {
> 9 | transform: rotate(359deg); } }
| ^
10 | :global .delete, :global .modal-close, :global .is-unselectable, :global .button, :global .file, :global .breadcrumb, :global .pagination-previous,
11 | :global .pagination-next,
12 | :global .pagination-link,
How can I use CSS modules but use bulma.io globally?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
With node-sass | Bulma: Free, open source, and modern CSS ...
To build a CSS file from a Sass file, we can use node scripts. In package.json , add the ... node_modules/bulma/sass/utilities/_all.sass"; @import "....
Read more >Importing external stylesheets globally with CSS modules
I have installed node-sass and successfully added a .scss file to one of my components. External (Bulma) styles are added via @import "~bulma/ ......
Read more >A deep dive into CSS Module - LogRocket Blog
Note: Although CSS Module enables us to scope our styles, we can still declare global classes by prefixing the class name with :global:....
Read more >Styles & CSS - Astro Documentation
.jsx files support both global CSS and CSS Modules. To enable the latter, use the .module.css extension (or .module ...
Read more >Adding Bulma CSS to your React application | Sanity.io guide
Create a style.scss file in your src folder and insert the following code to import Bulma. @charset "utf-8"; ...
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 FreeTop 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
Top GitHub Comments
Adding
next-sass
will disable built-in support, so you have to remove https://github.com/pioz/next-sample/blob/master/next.config.js#L1-L4This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.