From 628f16910dd15eccff685d7f487604497f283aba Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 6 Jun 2024 18:31:59 +0100 Subject: [PATCH] Add dashed lists (#132) --- CHANGELOG.md | 4 ++ .../components/hero/hero.scss | 24 ++++++++++++ .../components/picture/picture.mjs | 4 -- .../colour-combinations.stories.js | 8 ++-- .../stories/utilities/lists/lists.stories.js | 38 ++++++++++++++---- src/nationalarchives/tools/_colour.scss | 4 ++ src/nationalarchives/utilities/_lists.scss | 39 ++++++++++--------- src/nationalarchives/variables/_colour.scss | 2 - 8 files changed, 87 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4cad0d0..1cf78ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Allow `lazyImages` attribute for lazy loading of index grid images +- Dashed lists open with `.tna-ul--dashed` and `.tna-ol--dashed` replace the markers with dashes ### Changed + +- The transcript button on picture components no longer gets a `tna-picture__toggle-transcript--opened` class when opened + ### Deprecated ### Removed ### Fixed diff --git a/src/nationalarchives/components/hero/hero.scss b/src/nationalarchives/components/hero/hero.scss index 5013aa08..be86bf70 100644 --- a/src/nationalarchives/components/hero/hero.scss +++ b/src/nationalarchives/components/hero/hero.scss @@ -232,6 +232,30 @@ $shift-units: 5 !default; padding-bottom: spacing.space($padding-units-narrow); } + &--details-cutout &__details { + &::before { + content: ""; + @include colour.plain; + + width: 3rem; + height: 3rem; + + position: absolute; + top: 0; + right: 0; + z-index: 1; + + border-radius: 0% 0 0% 50%; + @include colour.colour-background("background"); + } + + &[open] { + &::before { + display: none; + } + } + } + @include media.on-mobile { & &__figure { min-height: auto; diff --git a/src/nationalarchives/components/picture/picture.mjs b/src/nationalarchives/components/picture/picture.mjs index c7864db3..33e2917e 100644 --- a/src/nationalarchives/components/picture/picture.mjs +++ b/src/nationalarchives/components/picture/picture.mjs @@ -42,16 +42,12 @@ export class Picture { } handleToggleTranscript() { - const transcriptToggleOpenedClass = - "tna-picture__toggle-transcript--opened"; this.transcriptOpened = !this.transcriptOpened; if (this.transcriptOpened) { - this.$transcriptToggle.classList.add(transcriptToggleOpenedClass); this.$transcriptToggle.setAttribute("aria-expanded", true); this.$transcriptToggle.innerText = this.closeLabel; this.$transcript.removeAttribute("hidden"); } else { - this.$transcriptToggle.classList.remove(transcriptToggleOpenedClass); this.$transcriptToggle.setAttribute("aria-expanded", false); this.$transcriptToggle.innerText = this.openLabel; this.$transcript.setAttribute("hidden", true); diff --git a/src/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js b/src/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js index ee4b93af..9b7f6aa2 100644 --- a/src/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +++ b/src/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js @@ -17,20 +17,20 @@ const Template = ({ theme }) => { const accents = [ "", - "tna-accent-black", - "tna-accent-yellow", "tna-accent-pink", "tna-accent-orange", + "tna-accent-yellow", "tna-accent-green", "tna-accent-blue", + "tna-accent-black", ]; const blocks = [ "", "tna-background-tint", - "tna-background-accent-light", - "tna-background-accent", "tna-background-contrast", + "tna-background-accent", + "tna-background-accent-light", ]; return `
diff --git a/src/nationalarchives/stories/utilities/lists/lists.stories.js b/src/nationalarchives/stories/utilities/lists/lists.stories.js index b52e94dd..38cb3d97 100644 --- a/src/nationalarchives/stories/utilities/lists/lists.stories.js +++ b/src/nationalarchives/stories/utilities/lists/lists.stories.js @@ -9,8 +9,8 @@ export default { argTypes, }; -const UnorderedListTemplate = ({ items, plain, classes }) => - `