Skip to content

Commit 143a352

Browse files
committed
Convert 'See Resume' on About page to a button to meet WCAG requirements
1 parent 00c9d52 commit 143a352

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

src/components/Button/server/__tests__/index.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ describe('Button server helpers', () => {
5050
expect(classList['aspect-square']).toBe(true)
5151
expect(classList['p-2']).toBe(true)
5252
})
53+
54+
it('supports the page-inverse variant', () => {
55+
const classList = buildButtonClassList({
56+
variant: 'page-inverse',
57+
})
58+
59+
expect(classList['bg-page-inverse']).toBe(true)
60+
expect(classList['text-content-inverse']).toBe(true)
61+
expect(classList['hover:bg-content-active']).toBe(true)
62+
})
5363
})
5464

5565
describe('resolveAriaLabel', () => {

src/components/Button/server/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export type ButtonVariant =
22
| 'danger'
33
| 'note'
4+
| 'page-inverse'
45
| 'primary'
56
| 'secondary'
67
| 'twitter'
@@ -81,6 +82,11 @@ const variantClasses: Record<ButtonVariant, string> = {
8182
'hover:bg-note-offset ' +
8283
'focus-visible:bg-note-offset ' +
8384
'active:bg-note-offset',
85+
'page-inverse':
86+
'bg-page-inverse text-content-inverse ' +
87+
'hover:bg-content-active ' +
88+
'focus-visible:bg-content-active ' +
89+
'active:bg-content-active',
8490
primary:
8591
'bg-primary text-primary-inverse ' +
8692
'hover:bg-primary-offset ' +

src/components/Pages/About/index.astro

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import Contact from '@components/CallToAction/Contact/index.astro'
33
import HeadingAnchor from '@components/Layout/HeadingAnchor/index.astro'
4+
import Button from '@components/Button/index.astro'
45
import Icon from '@components/Icon/index.astro'
56
67
export type Props = {
@@ -88,13 +89,17 @@ const expertiseIcons = ['cloud', 'document', 'gear', 'globe', 'wrench', 'chart']
8889
<h3 class="text-page-inverse mb-2">{item.title}</h3>
8990
<p class="text-content leading-relaxed">{item.description}</p>
9091
{index === 0 && (
91-
<a
92-
href="https://webstackdev.github.io/"
93-
class="mt-3 inline-flex items-center gap-1 text-sm font-medium text-(--color-secondary) hover:text-(--color-secondary-offset) transition-colors"
94-
>
95-
View Resume
96-
<Icon icon="exit-right-thin" size={4} color="inherit" />
97-
</a>
92+
<div class="mt-3 flex justify-end">
93+
<Button
94+
text="View C.V."
95+
variant="page-inverse"
96+
size="small"
97+
href="https://webstackbuilders.com/resume"
98+
icon="arrow-right"
99+
iconPosition="right"
100+
iconSize={4}
101+
/>
102+
</div>
98103
)}
99104
</div>
100105
</div>

src/components/Pages/Contact/uppy-dashboard.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,11 +2351,16 @@ button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progress
23512351
}
23522352

23532353
.uppy-Dashboard-browse {
2354+
align-items: center;
23542355
color: var(--color-primary-offset);
23552356
cursor: pointer;
2357+
display: inline-flex;
2358+
min-height: 24px;
2359+
min-width: 24px;
23562360
text-decoration-color: var(--color-primary-offset);
23572361
text-decoration-line: underline;
23582362
text-decoration-style: dotted;
2363+
vertical-align: middle;
23592364
}
23602365

23612366
.uppy-Dashboard-browse:focus {

0 commit comments

Comments
 (0)