dialog-settings
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "dialog-settings", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "SASS/SCSS module settings", | ||
"main": "gulpfile.js", | ||
"scripts": { | ||
"test": "gulp test:sass" | ||
"test": "gulp test:sass", | ||
"build": "gulp build", | ||
"dev": "gulp", | ||
"deploy": "gulp build && gh-pages -d demo" | ||
}, | ||
@@ -9,0 +12,0 @@ "repository": { |
@@ -10,4 +10,39 @@ ![dialog(settings)](media/logo.png) | ||
A simple key value store for module settings, to make modules more portable. | ||
With the nice side-effect that all settings can be output as native CSS variables. | ||
With the nice side-effect that all settings can be rendered as native CSS variables. Play with the [demo](http://www.sassmeister.com/gist/230dc13729262d55d92f1efbcd2a69a5). | ||
## Why ⁉️️ | ||
1. Easy way to switch between rendered values and CSS variables. | ||
2. Better portabily: Only have to rename one string, not tons of variable names as well, when renaming/moving a module. | ||
3. Warn when variables are missing instead of failing the build. Allows to mock the CSS for a module withought knowing the values for each property. | ||
### Before | ||
```scss | ||
$module-name: 'mymodule'; | ||
$mymodule-background: $colors-dark; | ||
$mymodule-color: $colors-contrast; | ||
$mymodule-margin: 2rem; | ||
.#{$module-name} { | ||
color: $mymodule-color; | ||
background: $mymodule-background; | ||
margin: $mymodule-margin; | ||
} | ||
``` | ||
### With dialog(settings) | ||
```scss | ||
$module-name: 'mymodule'; | ||
@include settings(( | ||
color: $colors-dark, | ||
background: $colors-contrast, | ||
margin: 2rem | ||
)); | ||
.#{$module-name} { | ||
color: setting(color); | ||
background: setting(background); | ||
margin: setting(margin); | ||
} | ||
``` | ||
## Installation 💾 | ||
@@ -14,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88548
89