-
Notifications
You must be signed in to change notification settings - Fork 21
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
Shared variables between JS/SCSS #55
Conversation
Should we update
Should we by default include the DeviceStateTracker to be configured from the json files? Or at least add some docs on how to use json variables in both JS and CSS? |
@ThaNarie I was thinking to leave out mediaQueries in JSON. Just wanted to have shared-variables stub so people can add their own ones. We could opt for some default ones; After the PR merge I'll update the docs on the wiki about using shared-variables.json, and have some instructions how to integerate with FYI in a current project I've got this in my variables.scss:
|
Not sure if we want/need a |
True that; We could remove it from utils.scss and just add a proper description on using this functionality in the wiki. |
Looks good to me. |
I've updated this PR with latest Docs (will be added to the wiki once merged) Sharing variables between JavaScript and SASSVue skeleton comes with the node-sass-json-importer support. The skeleton imports by default Using mediaQueries together with seng-device-state-trackerTo use seng-device-state-tracker make sure it is installed first. Add it by running
More information on usage can be found here seng-device-state-tracker. |
Looks good to me. |
A lot of MM projects already use sassify-webpack plugin for sharing variables. Since newer releases of webpack this became a bit buggy.
This PR will add node-sass-json-importer for node-sass. This allows sharing variables using JSON with node-sass. Previously intergration with node-sass-json-importer this wasn't possible due to the
vue-loader
. The new version of vue-loader supports passing objects to other loaders.To get all this working, I needed to removed extract-text-webpack-plugin (beta status) reasoning) with mini-css-extract-plugin. Also upgraded webpack to 4.4.x so it's compatible with mini-css-extract-plugin.
Note Maybe it's even a good idea to update webpack to the latest version