WebMemex / webmemex-extension

📇 Your digital memory extension, as a browser extension
https://webmemex.org
Other
208 stars 45 forks source link

[RFC] Introduce CSS modules & covert /src/options over to using them #34

Closed aquibm closed 7 years ago

aquibm commented 7 years ago

Why?

This approach is much less restrictive than using the css-in-js approach that we had earlier. We're simply writing css here and can therefore easily style pseudo elements and make use of css animations. It also brings in new css features (variables, nesting, etc) and follows the golden rule that all styles are local to the component unless explicitly made global. (see routeTitle in base.css)

Changes:

Future Tasks:

RFC?

This is the first time I've used css-modules through browserify, not sure if it's setup correctly. @Treora, please let me know if I need to change anything 👍

Treora commented 7 years ago

I am starting to like the idea of css-modules, to organise style in the same hierarchy and to make it traceable where a component's style is defined. It looks like css-next gives the main features I wanted to use scss for, but now with at least the pretension that it will be normally supported css some day.

If you like this approach I am happy to apply it to the whole project. In any case this seems better than either inline styles defined in javascript or having a single css file.

Treora commented 7 years ago

Apart from these details, would this be ready to merge?

Treora commented 7 years ago

By the way, feel free to squash all the tiny fixes in a single commit, keeping up the appearance that everything was perfect at the first shot. ;)

aquibm commented 7 years ago

Yep, this is good to merge :shipit: