FormidableLabs / css-to-radium

Radium migration CLI, converts CSS to Radium-compatible JS objects.
MIT License
79 stars 5 forks source link

Feature: add the thing #1

Closed alexlande closed 9 years ago

alexlande commented 9 years ago

This adds an extremely simple CLI tool to generate valid react inline styles from a CSS source file. Some known limitations at this point (I'll open issues with these, but didn't want to block on making something available.):

/cc @colinmegill @ryan-roemer

alexlande commented 9 years ago

Thinking on this more, I'm going to push a couple of extra commits here to handle two cases better:

  1. Media queries (fine I'll just do it ugh)
  2. Multiple declarations with the same selector (ideally your CSS shouldn't include this, but it's possible! May as well account for it).
alexlande commented 9 years ago

Pushed changes so that this will handle media queries now. I also explored handling duplicate selectors, but I couldn't think of a valid use case for that, so instead I'm just merging any duplicate selectors together now, which behaves similarly to the way the browser would handle those styles anyway (with duplicate styles declared later taking precedence).

alexlande commented 9 years ago

@ryan-roemer: Can I trouble you for one last review?

ryan-roemer commented 9 years ago

@alexlande -- Some comments and suggestions, rest LGTM without re-review. Nice work!