FormidableLabs/css-to-radium

Name: css-to-radium

Owner: Formidable

Description: Radium migration CLI, converts CSS to Radium-compatible JS objects.

Created: 2015-02-28 19:06:54.0

Updated: 2017-12-24 03:08:29.0

Pushed: 2016-07-17 09:35:22.0

Homepage: null

Size: 14

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

CSS to Radium

A CLI utility to convert the contents of a CSS file to a Radium-compatible JS object.

Installation
m install css-to-radium
Usage

By default, css-to-radium works with stdin and stdout:

s-to-radium < example/style.css > example/style.js

You can also target a source file directly with the --input flag and return a converted file by specifying the target path after any options:

s-to-radium --input style.css style.js

Or you can mix and match the two:

s-to-radium --input example/style.css > example/style.js

It turns a file like this:

tyle.css */
 {
ckground: #ccc;
dding: 10px;
nt-size: 16px;


-primary {
ckground: orange;
lor: #fff;

into one like this:

tyle.js

le.exports = {
btn": {
background: "#ccc",
padding: 10,
fontSize: 16

btn-primary": {
background: "orange",
color: "white"


Options
input

--input [inputSrc]

A source file to use as input. To process multiple files at once, include this flag multiple times:

s-to-radium --input style.css --input more.css
quote

--quote [type]

Type of quote used in generated JS. Defaults to single.

to-radium style.css style.js --quote double
indentSize

--indentSize [int]

Number of space characters to use for indents in generated JS. If this flag is not included, defaults to a single tab character (\t).

to-radium style.css style.js --indentSize=2
Webpack

Using Webpack? Check out radium-loader.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.