blakeembrey / free-style

Make CSS easier and more maintainable by using JavaScript
MIT License
707 stars 29 forks source link

Support nested and interpolated rules #50

Closed blakeembrey closed 7 years ago

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.03%) to 98.828% when pulling d757f838cb97afb9175a597f0f88f2dd0b800281 on nest-rules into f6ca5630ff73f22cf6bb5f12fccd7b33209b710e on master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.03%) to 98.828% when pulling d757f838cb97afb9175a597f0f88f2dd0b800281 on nest-rules into f6ca5630ff73f22cf6bb5f12fccd7b33209b710e on master.

notoriousb1t commented 7 years ago

This looks like it won't affect TypeStyle downstream negatively. I ran all of our tests locally, and it appeared to improve the output css by combining rules and styles with the same properties and values. We will have to fix one test when we upgrade, but this it is due to that improvement

blakeembrey commented 7 years ago

I went ahead and spent a few hours optimizing the code paths to remove redundancy (saving maybe 20-30 LOC). Probably not a fantastic use of time, but it's done now and nice to merge these two code paths into one consistent behaviour 👍 I also exposed registerCss on master - not sure how many people want that sort of thing, but it seems like a useful addition, at least to load CSS into an object directly instead of a bunch of registerRule calls.