Gathering detailed insights and metrics for gulp-style-vars
Gathering detailed insights and metrics for gulp-style-vars
Gathering detailed insights and metrics for gulp-style-vars
Gathering detailed insights and metrics for gulp-style-vars
Allows a variable JSON file to be imported by both SASS and front-end JS.
npm install gulp-style-vars
Typescript
Module System
Min. Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
11 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jun 16, 2015
Latest Version
1.0.1
Package Id
gulp-style-vars@1.0.1
Size
2.81 kB
NPM Version
1.4.21
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
A simple module to allow style configuration to be shared across the codebase.
Each input file is given as an anonymous Javascript function which returns a JSON object, which can be parsed into readable representations for each system.
All basic JSON structures are supported, including objects and lists.
The following is a basic example of the input file used by the system.
1function() { 2 return { 3 "sidebar-width": "50px", 4 "color-scheme": { 5 "theme": "#666666", 6 "background": "#333333" 7 }, 8 "width-breakpoints": [ 9 "800px", 10 "1200px" 11 ] 12 }; 13}
Currently, this representation can be automatically converted to both SCSS and a standalone JS module.
Takes any file matching src_globs, interprets it as the StyleVars representation and converts to a SCSS variable file and outputs it to the specified folder.
Configurable options are
String
- A prefix to add to the compiled SCSS files, defaults to "_".String
- The extension to set for the output files, defaults to ".scss".Integer
- The number of spaces to indent by, defaults to 4.String
- A label to be used for logging, defaults to a string representation of the source globs.Function
- A function to call on completion, will not be called if none is provided.Running the example above, we get
1$sidebar-width: 50px; 2$color-scheme: ( 3 "theme": #666666, 4 "background": #333333 5); 6$width-breakpoints: ( 7 800px, 8 1200px 9); 10
Takes any file matching src_globs, interprets it as the StyleVars representation and converts to a standalone Javascript module (which can be required) and outputs it to the specified folder.
Configurable options are
String
- A prefix to add to the compiled JS files, defaults to "".String
- The extension to set for the output files, defaults to ".js".String
- A definition prefix to add to the contents of the compiled file, defaults to "module.exports = ".Integer
- The number of spaces to indent by, defaults to 4.String
- A label to be used for logging, defaults to a string representation of the source globs.Function
- A function to call on completion, will not be called if none is provided.Running the example above, we get
1module.exports = { 2 "sidebar-width": "50px", 3 "color-scheme": { 4 "theme": "#666666", 5 "background": "#333333" 6 }, 7 "width-breakpoints": [ 8 "800px", 9 "1200px" 10 ] 11};
Though everything can be done statically in the input file, all code will be evaluated on load, so more complicated structures are possible. Anything that returns a JSON object is valid, and will be compiled.
1function() { 2 var colors = { 3 "red": "#ff0000", 4 "green": "#00ff00" 5 }; 6 7 var config = { 8 "theme-color": colors["red"], 9 "sidebar-width": "200px", 10 "app-width": "1000px" 11 }; 12 13 config["content-width"] = (parseInt(config["app-width"]) - parseInt(config["sidebar-width"])) + "px"; 14 15 return config; 16}
1module.exports = { 2 "theme-color": "#ff0000", 3 "sidebar-width": "200px", 4 "app-width": "1000px", 5 "content-width": "800px" 6};
1$theme-color: #ff0000; 2$sidebar-width: 200px; 3$app-width: 1000px; 4$content-width: 800px;
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More