https://github.com/ctxhou/color_json
https://github.com/ctxhou/color_json
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ctxhou/color_json
- Owner: ctxhou
- License: mit
- Created: 2015-01-09T10:02:19.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-09T10:44:03.000Z (over 11 years ago)
- Last Synced: 2025-03-04T07:40:36.510Z (over 1 year ago)
- Language: Ruby
- Homepage: http://canner-can.github.io/color-table/
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ColorJson
Easy way to show your `sass/scss/less` color list.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'color_json'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install color_json
## Usage
color_json build
then you would got your `color.json` file!
### Example
#### Basic usage
`no_group.scss`:
```scss
$aqua: #7FDBFF;
$blue: #0074D9;
$navy: #001F3F;
$teal: #39CCCC;
```
it would generate:
`color.json`:
```json
"color": {
"$aqua": " #7FDBFF;",
"$blue": " #0074D9;",
"$navy": " #001F3F;",
"$teal": " #39CCCC;"
}
```
#### Group usage
You can use `//**` to label your color usage.
`group.scss`:
```scss
//** main color
$aqua: #7FDBFF;
$blue: #0074D9;
//** other
$yellow: #FFDC00;
$orange: #FF851B;
```
it would generate:
`color.json`:
```json
"color": {
"main color": {
"$aqua": " #7FDBFF;",
"$blue": " #0074D9;"
},
"other": {
"$yellow": " #FFDC00;",
"$orange": " #FF851B;"
}
}
```
## What the color.json can do?
`color.json` can combine with [canner](http://github.com/canner/canner) and help you show your color list very quickly.
Reference the can: [color-table](https://github.com/Canner-can/color-table/) for more info.
## Issue
This gem now only support `scss`. It has many needs for imporvement.
Feel free to fork it and pull request.
## License
[@ctxhou](http://github.com/ctxhou) MIT