Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upThemeing / Global colors #52
Comments
|
After a discussion with designers, here's the preferred approach to color variables / themeing:
So Components (e.g This allows:
Here’s an example of how this could be defined in the code, not sure how similar we are so far to this:
Note the descriptive description of colors use variants: PrimaryTextOnDark, ErrorSolid, ErrorLight, ErrorText |
|
ya agree I'm also not happy with the way we're using it. I'm considering allowing |
|
@cezaraugusto I don't think the Components should accept any explicit pixel values for padding, or anything. This defies the point of a component library and splits the style definition to multiple places. It precludes making single changes in the future because the consumption of the Components is tied to the current Implementation. Each Component should decide how it looks based on specific inputs (which as much as possible, and not tied to the exact look). But if anything, they don't need a const MyCardInstance = Card.extend`
position: absolute;
top: 10%;
right: 0;
` |
|
@petemill I guess we can close this? |
There doesn't yet seem to be anywhere to define the global color palette.
I assume this would be useful to do as a default theme, so that multiple themes can be added or overidden by a consuming app.
This should be doable without having to pass round a
theme={{ color: ... }}prop everywhere, via a ThemeProvider as described in the first example at: https://www.styled-components.com/docs/advanced#themingIt should be ok to require that consumers of brave-ui always use a ThemeProvider and that brave-ui provides the default provider.