Skip to content

Commit

Permalink
Accessibility updates (#90)
Browse files Browse the repository at this point in the history
* Hide some pseudo elements from screen readers

* Update npm exports

* Set global header background to black on dark themes
  • Loading branch information
ahosgood authored Feb 19, 2024
1 parent 2a9ad70 commit 337af82
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changed spacing between navigation items in header
- `tna-blockquote__author` changed to `tna-blockquote__citation`
- Added default CSS export in `package.json`
- Set global header background to pure black (`#000`) on dark themes

### Deprecated
### Removed
Expand All @@ -26,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Stopped logo from shrinking with longer straplines in headers
- The message component has a header rather than an icon which provides a better page landmark
- Hid some CSS pseudo elements from screen readers

### Security

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"main": "nationalarchives/all.js",
"exports": {
".": {
"sass": "./nationalarchives/all.scss",
"require": "./nationalarchives/all.js"
"css": "./nationalarchives/all.css",
"require": "./nationalarchives/all.js",
"sass": "./nationalarchives/all.scss"
},
"./nationalarchives/": "./nationalarchives/"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
vertical-align: baseline;

content: "\203A";
content: "\203A" / "";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
&__collection-label {
&::after {
content: ":";
content: ":" / "";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
);
}

.tna-template--dark-theme & {
background: #000;
}

.tna-template--system-theme {
@media (prefers-color-scheme: light) {
background: linear-gradient(
Expand All @@ -27,6 +31,10 @@
rgb(0 0 0 / 100%) 100%
);
}

@media (prefers-color-scheme: dark) {
background: #000;
}
}

&__main {
Expand Down
1 change: 1 addition & 0 deletions src/nationalarchives/utilities/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ small {

&::before {
content: "\2014" " ";
content: "\2014" " " / "";
}
}

Expand Down

0 comments on commit 337af82

Please sign in to comment.