Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: theme tokens #138

Merged
merged 44 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ee3a56b
feat: theme tokens
bennypowers Aug 29, 2024
f9ed5d1
docs: theme
bennypowers Aug 29, 2024
dd4e78d
fix: fallbacks
bennypowers Aug 29, 2024
0cbdcd7
fix: markdown descriptions
bennypowers Aug 29, 2024
4e83795
refactor: actions
bennypowers Aug 29, 2024
6416c2b
docs: typos
bennypowers Aug 29, 2024
d3efb41
docs: tokens
bennypowers Aug 29, 2024
6212bf2
feat: icon, text-brand, etc
bennypowers Aug 29, 2024
4ea0417
fix: nested tokens under theme
bennypowers Aug 30, 2024
5a2c19e
docs: theme stuff
bennypowers Aug 30, 2024
b643536
fix: don't use multiple colors in css
bennypowers Aug 30, 2024
5c096d4
docs: nice md
bennypowers Aug 30, 2024
ac72db1
docs: nice md
bennypowers Aug 30, 2024
aa3e82d
docs: nicer sample
bennypowers Aug 30, 2024
f1ad1c5
docs: fix samp
bennypowers Aug 30, 2024
ef2ff28
docs: fix samp
bennypowers Aug 30, 2024
4533052
docs: fix sampe
bennypowers Aug 30, 2024
1040604
docs: fix demo
bennypowers Aug 30, 2024
b59fe40
docs: more content
bennypowers Aug 30, 2024
320efbf
docs: fancier demo
bennypowers Aug 30, 2024
a21fab4
docs: title and icon
bennypowers Sep 2, 2024
a183d3f
fix: border and status token names
bennypowers Sep 2, 2024
dee5d1a
chore: node version
bennypowers Sep 2, 2024
b2ca062
fix(editor): fix color snippets
bennypowers Sep 2, 2024
0b00552
fix: interactive and status tokens
bennypowers Sep 2, 2024
8ee935c
fix: textmate comments
bennypowers Sep 2, 2024
f4f30f4
perf: reduce size of copyright header
bennypowers Sep 2, 2024
3fd63d6
feat: rhds context output
bennypowers Sep 2, 2024
5692419
fix: docs, interactive tokens
bennypowers Sep 2, 2024
89a8ce3
docs: config
bennypowers Sep 3, 2024
e69ee6c
feat: cjs plugin for stylelint
bennypowers Sep 3, 2024
4cdd204
fix: build steps
bennypowers Sep 3, 2024
e2352c6
fix: esm stylelint headache
bennypowers Sep 3, 2024
0fbb3b7
fix: surface computed
bennypowers Sep 3, 2024
911363a
fix: nullify computed tokens in map
bennypowers Sep 3, 2024
154d881
fix(stylelint): better fix, messages
bennypowers Sep 3, 2024
c695a6f
feat(stylelint): deprecated rule
bennypowers Sep 3, 2024
aa58474
fix: restore and deprecate interactive colours
bennypowers Sep 3, 2024
de82401
fix: shadow tokens
bennypowers Sep 3, 2024
db058f5
docs: changesets
bennypowers Sep 3, 2024
e14a8dc
style: whitespace
bennypowers Sep 3, 2024
73f4995
docs: nice theme demo
bennypowers Sep 3, 2024
0a9fd19
docs: nice font samples
bennypowers Sep 3, 2024
6a41135
docs: btt
bennypowers Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/interactive-tokens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@rhds/tokens": minor
---

✨ Added interactive tokens, and **DEPRECATES** the older interactive tokens

```diff
- color: var(--rh-color-interactive-blue-darker);
+ color: var(--rh-color-interactive-primary-default-on-light);
- color: var(--rh-color-interactive-purple-darker);
+ color: var(--rh-color-interactive-primary-visited-default-on-light);
```
17 changes: 0 additions & 17 deletions .changeset/kind-singers-count.md

This file was deleted.

34 changes: 34 additions & 0 deletions .changeset/responsive-theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"@rhds/tokens": minor
---
Added theme tokens for responsive colours. Read these in a themable container
such as `<rh-card>` to style themable content that responds to the color palette

```html
<rh-surface color-palette="lighter">
<p>Use <a href="#">theme tokens</a> for best results.<p>
<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>
</rh-surface>
```

```css
rh-surface {
& a {
color: var(--rh-color-interactive-primary-default);
&:hover { color: var(--rh-color-interactive-primary-hover); }
&:focus-within { color: var(--rh-color-interactive-primary-focus); }
&:active { color: var(--rh-color-interactive-primary-active); }
&:visited {
color: var(--rh-color-interactive-primary-visited);
&:hover { color: var(--rh-color-interactive-primary-visited-hover); }
&:focus-within { color: var(--rh-color-interactive-primary-visited-focus); }
&:active { color: var(--rh-color-interactive-primary-visited-active); }
}
}
}
```

For more information, please see our [theming docs](https://ux.redhat.com/themeing).
22 changes: 9 additions & 13 deletions .changeset/rich-bags-deliver.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
"@rhds/tokens": minor
---

Added status tokens
✨ Added status tokens:

RHDS describes six statuses: `danger`, `warning`, `caution`, `neutral`, `note`, and `success`.

```css
button {
.light &.danger {
background: var(--rh-color-status-danger-on-light);
}
.light &.success {
background: var(--rh-color-status-success-on-light);
}
.dark &.danger {
background: var(--rh-color-status-danger-on-dark);
}
.dark &.success {
background: var(--rh-color-status-success-on-dark);
}
&.danger { background: var(--rh-color-status-danger); }
&.warning { background: var(--rh-color-status-warning); }
&.caution { background: var(--rh-color-status-caution); }
&.neutral { background: var(--rh-color-status-neutral); }
&.note { background: var(--rh-color-status-note); }
&.success { background: var(--rh-color-status-success); }
}
```
File renamed without changes.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ json/**/*
css/**/*
scss/**/*
design/**/*
plugins/cjs
plugins/**/*.cjs
plugins/**/*.cjs.map
plugins/**/*.d.cts
plugins/**/*.js
plugins/**/*.js.map
plugins/**/*.d.ts
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.6.0
v22.7.0
7 changes: 7 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export async function build(): Promise<void> {
sd.registerTransform(Transforms.colorFormats);
sd.registerTransform(Transforms.hslValue);
sd.registerTransform(Transforms.rgbValue);
sd.registerTransform(Transforms.themeTokens);
sd.registerTransform(Transforms.remToPx);
sd.registerTransform(Transforms.pxNumeric);
sd.registerTransform(Transforms.mediaQuery);
Expand All @@ -86,8 +87,14 @@ export async function build(): Promise<void> {
sd.registerTransformGroup(TransformGroups.sketch);

sd.registerFilter(Filters.isColor);
sd.registerFilter(Filters.isThemeColorToken);
sd.registerFilter(Filters.isNotThemeColorToken);
sd.registerFilter(Filters.isLightThemeColorToken);
sd.registerFilter(Filters.isDarkThemeColorToken);

sd.registerFormat(Formats.litCss);
sd.registerFormat(Formats.rhdsColorContextConsumer);
sd.registerFormat(Formats.rhdsColorContextProvider);
sd.registerFormat(Formats.mapEs);
sd.registerFormat(Formats.mapCjs);
sd.registerFormat(Formats.metaMapEs);
Expand Down
Loading
Loading