pento / testpress

Tool for helping you get a WordPress Core test environment up and running.
GNU General Public License v2.0
68 stars 2 forks source link

Refactor dark mode scss for @wordpress/components #147

Closed talldan closed 2 months ago

talldan commented 5 years ago

Is your feature request related to a problem? Please describe. At the moment dark mode overrides are scattered throughout our scss stylesheets for specific parts of the UI. The trouble is, if we continue this pattern, we'll end up duplicating those styles and in some cases introducing very minor visual variations.

Describe the solution you'd like For @wordpress/components styles, we should override styles on a component by component basis.

In my opinion, we should introduce stylesheets for each component we use from that package.

.e.g. for button, we'd have a file component-styles/button.scss, which might contain:

.components-button {
    .theme-dark & {
        color: $some-light-wordpress-color;

        // ... and so on
    }
}

Within these stylesheets we could also introduce other TestPress specific style variations.

Describe alternatives you've considered We could also look into how Gutenberg plans to tackle a dark mode (https://github.com/WordPress/gutenberg/issues/9483) and incorporate the same approach, but for now, I think we need an intermediate solution, which would be what I've proposed above.