classy-ui icon indicating copy to clipboard operation
classy-ui copied to clipboard

Proposal: Global Styles API

Open biowaffeln opened this issue 5 years ago • 1 comments
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?

biowaffeln avatar Mar 16 '20 15:03 biowaffeln

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.

CodingDive avatar Apr 09 '20 18:04 CodingDive