sassport | Sass with JavaScript superpowers | Style Language library
kandi X-RAY | sassport Summary
kandi X-RAY | sassport Summary
JavaScript modules for Sass (node-sass). Easily share assets, and JavaScript functions and values in your Sass projects.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sassport
sassport Key Features
sassport Examples and Code Snippets
Community Discussions
Trending Discussions on sassport
QUESTION
I am trying to find an easy way to export Sass maps to a json format so they can be used in my js as well. I have found multiple libraries around but they all are doing the opposite (from what I can tell) aka using js variables in sass.
TL DR; Is there a way to export sass maps to JSON format?
Preferably in gulp as I am using this for build automation.
Found libraries:
- SassyJSON
- Scss to json <= doesn't take maps
- Sassport <= does only the opposite (?) docs really unclear to me
- Sassy export <= looks good, how to use in gulp?
- Node sass export <= can't get it to output a file, docs confusing
ANSWER
Answered 2017-Mar-02 at 11:35Try this npm package - sass-json-export
It returns a JSON inside the output CSS file. You have the option to have the JSON returned inside a media query or a comment. This CSS file can be easily parsed to extract the JSON part into a separate JSON file.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sassport
Use sassport just like you would use Node-Sass (see example below)
Use require() in your Sass (SCSS) stylesheets to import JS values (see example below)
node index.js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page