Interoperable CSS (ICSS) is a superset of standard CSS, adding the two pseudo-selectors :import and :export. This allows modern multi-format loaders like Webpack, JSPM and Browserify to propagate and exchange variables between different layers of the tech stack. Passing variables from CSS to JS is one of the main usecases.
Questions tagged [icss]
9 questions
10
votes
2 answers
How to get SCSS variables into react
I followed this post How to use SCSS variables into my React components or this one React and SCSS export a variable from scss to react to get scss variable in my react app but it does not work.
myvar.scss file:
$color: red;
:export {
color:…

Stef1611
- 1,978
- 2
- 11
- 30
6
votes
5 answers
Use sass variables into js files create-react-app
I have some color defined variables into _colors.scss file.
$color-succcess: #706caa;
$color-error: #dc3545;
I would like to also use them into some styled react components react-table into my js file.
I used the following article…

Bogdan Daniel
- 2,689
- 11
- 43
- 76
5
votes
3 answers
problem in accessing the scss variables in react components
Followed the link https://mattferderer.com/use-sass-variables-in-typescript-and-javascript
Looking to access the scss varaibles in react component . Not sure with what import name i need to call in react component since if i give as below import…

Srinu Merugu
- 103
- 2
- 7
5
votes
0 answers
How to 'import' scss colors into react js component?
Hi I have some scss color definitions in scss file:
$blue: #20a8d8;
$indigo: #6610f2 !default;
$purple: #6f42c1 !default;
$colors: (
blue: …

LOUDKING
- 301
- 1
- 13
3
votes
2 answers
Rollup - Allow :export statement in scss file to import in js
We have a Vue component library built with Rollup. The development is in early stage but everything worked well so far besides this one thing: we are not able to export SASS variables from a scss file and import them in a js file. We are used to do…

pmrotule
- 9,065
- 4
- 50
- 58
3
votes
1 answer
Import sass :export varaiables in Next.js
In my Next.js app, I am including a component that accepts theme colors as a parameter.
I have sass variables defined à la
$primary: #f00;
:export {
primary: $primary;
}
which I import in pages/index.tsx like
import colors from…

abenrob
- 878
- 10
- 23
1
vote
1 answer
How to export sass list as array to js file
I have a file with sass variables, it has a list like this:
$columnsClasses: 'Id', 'Phase', 'Status', 'Source', 'Date'
and so I write the following at the same file to export this list
:export {
columnsClasses: $columnsClasses;
}
I need to import…

Dare Mo
- 11
- 1
1
vote
0 answers
SCSS :root section with :export
I have test.module.scss file where I store all my variables for colors, typography etc. I would like to be able to use it in react component. The problem is that file has :root on the top to be able to define variables, it looks like this:
:root{
…

Sowam
- 1,674
- 3
- 12
- 30
0
votes
1 answer
How to get SCSS variables in js code (nodejs server)?
From this blogpost example https://til.hashrocket.com/posts/sxbrscjuqu-share-scss-variables-with-javascript, I tried to get scss variables in my js code and I did not manage to do it.
index.js file
import variables from…

Stef1611
- 1,978
- 2
- 11
- 30