# dialog-settings

> SASS/SCSS module settings

Latest version **1.2.0** (published 2017-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install dialog-settings
pnpm add dialog-settings
yarn add dialog-settings
bun add dialog-settings
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-02-15 |
| First published | 2017-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | meodai |
| Maintainers | meodai |
| Keywords | sass, scss, design, modularity, css |

## Links

- npm: https://www.npmjs.com/package/dialog-settings
- Repository: https://github.com/meodai/dialog-settings
- Homepage: https://github.com/meodai/dialog-settings#readme
- Issues: https://github.com/meodai/dialog-settings/issues
- npm.io page: https://npm.io/package/dialog-settings

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-02-15
- 1.1.0 — 2017-02-15
- 1.0.0 — 2017-02-15

## README

![dialog(settings)](media/logo.png)

# dialog(settings) :book:

[![GitHub version](https://badge.fury.io/gh/meodai%2Fdialog-settings.svg)](https://badge.fury.io/gh/meodai%2Fdialog-settings)
[![npm version](https://badge.fury.io/js/dialog-settings.svg)](https://badge.fury.io/js/dialog-settings)
[![travis build](https://api.travis-ci.org/meodai/dialog-settings.svg?branch=master)](https://travis-ci.org/meodai/dialog-settings)

A simple key value store for module settings, to make modules more portable.
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 💾

```
npm install dialog-settings
```

## Basic usage ☝️

1. Import `dialog-settings.scss`

    ```scss
    @import 'dialog-settings/dist/dialog-settings';
    ```
    PS: make sure to add `node_modules` to your [import paths](https://github.com/sass/node-sass#includepaths)

2. Setup your module by setting a name-space and calling the setting mixin
    ```scss
    $module-name: 'somerandommodule';

    @include settings((
      gutter         : 1rem,
      color          : silver,
      color-contrast : gold
    ));
    ```

3. Call the `setting()` function.

    ```scss
    .#{$module-name} {
      padding: setting('gutter');
      &__submodule {
        color: setting(color);
      }
    }
    ```

4. By setting the global variable `$module-cssvariables` the variable are rendered as `CSS` variables.

## License 👮🏼

Created with ♥ by [meodai](//github.com/meodai). Licensed under the [MIT License](LICENSE).

---
_Source: https://npm.io/package/dialog-settings · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
