@nationalarchives/frontend 0.1.52 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +7 -0
- package/nationalarchives/analytics.js +1 -1
- package/nationalarchives/analytics.js.map +1 -1
- package/nationalarchives/analytics.mjs +4 -4
- package/nationalarchives/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +9 -8
- package/nationalarchives/components/button/button-group.stories.js +0 -8
- package/nationalarchives/components/button/button.css +1 -1
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +12 -6
- package/nationalarchives/components/button/fixtures.json +76 -0
- package/nationalarchives/components/card/card.css +1 -1
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +1 -1
- package/nationalarchives/components/card/fixtures.json +24 -24
- package/nationalarchives/components/card/macro-options.json +1 -1
- package/nationalarchives/components/card/template.njk +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.scss +3 -2
- package/nationalarchives/components/compound-filters/compound-filters.css +1 -1
- package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
- package/nationalarchives/components/compound-filters/compound-filters.scss +10 -6
- package/nationalarchives/components/cookie-banner/README.md +6 -2
- package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.mjs +2 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +7 -8
- package/nationalarchives/components/date-input/date-input.css +1 -1
- package/nationalarchives/components/date-input/date-input.css.map +1 -1
- package/nationalarchives/components/date-search/date-search.css +1 -1
- package/nationalarchives/components/date-search/date-search.css.map +1 -1
- package/nationalarchives/components/date-search/date-search.scss +2 -0
- package/nationalarchives/components/error-summary/error-summary.css +1 -1
- package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
- package/nationalarchives/components/featured-records/featured-records.css +1 -1
- package/nationalarchives/components/featured-records/featured-records.css.map +1 -1
- package/nationalarchives/components/featured-records/featured-records.scss +5 -3
- package/nationalarchives/components/footer/analytics.js +8 -0
- package/nationalarchives/components/footer/fixtures.json +9 -2
- package/nationalarchives/components/footer/footer.css +1 -1
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.js +2 -0
- package/nationalarchives/components/footer/footer.js.map +1 -0
- package/nationalarchives/components/footer/footer.mjs +87 -0
- package/nationalarchives/components/footer/footer.scss +28 -8
- package/nationalarchives/components/footer/footer.stories.js +62 -3
- package/nationalarchives/components/footer/template.njk +168 -120
- package/nationalarchives/components/gallery/gallery.css +1 -1
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/gallery/gallery.scss +2 -1
- package/nationalarchives/components/global-header/global-header.css +1 -1
- package/nationalarchives/components/global-header/global-header.css.map +1 -1
- package/nationalarchives/components/global-header/global-header.scss +13 -10
- package/nationalarchives/components/grid/grid.css +1 -1
- package/nationalarchives/components/grid/grid.css.map +1 -1
- package/nationalarchives/components/grid/grid.scss +3 -3
- package/nationalarchives/components/header/header.css +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.scss +17 -15
- package/nationalarchives/components/hero/fixtures.json +106 -18
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +78 -19
- package/nationalarchives/components/hero/hero.stories.js +60 -32
- package/nationalarchives/components/hero/macro-options.json +34 -3
- package/nationalarchives/components/hero/template.njk +27 -6
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/index-grid/macro-options.json +1 -1
- package/nationalarchives/components/pagination/pagination.css +1 -1
- package/nationalarchives/components/pagination/pagination.css.map +1 -1
- package/nationalarchives/components/pagination/pagination.scss +2 -2
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/picture.css +1 -1
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/picture/picture.scss +5 -1
- package/nationalarchives/components/quick-filters/quick-filters.css +1 -1
- package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
- package/nationalarchives/components/quick-filters/quick-filters.scss +4 -2
- package/nationalarchives/components/radios/radios.css +1 -1
- package/nationalarchives/components/radios/radios.css.map +1 -1
- package/nationalarchives/components/radios/radios.scss +3 -2
- package/nationalarchives/components/search-field/search-field.css +1 -1
- package/nationalarchives/components/search-field/search-field.css.map +1 -1
- package/nationalarchives/components/search-filters/search-filters.css +1 -1
- package/nationalarchives/components/search-filters/search-filters.css.map +1 -1
- package/nationalarchives/components/search-filters/search-filters.scss +7 -6
- package/nationalarchives/components/select/select.css +1 -1
- package/nationalarchives/components/select/select.css.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.scss +7 -6
- package/nationalarchives/components/skip-link/skip-link.css +1 -1
- package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
- package/nationalarchives/components/skip-link/skip-link.scss +4 -4
- package/nationalarchives/components/tabs/tabs.css +1 -1
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/tabs/tabs.scss +8 -6
- package/nationalarchives/components/text-input/text-input.css +1 -1
- package/nationalarchives/components/text-input/text-input.css.map +1 -1
- package/nationalarchives/components/textarea/textarea.css +1 -1
- package/nationalarchives/components/textarea/textarea.css.map +1 -1
- package/nationalarchives/components/textarea/textarea.scss +7 -4
- package/nationalarchives/components/warning/warning.css +1 -1
- package/nationalarchives/components/warning/warning.css.map +1 -1
- package/nationalarchives/components/warning/warning.scss +7 -5
- package/nationalarchives/global-header-package.css +1 -1
- package/nationalarchives/global-header-package.css.map +1 -1
- package/nationalarchives/lib/cookies.mjs +21 -4
- package/nationalarchives/lib/functions.css +1 -0
- package/nationalarchives/lib/functions.css.map +1 -0
- package/nationalarchives/lib/functions.scss +16 -0
- package/nationalarchives/prototype-kit.css +1 -1
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +6 -2
- package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +2 -1
- package/nationalarchives/templates/fixtures.json +27 -4
- package/nationalarchives/templates/layouts/_generic.njk +15 -15
- package/nationalarchives/tools/_colour.scss +3 -3
- package/nationalarchives/tools/_typography.scss +8 -9
- package/nationalarchives/utilities/_a11y.scss +4 -4
- package/nationalarchives/utilities/_debug.scss +2 -2
- package/nationalarchives/utilities/_global.scss +8 -0
- package/nationalarchives/utilities/_imports.scss +57 -0
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_lists.scss +36 -19
- package/nationalarchives/utilities/_tables.scss +8 -8
- package/nationalarchives/utilities/_typography.scss +6 -42
- package/nationalarchives/variables/_colour.scss +7 -2
- package/nationalarchives/variables/_typography.scss +55 -4
- package/package.json +21 -20
- package/nationalarchives/assets/fonts/OpenSans-Italic.ttf +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_media.scss","../../../../src/nationalarchives/components/hero/hero.scss","../../../../src/nationalarchives/tools/_typography.scss"],"names":[],"mappings":"AA0MA,6KACE,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEAvKA,4CALA,gCCuCA,wBDgJF,uEAEI,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEAhMF,4CALA,iCAiNF,gBACE,qCA7MA,4CALA,gCA6NF,6CACE,uCACA,qCACA,qCACA,uCACA,uCACA,2BACA,mCACA,iCACA,2CAjOA,4CALA,gCEtBE,8EFiEE,iDE1DJ,kBACE,2CAKA,SACA,kBACA,oBAEA,aACA,qBAEA,kBAGF,mBACE,WAEA,kBACA,MACA,QACA,UAEA,iBAGF,mBACE,WAEA,iBAGF,2BACE,aACA,cAEA,kBACA,QACA,UACA,UAEA,YACA,kBACA,mBACA,gBFQE,4CEHF,mBAEA,eAEA,iCFvCF,iCAKA,2CEyCA,gCACE,kBACA,kBACA,gBACA,yBAGF,uBACE,YACA,eACA,4BAGA,kBACA,MACA,QACA,UCnGF,eD0GA,iBACE,WACA,YAEA,kBACA,QACA,UAEA,qBACE,WACA,YAEA,iBAOF,uHAEE,aACA,eAEA,cAEA,kBACA,QACA,SF5FJ,gDEgGI,WAGF,4DACE,8CAGF,2DACE,+CAIA,mIAEE,cAIJ,yDACE,YAIJ,iBACE,kBACA,UAUF,yBACE,aFpIF,4CE+IA,mBACE,mBAGF,4CACE,kBACA,SDnHF,wBCuHE,kBACE,gBACA,UAEA,sBAGF,mBACE,QAYF,uBACE,WACA,eAEA,OAGF,iBACE,gBAEA,QAEA,qBACE,YAIJ,iBACE,QAMF,yBACE,gBACA,eAGF,4CACE,gBAMF,gBACE,iBFkKJ,8BE7JE,gDFtLE,+CCCJ,mDC2LI,iBF5LA,8CE8LE,aAGF,yBACE,aF2IN,+BEvJE,gDFtLE,+CCCJ,oDC2LI,iBF5LA,8CE8LE,aAGF,yBACE","file":"hero.css","sourcesContent":["@use \"sass:map\";\n@use \"sass:list\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-font($colour, $important: false) {\n color: var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)} if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n $style\n if($important, !important, null);\n } @else {\n outline-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n if($important, !important, null);\n}\n\n@mixin thick-keyline($direction) {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-dark($direction) {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-accent($direction) {\n @include colour-border(\n \"accent-background\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-error($direction) {\n @include colour-border(\n \"form-error\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-brand($direction, $brandColour) {\n border-#{$direction}: borders.$thick-border-width #{brand-colour($brandColour)}\n solid;\n}\n\n// Use light theme colours (except for \"form-error\")\n%light {\n @include colour-css-vars(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n// Remove accent and contrast values (except for \"form-error\")\n%plain {\n @include colour-css-vars(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark(\"form-error\");\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n }\n\n @include colour-background(\"background\");\n}\n\n@mixin plain {\n @extend %plain;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n }\n\n .tna-template--dark-theme & {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accent-text: #{colour.brand-colour(\"black\")} !important;\n --button-accent-background: #{colour.brand-colour(\"yellow\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --button-accent-text: #{colour.brand-colour(\"black\")} !important;\n --button-accent-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %black-accent;\n @extend %accent-lighter-text;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --button-accent-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %pink-accent;\n @extend %accent-lighter-text;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --button-accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %orange-accent;\n @extend %accent-lighter-text;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --button-accent-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %green-accent;\n @extend %accent-lighter-text;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --button-accent-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %blue-accent;\n @extend %accent-lighter-text;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n","@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n$padding-units-top: 10 !default;\n$padding-units-bottom: 2 !default;\n$shift-units: 5 !default;\n\n.tna-hero {\n &--contrast {\n @include colour.contrast;\n }\n\n &--tint {\n @include colour.tint;\n }\n\n &--accent {\n @include colour.accent;\n\n .tna-hgroup__supertitle:not(.tna-hgroup__supertitle--plain) {\n @include colour.contrast;\n\n @include colour.colour-border(\"contrast-background\");\n }\n }\n\n &__figure {\n min-height: clamp(\n #{spacing.space($padding-units-top + $padding-units-bottom)},\n calc(40vw - #{spacing.space($padding-units-top + $padding-units-bottom)}),\n 50rem\n );\n margin: 0;\n padding-top: spacing.space($padding-units-top);\n padding-bottom: spacing.space($padding-units-bottom);\n\n display: flex;\n align-items: flex-end;\n\n position: relative;\n }\n\n &__caption {\n width: 100%;\n\n position: absolute;\n top: 0;\n right: 0;\n z-index: 5;\n\n overflow: visible;\n }\n\n &__details {\n width: 100%;\n\n overflow: visible;\n }\n\n &__details-summary {\n width: 1.5rem;\n height: 1.5rem;\n\n position: absolute;\n top: spacing.space(0.5);\n right: spacing.space(0.5);\n z-index: 2;\n\n font-size: 0;\n text-align: center;\n line-height: 1.5rem;\n list-style: none;\n\n @include colour.accent;\n\n @include colour.colour-border(\"background\", 4px);\n border-radius: 100%;\n\n cursor: pointer;\n\n &:hover {\n @include colour.colour-font(\"background\");\n\n @include colour.colour-background(\"font-base\");\n }\n }\n\n &__details-summary-icon {\n font-size: 1.25rem;\n font-style: normal;\n font-weight: 700;\n text-transform: lowercase;\n }\n\n &__information {\n width: 45rem;\n max-width: 75vw;\n padding: spacing.space(0.625) spacing.space(3.25) spacing.space(0.625)\n spacing.space(1);\n\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n @include colour.contrast;\n\n @include typography.relative-font-size(16);\n }\n\n &__image {\n width: 100%;\n height: 100%;\n\n position: absolute;\n inset: 0;\n z-index: 1;\n\n img {\n width: 100%;\n height: 100%;\n\n object-fit: cover;\n }\n }\n\n &__details[open] &__details-summary {\n @include colour.contrast;\n\n &::before,\n &::after {\n width: 1.5rem;\n height: 0.125rem;\n\n display: block;\n\n position: absolute;\n top: 50%;\n left: 50%;\n\n @include colour.colour-background(\"font-dark\");\n\n content: \"\";\n }\n\n &::before {\n transform: translate(-50%, -50%) rotate(45deg);\n }\n\n &::after {\n transform: translate(-50%, -50%) rotate(-45deg);\n }\n\n &:hover {\n &::before,\n &::after {\n height: 0.25rem;\n }\n }\n\n &-icon {\n font-size: 0;\n }\n }\n\n &__inner {\n position: relative;\n z-index: 4;\n }\n\n &:not(#{&}--accent):not(#{&}--tint) &__inner {\n @include colour.contrast-on-mobile;\n }\n\n &__content {\n }\n\n &__content-inner {\n padding: spacing.space(2);\n\n @include colour.colour-background(\"background\");\n }\n\n &__heading {\n }\n\n &__body {\n }\n\n &--shifted {\n margin-bottom: spacing.space($shift-units - $padding-units-bottom);\n }\n\n &--shifted &__content-inner {\n position: relative;\n top: spacing.space($shift-units);\n }\n\n @include media.on-mobile {\n &__figure {\n min-height: auto;\n padding: 0;\n\n flex-direction: column;\n }\n\n &__caption {\n order: 2;\n }\n\n &__details {\n }\n\n &__details-summary {\n }\n\n &__details-summary-icon {\n }\n\n &__information {\n width: auto;\n max-width: none;\n\n left: 0;\n }\n\n &__image {\n position: static;\n\n order: 1;\n\n img {\n height: auto;\n }\n }\n\n &__inner {\n order: 3;\n }\n\n &__content {\n }\n\n &__content-inner {\n padding-right: 0;\n padding-left: 0;\n }\n\n &--shifted &__content-inner {\n position: static;\n }\n\n &__heading {\n }\n\n &__body {\n margin-top: spacing.space(1);\n }\n }\n\n @include colour.on-high-contrast-and-forced-colours {\n &__information,\n &__content-inner {\n @include colour.colour-border(\"keyline-dark\", 1px);\n }\n\n @include media.on-mobile {\n &__inner {\n @include colour.colour-border(\"keyline-dark\", 1px);\n border-top: 0;\n }\n\n &__content-inner {\n border: none;\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin relative-font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n @if $bold {\n @include main-font-weight-bold;\n } @else {\n @include main-font-weight;\n }\n font-optical-sizing: auto;\n font-style: normal;\n font-variation-settings: \"wdth\" 100;\n}\n\n@mixin heading-font {\n font-family: typography.$heading-font-family;\n font-weight: typography.$heading-font-weight;\n}\n\n@mixin detail-font($bold: false) {\n font-family: typography.$detail-font-family;\n @if $bold {\n font-weight: typography.$detail-font-weight-bold;\n } @else {\n font-weight: typography.$detail-font-weight;\n }\n font-optical-sizing: auto;\n font-style: normal;\n}\n\n@mixin detail-font-small {\n @include detail-font;\n @include relative-font-size(14);\n text-transform: uppercase;\n line-height: 1.1;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n @include relative-font-size($font-size-default);\n line-height: $line-height;\n\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include relative-font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include relative-font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include relative-font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include relative-font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include relative-font-size($font-size-medium);\n }\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_media.scss","../../../../src/nationalarchives/components/hero/hero.scss","../../../../src/nationalarchives/tools/_typography.scss"],"names":[],"mappings":"AA0MA,gUACE,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEAvKA,4CALA,gCCuCA,wBDgJF,uEAEI,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEAhMF,4CALA,iCAiNF,gBACE,qCA7MA,4CALA,gCA6NF,6CACE,uCACA,qCACA,qCACA,uCACA,uCACA,2BACA,mCACA,iCACA,2CAjOA,4CALA,gCEnBE,8EF8DE,iDEvDJ,kBACE,2CAKA,SACA,kBACA,oBAEA,aACA,qBAEA,kBAGF,mBACE,WAEA,iBAEA,kBACA,MACA,QACA,UAGF,mBACE,WAEA,iBAGF,2BACE,aACA,cAEA,kBACA,QACA,UACA,UAEA,YACA,mBACA,kBAEA,gBAEA,mBAEA,2DAMA,iCF5CF,iCAKA,2CE8CA,gCACE,kBACA,gBACA,kBACA,yBAGF,uBACE,YACA,eACA,4BAGA,kBACA,MACA,QACA,UCxGF,eD+GA,iBACE,kBACA,QACA,UAEA,qBACE,WACA,YAEA,iBAOF,uHAEE,WAEA,aACA,eAEA,cAEA,kBACA,QACA,SFhGJ,gDEqGE,4DACE,8CAGF,2DACE,+CAIA,mIAEE,cAIJ,yDACE,YAIJ,iBACE,kBACA,UAUF,yBACE,aFtIF,4CEiJA,iBACE,mBAGF,0CACE,kBACA,SAcF,mCACE,8CACA,iBACA,oBAEA,mBAEA,sBAGF,wCACE,cAEA,sBAGF,kCACE,SAGF,oCACE,UACA,mBAGF,0CACE,UD7JF,wBCiKE,kBACE,gBACA,UAEA,sBAGF,mBACE,QAYF,+DAEE,WACA,eAEA,OAGF,iBACE,gBAEA,QAEA,qBACE,YAIJ,iBACE,QAMF,yBACE,gBACA,eAMF,gBACE,gBAGF,0CACE,gBAGF,mCACE,gBACA,cACA,iBAGF,oCACE,WACA,mBAGF,0CACE,iBACA,qBFuGJ,8BElGE,gDFjPE,+CCCJ,mDCsPI,iBFvPA,8CEyPE,aAGF,yBACE,aFgFN,+BE5FE,gDFjPE,+CCCJ,oDCsPI,iBFvPA,8CEyPE,aAGF,yBACE","file":"hero.css","sourcesContent":["@use \"sass:list\";\n@use \"sass:map\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-font($colour, $important: false) {\n color: var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)} if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n $style\n if($important, !important, null);\n } @else {\n outline-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: var(--#{$colour}, #{map.get(colour.$colour-palette-default, $colour)})\n if($important, !important, null);\n}\n\n@mixin thick-keyline($direction) {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-dark($direction) {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-accent($direction) {\n @include colour-border(\n \"accent-background\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-error($direction) {\n @include colour-border(\n \"form-error\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n}\n\n@mixin thick-keyline-brand($direction, $brandColour) {\n border-#{$direction}: borders.$thick-border-width #{brand-colour($brandColour)}\n solid;\n}\n\n// Use light theme colours (except for \"form-error\")\n%light {\n @include colour-css-vars(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n// Remove accent and contrast values (except for \"form-error\")\n%plain {\n @include colour-css-vars(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark(\"form-error\");\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n }\n\n @include colour-background(\"background\");\n}\n\n@mixin plain {\n @extend %plain;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n }\n\n .tna-template--dark-theme & {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accent-text: #{colour.brand-colour(\"white\")} !important;\n --button-accent-background: #{colour.brand-colour(\"brown\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --button-accent-text: #{colour.brand-colour(\"black\")} !important;\n --button-accent-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %black-accent;\n @extend %accent-lighter-text;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --button-accent-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %pink-accent;\n @extend %accent-lighter-text;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --button-accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %orange-accent;\n @extend %accent-lighter-text;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --button-accent-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %green-accent;\n @extend %accent-lighter-text;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --button-accent-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %blue-accent;\n @extend %accent-lighter-text;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n","@use \"sass:math\";\n\n@use \"../../tools/colour\";\n@use \"../../tools/grid\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n$padding-units-top: 10 !default;\n$padding-units-bottom: 2 !default;\n$shift-units: 5 !default;\n\n.tna-hero {\n &--contrast {\n @include colour.contrast;\n }\n\n &--tint {\n @include colour.tint;\n }\n\n &--accent {\n @include colour.accent;\n\n .tna-hgroup__supertitle:not(.tna-hgroup__supertitle--plain) {\n @include colour.contrast;\n\n @include colour.colour-border(\"contrast-background\");\n }\n }\n\n &__figure {\n min-height: clamp(\n #{spacing.space($padding-units-top + $padding-units-bottom)},\n calc(40vw - #{spacing.space($padding-units-top + $padding-units-bottom)}),\n 50rem\n );\n margin: 0;\n padding-top: spacing.space($padding-units-top);\n padding-bottom: spacing.space($padding-units-bottom);\n\n display: flex;\n align-items: flex-end;\n\n position: relative;\n }\n\n &__caption {\n width: 100%;\n\n overflow: visible;\n\n position: absolute;\n top: 0;\n right: 0;\n z-index: 5;\n }\n\n &__details {\n width: 100%;\n\n overflow: visible;\n }\n\n &__details-summary {\n width: 1.5rem;\n height: 1.5rem;\n\n position: absolute;\n top: spacing.space(0.5);\n right: spacing.space(0.5);\n z-index: 2;\n\n font-size: 0;\n line-height: 1.5rem;\n text-align: center;\n\n list-style: none;\n\n border-radius: 100%;\n\n cursor: pointer;\n\n @include colour.accent;\n\n @include colour.colour-border(\"background\", 4px);\n\n &:hover {\n @include colour.colour-font(\"background\");\n\n @include colour.colour-background(\"font-base\");\n }\n }\n\n &__details-summary-icon {\n font-size: 1.25rem;\n font-weight: 700;\n font-style: normal;\n text-transform: lowercase;\n }\n\n &__information {\n width: 45rem;\n max-width: 75vw;\n padding: spacing.space(0.625) spacing.space(3.25) spacing.space(0.625)\n spacing.space(1);\n\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n @include colour.contrast;\n\n @include typography.relative-font-size(16);\n }\n\n &__image {\n position: absolute;\n inset: 0;\n z-index: 1;\n\n img {\n width: 100%;\n height: 100%;\n\n object-fit: cover;\n }\n }\n\n &__details[open] &__details-summary {\n @include colour.contrast;\n\n &::before,\n &::after {\n content: \"\";\n\n width: 1.5rem;\n height: 0.125rem;\n\n display: block;\n\n position: absolute;\n top: 50%;\n left: 50%;\n\n @include colour.colour-background(\"font-dark\");\n }\n\n &::before {\n transform: translate(-50%, -50%) rotate(45deg);\n }\n\n &::after {\n transform: translate(-50%, -50%) rotate(-45deg);\n }\n\n &:hover {\n &::before,\n &::after {\n height: 0.25rem;\n }\n }\n\n &-icon {\n font-size: 0;\n }\n }\n\n &__inner {\n position: relative;\n z-index: 4;\n }\n\n &:not(#{&}--accent):not(#{&}--tint) &__inner {\n @include colour.contrast-on-mobile;\n }\n\n &__content {\n }\n\n &__content-inner {\n padding: spacing.space(2);\n\n @include colour.colour-background(\"background\");\n }\n\n &__heading {\n }\n\n &__body {\n }\n\n &--shift {\n margin-bottom: spacing.space($shift-units - $padding-units-bottom);\n }\n\n &--shift &__content-inner {\n position: relative;\n top: spacing.space($shift-units);\n }\n\n &--shift:not(#{&}--accent):not(#{&}--tint) &__content-inner {\n @include colour.contrast;\n }\n\n &--split {\n }\n\n &--split:not(#{&}--accent):not(#{&}--tint) {\n @include colour.contrast;\n }\n\n &--split &__figure {\n min-height: clamp(15rem, #{math.div(100vw, 3)}, 50rem);\n padding-top: spacing.space(2);\n padding-bottom: spacing.space(2);\n\n align-items: center;\n\n box-sizing: border-box;\n }\n\n &--split &__information {\n max-width: 50%;\n\n box-sizing: border-box;\n }\n\n &--split &__image {\n left: 50%;\n }\n\n &--split &__content {\n width: 50%;\n padding-right: grid.gutter-width();\n }\n\n &--split &__content-inner {\n padding: 0;\n }\n\n @include media.on-mobile {\n &__figure {\n min-height: auto;\n padding: 0;\n\n flex-direction: column;\n }\n\n &__caption {\n order: 2;\n }\n\n &__details {\n }\n\n &__details-summary {\n }\n\n &__details-summary-icon {\n }\n\n &__information,\n &--split &__information {\n width: auto;\n max-width: none;\n\n left: 0;\n }\n\n &__image {\n position: static;\n\n order: 1;\n\n img {\n height: auto;\n }\n }\n\n &__inner {\n order: 3;\n }\n\n &__content {\n }\n\n &__content-inner {\n padding-right: 0;\n padding-left: 0;\n }\n\n &__heading {\n }\n\n &__body {\n margin-top: spacing.space(1);\n }\n\n &--shift &__content-inner {\n position: static;\n }\n\n &--split &__figure {\n min-height: auto;\n padding-top: 0;\n padding-bottom: 0;\n }\n\n &--split &__content {\n width: 100%;\n padding-right: grid.gutter-width-half();\n }\n\n &--split &__content-inner {\n padding-top: spacing.space(2);\n padding-bottom: spacing.space(2);\n }\n }\n\n @include colour.on-high-contrast-and-forced-colours {\n &__information,\n &__content-inner {\n @include colour.colour-border(\"keyline-dark\", 1px);\n }\n\n @include media.on-mobile {\n &__inner {\n @include colour.colour-border(\"keyline-dark\", 1px);\n border-top: 0;\n }\n\n &__content-inner {\n border: none;\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin relative-font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n font-variation-settings: \"wdth\" 100;\n @if $bold {\n @include main-font-weight-bold;\n } @else {\n @include main-font-weight;\n }\n}\n\n@mixin heading-font {\n font-family: typography.$heading-font-family;\n font-weight: typography.$heading-font-weight;\n}\n\n@mixin detail-font($bold: false) {\n font-family: typography.$detail-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n @if $bold {\n font-weight: typography.$detail-font-weight-bold;\n } @else {\n font-weight: typography.$detail-font-weight;\n }\n}\n\n@mixin detail-font-small {\n @include detail-font;\n @include relative-font-size(14);\n line-height: 1.1;\n text-transform: uppercase;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n line-height: $line-height;\n @include relative-font-size($font-size-default);\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include relative-font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include relative-font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include relative-font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include relative-font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include relative-font-size($font-size-medium);\n }\n }\n }\n}\n"]}
|
@@ -1,4 +1,7 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@use "../../tools/colour";
|
4
|
+
@use "../../tools/grid";
|
2
5
|
@use "../../tools/media";
|
3
6
|
@use "../../tools/spacing";
|
4
7
|
@use "../../tools/typography";
|
@@ -45,12 +48,12 @@ $shift-units: 5 !default;
|
|
45
48
|
&__caption {
|
46
49
|
width: 100%;
|
47
50
|
|
51
|
+
overflow: visible;
|
52
|
+
|
48
53
|
position: absolute;
|
49
54
|
top: 0;
|
50
55
|
right: 0;
|
51
56
|
z-index: 5;
|
52
|
-
|
53
|
-
overflow: visible;
|
54
57
|
}
|
55
58
|
|
56
59
|
&__details {
|
@@ -69,17 +72,19 @@ $shift-units: 5 !default;
|
|
69
72
|
z-index: 2;
|
70
73
|
|
71
74
|
font-size: 0;
|
72
|
-
text-align: center;
|
73
75
|
line-height: 1.5rem;
|
74
|
-
|
76
|
+
text-align: center;
|
75
77
|
|
76
|
-
|
78
|
+
list-style: none;
|
77
79
|
|
78
|
-
@include colour.colour-border("background", 4px);
|
79
80
|
border-radius: 100%;
|
80
81
|
|
81
82
|
cursor: pointer;
|
82
83
|
|
84
|
+
@include colour.accent;
|
85
|
+
|
86
|
+
@include colour.colour-border("background", 4px);
|
87
|
+
|
83
88
|
&:hover {
|
84
89
|
@include colour.colour-font("background");
|
85
90
|
|
@@ -89,8 +94,8 @@ $shift-units: 5 !default;
|
|
89
94
|
|
90
95
|
&__details-summary-icon {
|
91
96
|
font-size: 1.25rem;
|
92
|
-
font-style: normal;
|
93
97
|
font-weight: 700;
|
98
|
+
font-style: normal;
|
94
99
|
text-transform: lowercase;
|
95
100
|
}
|
96
101
|
|
@@ -111,9 +116,6 @@ $shift-units: 5 !default;
|
|
111
116
|
}
|
112
117
|
|
113
118
|
&__image {
|
114
|
-
width: 100%;
|
115
|
-
height: 100%;
|
116
|
-
|
117
119
|
position: absolute;
|
118
120
|
inset: 0;
|
119
121
|
z-index: 1;
|
@@ -131,6 +133,8 @@ $shift-units: 5 !default;
|
|
131
133
|
|
132
134
|
&::before,
|
133
135
|
&::after {
|
136
|
+
content: "";
|
137
|
+
|
134
138
|
width: 1.5rem;
|
135
139
|
height: 0.125rem;
|
136
140
|
|
@@ -141,8 +145,6 @@ $shift-units: 5 !default;
|
|
141
145
|
left: 50%;
|
142
146
|
|
143
147
|
@include colour.colour-background("font-dark");
|
144
|
-
|
145
|
-
content: "";
|
146
148
|
}
|
147
149
|
|
148
150
|
&::before {
|
@@ -189,15 +191,55 @@ $shift-units: 5 !default;
|
|
189
191
|
&__body {
|
190
192
|
}
|
191
193
|
|
192
|
-
&--
|
194
|
+
&--shift {
|
193
195
|
margin-bottom: spacing.space($shift-units - $padding-units-bottom);
|
194
196
|
}
|
195
197
|
|
196
|
-
&--
|
198
|
+
&--shift &__content-inner {
|
197
199
|
position: relative;
|
198
200
|
top: spacing.space($shift-units);
|
199
201
|
}
|
200
202
|
|
203
|
+
&--shift:not(#{&}--accent):not(#{&}--tint) &__content-inner {
|
204
|
+
@include colour.contrast;
|
205
|
+
}
|
206
|
+
|
207
|
+
&--split {
|
208
|
+
}
|
209
|
+
|
210
|
+
&--split:not(#{&}--accent):not(#{&}--tint) {
|
211
|
+
@include colour.contrast;
|
212
|
+
}
|
213
|
+
|
214
|
+
&--split &__figure {
|
215
|
+
min-height: clamp(15rem, #{math.div(100vw, 3)}, 50rem);
|
216
|
+
padding-top: spacing.space(2);
|
217
|
+
padding-bottom: spacing.space(2);
|
218
|
+
|
219
|
+
align-items: center;
|
220
|
+
|
221
|
+
box-sizing: border-box;
|
222
|
+
}
|
223
|
+
|
224
|
+
&--split &__information {
|
225
|
+
max-width: 50%;
|
226
|
+
|
227
|
+
box-sizing: border-box;
|
228
|
+
}
|
229
|
+
|
230
|
+
&--split &__image {
|
231
|
+
left: 50%;
|
232
|
+
}
|
233
|
+
|
234
|
+
&--split &__content {
|
235
|
+
width: 50%;
|
236
|
+
padding-right: grid.gutter-width();
|
237
|
+
}
|
238
|
+
|
239
|
+
&--split &__content-inner {
|
240
|
+
padding: 0;
|
241
|
+
}
|
242
|
+
|
201
243
|
@include media.on-mobile {
|
202
244
|
&__figure {
|
203
245
|
min-height: auto;
|
@@ -219,7 +261,8 @@ $shift-units: 5 !default;
|
|
219
261
|
&__details-summary-icon {
|
220
262
|
}
|
221
263
|
|
222
|
-
&__information
|
264
|
+
&__information,
|
265
|
+
&--split &__information {
|
223
266
|
width: auto;
|
224
267
|
max-width: none;
|
225
268
|
|
@@ -248,16 +291,32 @@ $shift-units: 5 !default;
|
|
248
291
|
padding-left: 0;
|
249
292
|
}
|
250
293
|
|
251
|
-
&--shifted &__content-inner {
|
252
|
-
position: static;
|
253
|
-
}
|
254
|
-
|
255
294
|
&__heading {
|
256
295
|
}
|
257
296
|
|
258
297
|
&__body {
|
259
298
|
margin-top: spacing.space(1);
|
260
299
|
}
|
300
|
+
|
301
|
+
&--shift &__content-inner {
|
302
|
+
position: static;
|
303
|
+
}
|
304
|
+
|
305
|
+
&--split &__figure {
|
306
|
+
min-height: auto;
|
307
|
+
padding-top: 0;
|
308
|
+
padding-bottom: 0;
|
309
|
+
}
|
310
|
+
|
311
|
+
&--split &__content {
|
312
|
+
width: 100%;
|
313
|
+
padding-right: grid.gutter-width-half();
|
314
|
+
}
|
315
|
+
|
316
|
+
&--split &__content-inner {
|
317
|
+
padding-top: spacing.space(2);
|
318
|
+
padding-bottom: spacing.space(2);
|
319
|
+
}
|
261
320
|
}
|
262
321
|
|
263
322
|
@include colour.on-high-contrast-and-forced-colours {
|
@@ -4,7 +4,12 @@ import { within, userEvent, expect } from "@storybook/test";
|
|
4
4
|
import { customViewports } from "../../../../.storybook/viewports";
|
5
5
|
|
6
6
|
const argTypes = {
|
7
|
-
|
7
|
+
supertitle: { control: "text" },
|
8
|
+
title: { control: "text" },
|
9
|
+
headingLevel: { control: { type: "number", min: 1, max: 6 } },
|
10
|
+
headingSize: { control: "inline-radio", options: ["s", "m", "l", "xl"] },
|
11
|
+
body: { control: "text" },
|
12
|
+
text: { control: "text" },
|
8
13
|
imageSrc: { control: { type: "file", accept: ".jpg" } },
|
9
14
|
imageAlt: { control: "text" },
|
10
15
|
imageWidth: { control: { type: "number", min: 1 } },
|
@@ -16,7 +21,10 @@ const argTypes = {
|
|
16
21
|
control: "inline-radio",
|
17
22
|
options: ["none", "contrast", "tint", "accent"],
|
18
23
|
},
|
19
|
-
|
24
|
+
layout: {
|
25
|
+
control: "inline-radio",
|
26
|
+
options: ["plain", "shift", "split"],
|
27
|
+
},
|
20
28
|
classes: { control: "text" },
|
21
29
|
attributes: { control: "object" },
|
22
30
|
};
|
@@ -33,7 +41,12 @@ export default {
|
|
33
41
|
};
|
34
42
|
|
35
43
|
const Template = ({
|
36
|
-
|
44
|
+
supertitle,
|
45
|
+
title,
|
46
|
+
headingLevel,
|
47
|
+
headingSize,
|
48
|
+
body,
|
49
|
+
text,
|
37
50
|
imageSrc,
|
38
51
|
imageAlt,
|
39
52
|
imageWidth,
|
@@ -42,13 +55,18 @@ const Template = ({
|
|
42
55
|
imageSources,
|
43
56
|
imageCaption,
|
44
57
|
style,
|
45
|
-
|
58
|
+
layout,
|
46
59
|
classes,
|
47
60
|
attributes,
|
48
61
|
}) =>
|
49
62
|
Hero({
|
50
63
|
params: {
|
51
|
-
|
64
|
+
supertitle,
|
65
|
+
title,
|
66
|
+
headingLevel,
|
67
|
+
headingSize,
|
68
|
+
body,
|
69
|
+
text,
|
52
70
|
imageSrc,
|
53
71
|
imageAlt,
|
54
72
|
imageWidth,
|
@@ -57,7 +75,7 @@ const Template = ({
|
|
57
75
|
imageSources,
|
58
76
|
imageCaption,
|
59
77
|
style,
|
60
|
-
|
78
|
+
layout,
|
61
79
|
classes,
|
62
80
|
attributes,
|
63
81
|
},
|
@@ -65,7 +83,8 @@ const Template = ({
|
|
65
83
|
|
66
84
|
export const Standard = Template.bind({});
|
67
85
|
Standard.args = {
|
68
|
-
|
86
|
+
title: "Title",
|
87
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
69
88
|
imageSrc:
|
70
89
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
71
90
|
imageAlt: "The National Archives office",
|
@@ -106,18 +125,15 @@ LargeContent.parameters = {
|
|
106
125
|
chromatic: { disableSnapshot: true },
|
107
126
|
};
|
108
127
|
LargeContent.args = {
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
</hgroup>
|
113
|
-
<p class="tna-large-paragraph">Switchboard LGBT+ Helpline is one of the oldest telephone help services for lesbian, gay, bisexual, transgender and queer people in the UK. Despite high demand for its support, prejudice and laws meant Switchboard’s journey to register as a charity was not easy.</p>`,
|
128
|
+
supertitle: "Focus on",
|
129
|
+
title: "‘Not acceptable’: Gay Switchboard’s attempts to become a charity",
|
130
|
+
body: `<p class="tna-large-paragraph">Switchboard LGBT+ Helpline is one of the oldest telephone help services for lesbian, gay, bisexual, transgender and queer people in the UK. Despite high demand for its support, prejudice and laws meant Switchboard’s journey to register as a charity was not easy.</p>`,
|
114
131
|
imageSrc:
|
115
132
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
116
133
|
imageAlt: "The National Archives office",
|
117
134
|
imageWidth: 499,
|
118
135
|
imageHeight: 333,
|
119
136
|
imageCaption: "An interesting photo by a famous photographer ©2023",
|
120
|
-
style: "accent",
|
121
137
|
};
|
122
138
|
|
123
139
|
export const Accent = Template.bind({});
|
@@ -125,11 +141,9 @@ Accent.parameters = {
|
|
125
141
|
chromatic: { disableSnapshot: true },
|
126
142
|
};
|
127
143
|
Accent.args = {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
</hgroup>
|
132
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`,
|
144
|
+
supertitle: "Supertitle",
|
145
|
+
title: "Title",
|
146
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
133
147
|
imageSrc:
|
134
148
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
135
149
|
imageAlt: "The National Archives office",
|
@@ -144,11 +158,9 @@ Contrast.parameters = {
|
|
144
158
|
chromatic: { disableSnapshot: true },
|
145
159
|
};
|
146
160
|
Contrast.args = {
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
</hgroup>
|
151
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`,
|
161
|
+
supertitle: "Supertitle",
|
162
|
+
title: "Title",
|
163
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
152
164
|
imageSrc:
|
153
165
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
154
166
|
imageAlt: "The National Archives office",
|
@@ -163,11 +175,9 @@ Tint.parameters = {
|
|
163
175
|
chromatic: { disableSnapshot: true },
|
164
176
|
};
|
165
177
|
Tint.args = {
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
</hgroup>
|
170
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`,
|
178
|
+
supertitle: "Supertitle",
|
179
|
+
title: "Title",
|
180
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
171
181
|
imageSrc:
|
172
182
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
173
183
|
imageAlt: "The National Archives office",
|
@@ -179,7 +189,22 @@ Tint.args = {
|
|
179
189
|
|
180
190
|
export const Shifted = Template.bind({});
|
181
191
|
Shifted.args = {
|
182
|
-
|
192
|
+
title: "Title",
|
193
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
194
|
+
imageSrc:
|
195
|
+
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
196
|
+
imageAlt: "The National Archives office",
|
197
|
+
imageWidth: 499,
|
198
|
+
imageHeight: 333,
|
199
|
+
imageCaption: "An interesting photo by a famous photographer ©2023",
|
200
|
+
style: "accent",
|
201
|
+
layout: "shift",
|
202
|
+
};
|
203
|
+
|
204
|
+
export const Split = Template.bind({});
|
205
|
+
Split.args = {
|
206
|
+
title: "Title",
|
207
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
183
208
|
imageSrc:
|
184
209
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
185
210
|
imageAlt: "The National Archives office",
|
@@ -187,7 +212,7 @@ Shifted.args = {
|
|
187
212
|
imageHeight: 333,
|
188
213
|
imageCaption: "An interesting photo by a famous photographer ©2023",
|
189
214
|
style: "accent",
|
190
|
-
|
215
|
+
layout: "split",
|
191
216
|
};
|
192
217
|
|
193
218
|
export const CaptionWithNoHeading = Template.bind({});
|
@@ -208,7 +233,8 @@ Sources.parameters = {
|
|
208
233
|
chromatic: { disableSnapshot: true },
|
209
234
|
};
|
210
235
|
Sources.args = {
|
211
|
-
|
236
|
+
title: "Title",
|
237
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
212
238
|
imageSrc:
|
213
239
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
214
240
|
imageAlt: "The National Archives office",
|
@@ -235,7 +261,9 @@ Mobile.parameters = {
|
|
235
261
|
},
|
236
262
|
};
|
237
263
|
Mobile.args = {
|
238
|
-
|
264
|
+
supertitle: "Supertitle",
|
265
|
+
title: "Title",
|
266
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
239
267
|
imageSrc:
|
240
268
|
"https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
241
269
|
imageAlt: "The National Archives office",
|
@@ -1,6 +1,37 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
"name": "
|
3
|
+
"name": "supertitle",
|
4
|
+
"type": "string",
|
5
|
+
"required": false,
|
6
|
+
"description": "The smaller title to display above the main hero title."
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "title",
|
10
|
+
"type": "string",
|
11
|
+
"required": false,
|
12
|
+
"description": "The main title of the hero. If set, then `headingLevel` also needs to be set."
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "headingLevel",
|
16
|
+
"type": "number",
|
17
|
+
"required": false,
|
18
|
+
"description": "The heading level which represents an element from `<h1>` through to `<h6>`. Default is `1`."
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "headingSize",
|
22
|
+
"type": "string",
|
23
|
+
"required": false,
|
24
|
+
"default": "m",
|
25
|
+
"description": "The physical size of the hero title (`xl`, `l`, `m` or `s`). Default is `xl`."
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"name": "body",
|
29
|
+
"type": "string",
|
30
|
+
"required": false,
|
31
|
+
"description": ""
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "text",
|
4
35
|
"type": "string",
|
5
36
|
"required": false,
|
6
37
|
"description": ""
|
@@ -86,8 +117,8 @@
|
|
86
117
|
"description": "The style of hero to use. This can be `contrast`, `tint` or `accent`."
|
87
118
|
},
|
88
119
|
{
|
89
|
-
"name": "
|
90
|
-
"type": "
|
120
|
+
"name": "style",
|
121
|
+
"type": "string",
|
91
122
|
"required": false,
|
92
123
|
"description": ""
|
93
124
|
},
|
@@ -6,10 +6,13 @@
|
|
6
6
|
{%- elseif params.style == "accent" -%}
|
7
7
|
{%- set containerClasses = containerClasses.concat('tna-hero--accent') -%}
|
8
8
|
{%- endif -%}
|
9
|
-
{%- if params.
|
10
|
-
{%- set containerClasses = containerClasses.concat('tna-hero--
|
9
|
+
{%- if params.layout == "shift" -%}
|
10
|
+
{%- set containerClasses = containerClasses.concat('tna-hero--shift') -%}
|
11
|
+
{%- elseif params.layout == "split" -%}
|
12
|
+
{%- set containerClasses = containerClasses.concat('tna-hero--split') -%}
|
11
13
|
{%- endif -%}
|
12
|
-
|
14
|
+
{% set hasContent = params.title or params.body or params.text %}
|
15
|
+
<{{ 'header' if hasContent else 'div' }} class="tna-hero {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
13
16
|
<figure class="tna-hero__figure">
|
14
17
|
{%- if params.imageCaption %}
|
15
18
|
<figcaption class="tna-hero__caption">
|
@@ -30,14 +33,32 @@
|
|
30
33
|
{%- endif %}
|
31
34
|
<img src="{{ params.imageSrc }}" alt="{{ params.imageAlt }}" width="{{ params.imageWidth }}" height="{{ params.imageHeight }}">
|
32
35
|
</picture>
|
33
|
-
{%- if
|
36
|
+
{%- if hasContent %}
|
34
37
|
<div class="tna-container tna-hero__inner">
|
35
38
|
<div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny tna-hero__content">
|
36
39
|
<div class="tna-hero__content-inner">
|
37
|
-
{
|
40
|
+
{%- if params.title %}
|
41
|
+
{%- if params.supertitle %}
|
42
|
+
<hgroup class="tna-hgroup-{{ params.headingSize or 'xl' }} tna-hero__heading">
|
43
|
+
<h{{ params.headingLevel or "1" }} class="tna-hgroup__title">
|
44
|
+
<span class="tna-hgroup__supertitle{% if params.plainSupertitle %} tna-hgroup__supertitle--plain{% endif %}">{{ params.supertitle }}</span>
|
45
|
+
{{ params.title }}
|
46
|
+
</h{{ params.headingLevel or "1" }}>
|
47
|
+
</hgroup>
|
48
|
+
{%- else %}
|
49
|
+
<h{{ params.headingLevel or "1" }} class="tna-heading-{{ params.headingSize or 'xl' }} tna-hero__heading">
|
50
|
+
{{ params.title }}
|
51
|
+
</h{{ params.headingLevel or "1" }}>
|
52
|
+
{%- endif %}
|
53
|
+
{%- endif %}
|
54
|
+
{%- if params.text %}
|
55
|
+
<p>{{ params.text }}</p>
|
56
|
+
{%- else %}
|
57
|
+
{{ params.body | safe }}
|
58
|
+
{%- endif %}
|
38
59
|
</div>
|
39
60
|
</div>
|
40
61
|
</div>
|
41
62
|
{%- endif %}
|
42
63
|
</figure>
|
43
|
-
</{{ 'header' if
|
64
|
+
</{{ 'header' if hasContent else 'div' }}>
|