Skip to content

Conversation

@gadenbuie
Copy link

WIP, mostly for discussion and tinkering. This PR does a few things:

  1. First, I added the shiny- prefix to props that are officially part of our design system, e.g. --shiny-text-1 instead of --text-1.

  2. I added a new layer of variables that are intended to be "public" facing in the sense that they can be modified at the page level or by page-level CSS. These are prefixed with shiny-theme-, e.g. --shiny-theme-text-1. The explicit goal of these properties is to serve page-level adapters in situations where we want the shiny design system to inherit from the page.

  3. The --shiny-* tokens in this system are considered the component-facing properties; these should be used by the web components or by adapters for web components. I updated the shoelace adapter to use these tokens.

The motivation for this is two-fold:

  1. First, it increases clarity around the source of our design tokens. Without the shiny- prefix, it can be hard to tell which properties come from open props and which properties are aliases we've created ourselves.

  2. CSS variables cannot refer to themselves, so for page-level adapters to set a CSS variable, the fallback value in that adapter cannot refer to the variable being set. Introducing --shiny-theme-* allows page-level adapters to be included in more situations and reduces the risk that an unset variable will break a design token variable.

@wch
Copy link
Owner

wch commented Jun 29, 2023

I don’t have strong feelings either way about having a prefix, but I think --shiny- might actually not be quite right, since many of these components will be usable outside of Shiny.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants