classy-ui
classy-ui copied to clipboard
Proposal: Global Styles API
trafficstars
Hi! I would like to open the discussion around global styles. I think it's a very useful feature to be able to add global styles, similarly to styled-components createGlobalStyle. One use-case would be the ability to style tags that are outside the component tree, like the body tag, with values from the theme. I don't think this is possible with the current API.
perhaps the API could look something like this:
composeGlobal('body', tokens.backgroundColor.GRAY_10, ... );
or alternatively:
addGlobal('body', compose(tokens.backgroundColor.GRAY_10, ... ));
What do you guys think?
I like it. I'm currently migrating from styled-components to classy-ui and createGlobalStyle will be one of the few things that I don't yet know how to migrate.