Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/actuallyacat/json-to-flat-sass
Small little utility to take a json file and transform it to Less or Sass variables
https://github.com/actuallyacat/json-to-flat-sass
Last synced: about 1 month ago
JSON representation
Small little utility to take a json file and transform it to Less or Sass variables
- Host: GitHub
- URL: https://github.com/actuallyacat/json-to-flat-sass
- Owner: ActuallyACat
- Created: 2019-11-04T04:05:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T00:03:42.000Z (about 2 years ago)
- Last Synced: 2024-11-01T12:10:28.185Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.19 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-to-flat-sass
Generates "flat" sass variables from your JSON.
There's quite a few libraries around that generate Sass from a JSON files. This one provides support for older versions of Sass (<3.3) which do not support (Advanced Variable Functions)[https://sass-lang.com/documentation/variables#advanced-variable-functions].
TL;DR
This:
```
{
"colours": {
"red": {
"100": "#ff4343";
"200": "#e11f1f";
"300": "#bf0c0c";
}
}
}
```
transforms to this:
```
$colours-red-100: "#ff1313"
$colours-red-200: "#e11f1f";
$colours-red-300: "#bf0c0c";
```## Usage
### Install
```
yarn add @actuallyacat/json-to-flat-sass
```### Usage
```
json-to-flat-sass []
```