-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export sass variables for include in JavaScript #72
Comments
Struggling with this same issue. Did you ever get it resolved? |
Dying for this feature. |
This is my implementation, I don't know if you can use it index.scss :export {
--font-size-primary: 14px;
--color-border-primary: #3B4144;
} test.js import index from './index.scss'
console.log(index) dist/src/test.es5.js var index = {"--font-size-primary":"14px","--color-border-primary":"#3B4144"};
console.log(index); |
@duowb Nice! .. I will look into integrating the feature later this week, or if you want to open a pull request ..? |
…piled css output. - Added test/example showing how to extract sass variables to generated output *.js module files. - Simplified 'License' section in main README. - Updated 'LICENSE' to point to './humans.txt' for maintaners/owners list.
issue-#72 Tests, example fix/approach, and a patch to uncaught 'duplicate css' bug
- Re-generated package-lock.json to fix erroneous version number publish.
As pointed out in #71 turns out the plugin supported this all along (lol): rollup-plugin-sass/test/index.test.ts Lines 290 to 315 in f4b2e64
|
I try to use the :export construct as described in https://stackoverflow.com/questions/61517117/cannot-export-sass-variables-into-javascript?noredirect=1&lq=1 to be able to use values of SASS variables in my JavaScript but can't get it working:
Should this work with rollup-plugin-sass, or is there another method to accomplish this?
The text was updated successfully, but these errors were encountered: