Skip to content

Commit

Permalink
docs: theme
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Aug 29, 2024
1 parent ee3a56b commit f9ed5d1
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tokens/color/interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,36 @@ color:
order: 30
description: >-
Each theme features two shades of blue, one for Link and Focus states and one for Hover
and Active states.
and Active states. Use the `--rh-interactive-(blue|purple)-(normal|emphasized)` theme
tokens in order to style content of themable containers like `<rh-surface>`:
```html
<rh-surface color-palette="lighter">
<rh-card color-palette="darkest">
<p>That way, colours respond to their parents' <code>color-palette</code>
Without requiring <a href="#">custom CSS</a></p>
</rh-card>
<p>Use <a href="#">theme tokens</a> for best results.
</rh-surface>
```
```css
rh-surface {
& a {
color: var(--rh-color-interactive-blue-normal);
&:hover,
&:focus-within,
&:active { color: var(--rh-color-interactive-blue-emphasized); }
&:visited {
color: var(--rh-color-interactive-purple-normal);
&:hover,
&:focus-within,
&:active { color: var(--rh-color-interactive-purple-emphasized); }
}
}
}
```
blue:
lightest:
Expand Down

0 comments on commit f9ed5d1

Please sign in to comment.