jouni-kantola / ruin

A CSS post-processor that saves bytes over the wire by shortening names of CSS classes.
MIT License
2 stars 0 forks source link

first ruined css #2

Closed jouni-kantola closed 8 years ago

jouni-kantola commented 8 years ago

I guess the first parts should be pretty easy to do test-driven. Run in-memory with tests, for as long as possible.

jouni-kantola commented 8 years ago

We're soon here. Now we're able to:

  1. Read files/content
  2. Generate short CSS class list
  3. Map source with target (4. We cannot yet replace values in content)
  4. Write file
jouni-kantola commented 8 years ago

All righty. Works on my computer. First ruined CSS in PR https://github.com/davidxcheng/ruin/pull/25.

.class1 {}
.class2 {}
.class1 {}
.class3 {}

Became

.A00 {}
.A0 {}
.A00 {}
.A01 {}
jouni-kantola commented 8 years ago

It would be pretty easy to run in-memory integration tests using mock-fs to test the workflow as well.

jouni-kantola commented 8 years ago

From my point of view, this is passed us. Now on to handle multiple source files.