Skip to content
Advertisement

Tag: sass

Webpack can’t resolve @import of scss/css

I have a main Stylesheet style.scss, which I imported in my main JavaScript file script.js: This works great, and I could build my website that way in dev mode. Now I wanted to try and use separate Stylesheet and import them in my main stylesheet with the @import rule, like so: But now I get this error message: And I

How to render custom generated ruleset in styled-jsx

TL;DR How does one insert a variable that contains one or more CSS rules into styled-jsx (using styled-jsx-plugin-sass under the hood)? I have the following JSX style: And contained is a variable that I’m trying to insert into it the mentioned rule: Notes: breakAt is a function that generates a specific media query (breakpoint: string) => (content: string) => string

How to work with sass @use and webpack sass-loader

In my project i found that i had styles duplications injected into my page, so to solve this problem i have move to @use instead of using @import. After this move i have found that it gave me duplications too even if into the documentation it says that you can use @use without getting duplications. I have found that the

Export SASS/SCSS variables to Javascript without exporting them to CSS

Background Consider the following _variables.scss file: The purpose of the above code is to make the SCSS variables available to Javascript by means of importing like so: See a more detailed description here. The Problem Now consider the following template (I have used as Vue.js template as an example but this is relevant to numerous frameworks): In the above example

Change only one property of css background

I’m currently trying to dynamically change the background gradient of a background with an image. I’m using the following CSS properties to add the image and the gradient. CSS: The code here is pretty much the same with the only exceptions being the cross-browser compatibility. The only thing I would need to change would be the actuall color of the

Advertisement