Code Monkey home page Code Monkey logo

tinge's Introduction

Tinge

Extract color information from CSS/SCSS files (for various formats).

Usage

You can see usage information by running tinge help.

Currently the only available operation is extracting color variable assignments from SCSS files and outputting them to various formats:

  • ASE (Adobe Swatch Exchange)
  • SCSS (but with all variable assignments and functions resolved)
  • JSON
  • Ruby
  • YAML

This command is executed as tinge vars, although since it's the default, vars can be omitted (as is in the examples below):

As an example, using this simple SCSS file:

$ cat colors.scss
$white: white;
$gray: darken($white, 85%);
$orange: #fab444;

We can get the final (resolved) SCSS:

$ tinge colors.scss
$gray: #262626;
$orange: #fab444;
$white: #ffffff;

Convert it to a JSON object suitable for use in JavaScript:

$ tinge -f json colors.scss
{"white":"#ffffff","gray":"#262626","orange":"#fab444"}

Output it as YAML (and note tinge accepts stdin, too):

$ cat colors.scss | tinge -f yml
---
gray: "#262626"
orange: "#fab444"
white: "#ffffff"

We can also create an ASE file (note --output/-o is required):

$ tinge -f ase colors.scss -o colors.ase

Contributing

  1. Fork it: http://github.com/bruce/tinge/fork
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

tinge's People

Contributors

bruce avatar

Watchers

Ariel Salminen avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.