react-ui-org / react-ui

React UI is a themeable and performant UI library for React apps.
https://react-ui.io
MIT License
21 stars 7 forks source link

Leverage CSS cascade layers to fix and user-proof styles order #518

Closed adamkudrna closed 5 months ago

adamkudrna commented 9 months ago

This is a follow-up issue of #517.

As a result of #440, component styles are no longer part of the JS bundle. They reside in the extracted react-ui[.development].css file. The order of styles in this stylesheet is incorrect and may cause styling issues.

The reason of the incorrect order is in the call order in src/index.js: first, there are imports (theme, foundation, ⚠️ helpers ⚠️), then exports (components).

Cascade layers will help keep the styles in correct order, no matter how they are called.