Using SASS styles inside <style jsx>
See original GitHub issueIs that possible? I am used to SASS and want to use it in my next app. Currently, I have this code:
p {
color: red;
}
p.span {
color: blue;
}
And I wanna make it like this:
p {
color: red;
&.span {
color: blue;
}
}
If I do that, it doesn’t throws errors, but the indented style gets ignored.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:13
Top Results From Across the Web
How to Use Sass and Styled Components in a React JS ...
Awesome! Let's start styling our component! Inside the Sass folder, create a new folder called “components”. This folder will hold the styles for...
Read more >How to style with SASS/SCSS in React ? - GeeksforGeeks
Introduction: We can use SASS in React using a package called node-sass. Using node-sass we can just create sass files and use them...
Read more >CSS in React: 5 ways w/ sass + styled components + modules
In this video we will take a look at the different ways to utilize CSS in a React application. We will learn about...
Read more >React Sass Styling - W3Schools
Sass is a CSS pre-processor. Sass files are executed on the server and sends CSS to the browser. You can learn more about...
Read more >Configuring styled-jsx with scss in Next.js | by Bob Fanger
Next.js has sass support is built-in, but this doesn't extend to the styling inside styled-jsx tags. The sass syntax is not working, ...
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
Any update on this?
Or atleast using postcss plugins for css nesting and container-query?
With javascript functions and variables, we don’t really need css vars (and the ugly syntax) or mixins but nesting and container query support would be very nice.
Hello, not sure this is the right place for this question. I am using styled jsx with the sass plugin. Works well but I have encountered a small issue trying to use js variable inside the style. It seems that simple variable use works for simple values, but not when used in more complex case like parameter of a mixin. Below is a small example of what I am trying to do. The color is applied correctly but the media query will not work as expected (always evaluates to true). ` const bp = ‘medium’ const col = ‘yellow’
`
I have seen this in the readme
If I understand correctly, what I want to do is currently not supported right? Is there any plan to support this in the future? And if I wanted to help support this, where should I look? By the way, thanks for the great work.