Skip to content

Commit ef88244

Browse files
committed
Finish up refactor of unused CSS variables to theme variables
1 parent bc32c1e commit ef88244

16 files changed

Lines changed: 57 additions & 74 deletions

File tree

‎_TODO.md‎

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -204,29 +204,12 @@ Error Context: .cache/playwright/output/01-smoke-dynamic-pages-Dyn-8a015-ages-ha
204204
[mobile-safari] › test/e2e/specs/01-smoke/dynamic-pages.spec.ts:171:3 › Dynamic Pages @smoke › @ready dynamic pages have no console errors
205205
```
206206
207-
Undefined var(--color-…) Tokens (definitely not in theme-inline.css)
208-
209-
--color-text (9): index.astro:47, button.module.css:56
210-
--color-bg-offset (4): index.astro:36, button.module.css:150
211-
--color-danger-bg (4): index.astro:33, index.module.css:12
212-
--color-success-bg (3): index.astro:38, index.astro:198
213-
--color-twitter (3): button.module.css:93
214-
--color-border (2): themePicker.module.css:51, index.ts:461
215-
--color-gray-500 (2): uppy-dashboard.css:3292
216-
--color-link-shadow (2): index.ts:30
217-
Singles: --color-error, --color-error-bg, --color-error-border, --color-error-text (all in index.astro:205); --color-gray-100 (uppy-dashboard.css:3112); --color-info-bg (index.astro:35); --color-success-border, --color-success-text (index.astro:199); --color-theme-sprites (ADDING_ICONS.md:50)
218-
219-
Tailwind Color Utilities Not Backed By Theme Tokens (quoted class strings)
220-
High-frequency / likely broken given the @theme contract:
221-
222-
bg-blue-100 (7): e.g. index.astro:67
223-
stroke-text (not a theme token) (seen in class attrs): e.g. index.astro:94
224-
bg-text (2): index.astro:111, index.spec.ts:299
225-
226-
Default-palette style utilities that don’t exist in theme-inline.css (so likely broken now unless reintroduced elsewhere):
227-
228-
bg-gray-100 (4): e.g. index.astro:166
229-
text-blue-400 (16): e.g. index.astro:205
230-
bg-blue-50 (5): e.g. index.astro:147
231-
border-blue-200 (3): e.g. index.astro:826
232-
Similar one-offs: bg-purple-100, text-purple-600, border-blue-500, bg-orange-100, etc. (all in the scan output)
207+
--color-blue-200
208+
--color-blue-400
209+
--color-blue-50
210+
--color-blue-500
211+
--color-gray-100
212+
--color-gray-500
213+
--color-orange-100
214+
--color-purple-100
215+
--color-purple-600

‎src/components/Button/button.module.css‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
.variantPrimary {
5454
background-color: var(--color-primary);
5555
box-shadow: var(--shadow-sm);
56-
color: var(--color-text);
56+
color: var(--color-content);
5757
}
5858

5959
.variantPrimary:hover,
6060
.variantPrimary:focus-visible {
6161
background-color: var(--color-primary-offset);
6262
box-shadow: var(--shadow-hover);
63-
color: var(--color-text);
63+
color: var(--color-content);
6464
transform: translateY(-1px);
6565
}
6666

@@ -72,14 +72,14 @@
7272

7373
.variantSecondary {
7474
background-color: var(--color-secondary);
75-
color: var(--color-text);
75+
color: var(--color-content);
7676
}
7777

7878
.variantSecondary:hover,
7979
.variantSecondary:focus-visible {
8080
background-color: var(--color-secondary-offset);
8181
box-shadow: var(--shadow-hover);
82-
color: var(--color-text);
82+
color: var(--color-content);
8383
transform: translateY(-1px);
8484
}
8585

@@ -90,15 +90,15 @@
9090
}
9191

9292
.variantTwitter {
93-
background-color: var(--color-twitter);
94-
border-color: var(--color-twitter);
95-
color: var(--color-text);
93+
background-color: var(--color-x);
94+
border-color: var(--color-x);
95+
color: var(--color-content);
9696
}
9797

9898
.variantTwitter:hover,
9999
.variantTwitter:focus-visible {
100100
background-color: transparent;
101-
color: var(--color-twitter);
101+
color: var(--color-x);
102102
}
103103

104104
.variantSuccess {
@@ -121,7 +121,7 @@
121121

122122
.variantWarning {
123123
background-color: var(--color-warning);
124-
color: var(--color-text);
124+
color: var(--color-content);
125125
}
126126

127127
.variantWarning:hover,
@@ -141,16 +141,16 @@
141141
aspect-ratio: 1 / 1;
142142
background-color: transparent;
143143
box-shadow: none;
144-
color: var(--color-text);
144+
color: var(--color-content);
145145
padding: 0.5rem;
146146
}
147147

148148
.variantIcon:hover,
149149
.variantIcon:focus-visible {
150-
background-color: var(--color-bg-offset);
150+
background-color: var(--color-page-base-offset);
151151
color: var(--color-primary);
152152
}
153153

154154
.variantIcon:active {
155-
background-color: var(--color-bg-offset);
155+
background-color: var(--color-page-base-offset);
156156
}

‎src/components/Calendar/index.astro‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { ...rest } = Astro.props
99
type="button"
1010
data-calendar-trigger
1111
aria-expanded="false"
12-
class="inline-flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-text! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
12+
class="inline-flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-icons! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
1313
>
1414
<span class="[&_.icon]:h-5 [&_.icon]:w-5">
1515
<Icon name="calendar-generic-ical" variant="inherit" />
@@ -28,7 +28,7 @@ const { ...rest } = Astro.props
2828
data-calendar-link="google"
2929
href="https://calendar.google.com/calendar/render"
3030
rel="noopener"
31-
class="flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-text! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
31+
class="flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-icons! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
3232
>
3333
<span class="[&_.icon]:h-5 [&_.icon]:w-5">
3434
<Icon name="calendar-google" variant="inherit" />
@@ -40,7 +40,7 @@ const { ...rest } = Astro.props
4040
data-calendar-link="outlook"
4141
href="https://outlook.office.com/calendar/0/deeplink/compose"
4242
rel="noopener"
43-
class="flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-text! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
43+
class="flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-icons! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
4444
>
4545
<span class="[&_.icon]:h-5 [&_.icon]:w-5">
4646
<Icon name="calendar-outlook" variant="inherit" />
@@ -51,7 +51,7 @@ const { ...rest } = Astro.props
5151
<button
5252
type="button"
5353
data-calendar-download-ics
54-
class="flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-text! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
54+
class="flex items-center text-content underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-icons! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
5555
>
5656
<span class="[&_.icon]:h-5 [&_.icon]:w-5">
5757
<Icon name="calendar_apple" variant="inherit" />

‎src/components/CallToAction/Featured/index.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const titleId = `${id}-title`
5858
<div class="py-8 md:py-12" data-audience={audience}>
5959
<aside class="container mx-auto px-4 sm:px-6 lg:px-8" aria-labelledby={titleId}>
6060
<div
61-
class="bg-linear-to-br from-(--color-success-bg) to-(--color-info-bg) rounded-2xl shadow-xl overflow-hidden"
61+
class="bg-linear-to-br from-(--color-success-inverse) to-(--color-info-inverse) rounded-2xl shadow-xl overflow-hidden"
6262
>
6363
<div class={`grid gap-8 ${image ? 'lg:grid-cols-2' : 'lg:grid-cols-1'} items-center`}>
6464
<!-- Content Column -->

‎src/components/Callout/index.astro‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ const iconMap = {
3030
3131
// Map callout types to their background color CSS custom properties
3232
const backgroundColorMap = {
33-
warning: 'var(--color-danger-bg)',
34-
action: 'var(--color-danger-bg)',
35-
info: 'var(--color-info-bg)',
36-
tip: 'var(--color-bg-offset)',
37-
note: 'var(--color-bg-offset)',
38-
success: 'var(--color-success-bg)',
39-
danger: 'var(--color-danger-bg)',
33+
warning: 'var(--color-danger-inverse)',
34+
action: 'var(--color-danger-inverse)',
35+
info: 'var(--color-info-inverse)',
36+
tip: 'var(--color-page-base-offset)',
37+
note: 'var(--color-page-base-offset)',
38+
success: 'var(--color-success-inverse)',
39+
danger: 'var(--color-danger-inverse)',
4040
} as const
4141
4242
// Map callout types to their border/icon color CSS custom properties
4343
const borderColorMap = {
4444
warning: 'var(--color-danger)',
4545
action: 'var(--color-danger)',
4646
info: 'var(--color-info)',
47-
tip: 'var(--color-text)',
48-
note: 'var(--color-text)',
47+
tip: 'var(--color-content)',
48+
note: 'var(--color-content)',
4949
success: 'var(--color-success)',
5050
danger: 'var(--color-danger)',
5151
} as const

‎src/components/Footer/index.astro‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const year = new Date().getFullYear()
9191
href={social.url}
9292
title={social.displayName}
9393
rel="me"
94-
class="flex items-baseline uppercase underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-text! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
94+
class="flex items-baseline uppercase underline decoration-dotted decoration-content underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none [&_.icon]:fill-content! [&_.icon]:stroke-icons! hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary!"
9595
>
9696
<span class="[&_.icon]:h-4 [&_.icon]:w-4">
9797
<Icon name={social.iconName} variant="inherit" />
@@ -153,7 +153,7 @@ const year = new Date().getFullYear()
153153
<a
154154
href={`${getSiteUrl()}/rss.xml`}
155155
title="RSS Feed"
156-
class="[&_.icon]:fill-content! [&_.icon]:stroke-text! [&_.icon]:h-10 [&_.icon]:w-10 hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary! focus:outline-none"
156+
class="[&_.icon]:fill-content! [&_.icon]:stroke-icons! [&_.icon]:h-10 [&_.icon]:w-10 hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary! focus:outline-none"
157157
>
158158
<span class="sr-only">RSS Feed</span>
159159
<span><Icon name="feed" variant="inherit" /></span>
@@ -180,7 +180,7 @@ const year = new Date().getFullYear()
180180
<a
181181
href={`${getSiteUrl()}/rss.xml`}
182182
title="RSS Feed"
183-
class="[&_.icon]:fill-content! [&_.icon]:stroke-text! [&_.icon]:h-10 [&_.icon]:w-10 hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary! focus:outline-none"
183+
class="[&_.icon]:fill-content! [&_.icon]:stroke-icons! [&_.icon]:h-10 [&_.icon]:w-10 hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary! focus:outline-none"
184184
>
185185
<span class="sr-only">RSS Feed</span>
186186
<span><Icon name="feed" variant="inherit" /></span>
@@ -193,7 +193,7 @@ const year = new Date().getFullYear()
193193
id="bugReporterTrigger"
194194
type="button"
195195
title="Report a bug"
196-
class="[&_.icon]:fill-content! [&_.icon]:stroke-text! [&_.icon]:h-10 [&_.icon]:w-10 hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary! focus:outline-none"
196+
class="[&_.icon]:fill-content! [&_.icon]:stroke-icons! [&_.icon]:h-10 [&_.icon]:w-10 hover:[&_.icon]:fill-secondary! hover:[&_.icon]:stroke-secondary! focus:[&_.icon]:fill-secondary! focus:[&_.icon]:stroke-secondary! focus:outline-none"
197197
>
198198
<span class="sr-only">Report a bug</span>
199199
<span><Icon name="bug" variant="inherit" /></span>

‎src/components/Forms/Download/index.astro‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ const downloadUrl = `/downloads/${fileName}`
195195

196196
<style>
197197
#downloadFormStatus.success {
198-
background-color: var(--color-success-bg);
199-
border: 1px solid var(--color-success-border);
200-
color: var(--color-success-text);
198+
background-color: var(--color-success-inverse);
199+
border: 1px solid var(--color-success-offset);
200+
color: var(--color-success);
201201
display: block;
202202
}
203203

204204
#downloadFormStatus.error {
205-
background-color: var(--color-error-bg);
206-
border: 1px solid var(--color-error-border);
207-
color: var(--color-error-text);
205+
background-color: var(--color-danger-inverse);
206+
border: 1px solid var(--color-danger-offset);
207+
color: var(--color-danger);
208208
display: block;
209209
}
210210
</style>

‎src/components/Icon/ADDING_ICONS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Icons integrate with the site's theming system via CSS custom properties:
4747
```css
4848
/* In src/styles/icons.css */
4949
[astro-icon] {
50-
color: var(--color-theme-sprites);
50+
color: var(--color-icons);
5151
fill: currentColor;
5252
}
5353
```

‎src/components/Social/Mastodon/client/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ export class MastodonModalElement extends LitElement {
458458
<style>
459459
.saved-list :global(.saved-instance) {
460460
background: var(--color-page-base-offset);
461-
border: 1px solid var(--color-border);
461+
border: 1px solid var(--color-trim);
462462
border-radius: 0.25rem;
463463
color: var(--color-primary);
464464
cursor: pointer;
@@ -473,7 +473,7 @@ export class MastodonModalElement extends LitElement {
473473
}
474474
475475
.modal-status.error {
476-
color: var(--color-error);
476+
color: var(--color-danger);
477477
}
478478
479479
.modal-status.success {

‎src/components/Test/client/webComponent.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class TestWebComponent extends LitElement {
1212
static override styles = css`
1313
:host {
1414
display: block;
15-
border: 1px dashed var(--color-border, #888);
15+
border: 1px dashed var(--color-trim, #888);
1616
padding: 0.5rem;
1717
}
1818
`

0 commit comments

Comments
 (0)