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

Dark mode tweaks #79

Merged
merged 7 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
### Changed

- Tab elements in high contrast mode have an extra keyline to help with visibility
- The header element no longer uses background tint in high contrast mode
- The default cookie banner colour is dark on light but can be changed with a `style` attribute or classes such as `tna-cookie-banner--contrast`
- The card style of `boxed` has been changed to `contrast` in line with other components
- The background tint colour on the light theme is slightly darker for better contrast with the page background
Expand All @@ -24,6 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed option for `tna-search-field--no-border` - borders are dictated by the background colours and page theme

### Fixed

- Picture elements in high contrast mode have improved borders with no gaps

### Security

## [0.1.35](https://github.com/nationalarchives/tna-frontend/compare/v0.1.34...v0.1.35) - 2024-01-16
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![Main build status](https://img.shields.io/github/actions/workflow/status/nationalarchives/tna-frontend/tests.yml?style=flat-square&event=push&branch=main)](https://github.com/nationalarchives/tna-frontend/actions/workflows/tests.yml?query=branch%3Amain)
[![Latest release](https://img.shields.io/github/v/release/nationalarchives/tna-frontend?style=flat-square&logo=github&logoColor=white&sort=semver)](https://github.com/nationalarchives/tna-frontend/releases)
[![NPM version](https://img.shields.io/npm/v/@nationalarchives/frontend?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@nationalarchives/frontend)
[![Node version](https://img.shields.io/node/v-lts/@nationalarchives/frontend?style=flat-square&logo=nodedotjs&logoColor=white)](https://github.com/nationalarchives/tna-frontend/blob/main/.nvmrc)
[![Licence](https://img.shields.io/github/license/nationalarchives/tna-frontend?style=flat-square)](https://github.com/nationalarchives/tna-frontend/blob/main/LICENCE)

TNA Frontend contains the code you need to start building a user interface for National Archives platforms and services.
Expand Down
8 changes: 7 additions & 1 deletion src/nationalarchives/components/cookie-banner/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# The National Archives Cookie Banner
<img src="../../assets/images/tna-square-logo.svg" alt="The National Archives logo" title="The National Archives" width="100" />

# TNA Frontend Cookie Banner

[![Latest release](https://img.shields.io/github/v/release/nationalarchives/tna-frontend?style=flat-square&logo=github&logoColor=white&sort=semver)](https://github.com/nationalarchives/tna-frontend/releases)
[![NPM version](https://img.shields.io/npm/v/@nationalarchives/frontend-cookie-banner?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@nationalarchives/frontend-cookie-banner)
[![Licence](https://img.shields.io/github/license/nationalarchives/tna-frontend?style=flat-square)](https://github.com/nationalarchives/tna-frontend/blob/main/LICENCE)

Use the cookie banner from TNA Frontend in your service.

Expand Down
10 changes: 0 additions & 10 deletions src/nationalarchives/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@
background-color: colour.brand-colour("black");
}

.tna-template--system-theme & {
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
@include colour.colour-background("background-tint");
}
}

.tna-template--high-contrast-theme:not(.tna-template--dark-theme) & {
@include colour.colour-background("background-tint");
}

&__exit {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
Expand Down
5 changes: 3 additions & 2 deletions src/nationalarchives/components/picture/picture.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@

@include colour.on-high-contrast-and-forced-colours {
@include colour.colour-border("keyline-dark", 1px);
border-bottom-width: 0;

&__caption {
padding: 1rem;
margin: 0;

border: none;
}
}
}
9 changes: 2 additions & 7 deletions src/nationalarchives/components/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,8 @@
}

@include colour.on-high-contrast-and-forced-colours {
&__list-item-link {
padding-right: 1rem;
padding-left: 1rem;

overflow: hidden;

@include colour.colour-border("keyline-dark", 1px);
&__list {
@include colour.colour-border("keyline-dark", 1px, solid, bottom);
}
}

Expand Down
3 changes: 2 additions & 1 deletion tasks/generate-cookie-banner-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const html = nunjucks
allowInsecure: false,
},
})
.trim();
.trim()
.replace(/ " /g, '" ');

fs.readFile(
"src/nationalarchives/components/cookie-banner/README.md",
Expand Down
Loading