@nationalarchives/frontend 0.1.41 → 0.1.43
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 +18 -0
- package/nationalarchives/analytics.js +2 -0
- package/nationalarchives/analytics.js.map +1 -0
- package/nationalarchives/analytics.mjs +281 -0
- package/nationalarchives/components/_index.scss +3 -1
- package/nationalarchives/components/breadcrumbs/analytics.js +17 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +3 -1
- package/nationalarchives/components/breadcrumbs/fixtures.json +69 -6
- package/nationalarchives/components/breadcrumbs/macro-options.json +12 -6
- package/nationalarchives/components/breadcrumbs/template.njk +12 -4
- package/nationalarchives/components/button/_index.scss +1 -0
- package/nationalarchives/components/button/button-group.stories.js +122 -0
- package/nationalarchives/components/button/button.css +1 -1
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +5 -8
- package/nationalarchives/components/button/button.stories.js +36 -38
- package/nationalarchives/components/button/fixtures.json +5 -10
- package/nationalarchives/components/button/template.njk +11 -10
- package/nationalarchives/components/card/card.css +1 -1
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +6 -0
- package/nationalarchives/components/card/card.stories.js +11 -0
- package/nationalarchives/components/card/fixtures.json +17 -34
- package/nationalarchives/components/checkboxes/analytics.js +25 -0
- package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.njk +12 -0
- package/nationalarchives/components/checkboxes/checkboxes.scss +1 -0
- package/nationalarchives/components/checkboxes/fixtures.json +6 -12
- package/nationalarchives/components/checkboxes/template.njk +10 -7
- 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 +2 -0
- package/nationalarchives/components/compound-filters/fixtures.json +1 -2
- package/nationalarchives/components/compound-filters/template.njk +1 -1
- 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/fixtures.json +10 -20
- 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-input/fixtures.json +5 -10
- package/nationalarchives/components/date-input/template.njk +9 -9
- 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.njk +7 -0
- package/nationalarchives/components/date-search/fixtures.json +6 -12
- package/nationalarchives/components/date-search/template.njk +6 -7
- package/nationalarchives/components/error-summary/_index.scss +1 -0
- package/nationalarchives/components/error-summary/error-summary.css +1 -0
- package/nationalarchives/components/error-summary/error-summary.css.map +1 -0
- package/nationalarchives/components/error-summary/error-summary.js +2 -0
- package/nationalarchives/components/error-summary/error-summary.js.map +1 -0
- package/nationalarchives/components/error-summary/error-summary.mjs +51 -0
- package/nationalarchives/components/error-summary/error-summary.scss +39 -0
- package/nationalarchives/components/error-summary/error-summary.stories.js +59 -0
- package/nationalarchives/components/error-summary/fixtures.json +24 -0
- package/nationalarchives/components/error-summary/macro-options.json +52 -0
- package/nationalarchives/components/error-summary/macro.njk +3 -0
- package/nationalarchives/components/error-summary/template.njk +15 -0
- 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 +1 -1
- package/nationalarchives/components/featured-records/fixtures.json +2 -4
- package/nationalarchives/components/footer/analytics.js +97 -0
- package/nationalarchives/components/footer/fixtures.json +8 -15
- package/nationalarchives/components/footer/footer.css +1 -1
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.scss +4 -2
- package/nationalarchives/components/footer/footer.stories.js +5 -11
- package/nationalarchives/components/footer/template.njk +13 -10
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/global-header/analytics.js +57 -0
- package/nationalarchives/components/global-header/fixtures.json +1 -2
- 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.js +1 -1
- package/nationalarchives/components/global-header/global-header.js.map +1 -1
- package/nationalarchives/components/global-header/global-header.mjs +40 -79
- package/nationalarchives/components/global-header/global-header.scss +9 -6
- package/nationalarchives/components/global-header/global-header.stories.js +32 -20
- package/nationalarchives/components/global-header/macro-options.json +12 -0
- package/nationalarchives/components/global-header/template.njk +7 -7
- package/nationalarchives/components/grid/fixtures.json +13 -26
- package/nationalarchives/components/grid/grid.css +1 -1
- package/nationalarchives/components/grid/grid.css.map +1 -1
- package/nationalarchives/components/grid/grid.scss +0 -1
- package/nationalarchives/components/header/analytics.js +18 -0
- package/nationalarchives/components/header/fixtures.json +1 -2
- package/nationalarchives/components/header/header.css +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.mjs +32 -41
- package/nationalarchives/components/header/header.scss +3 -2
- package/nationalarchives/components/header/macro-options.json +6 -0
- package/nationalarchives/components/header/template.njk +6 -6
- package/nationalarchives/components/hero/analytics.js +26 -0
- package/nationalarchives/components/hero/fixtures.json +12 -24
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +1 -1
- package/nationalarchives/components/index-grid/fixtures.json +8 -16
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/message/fixtures.json +1 -2
- package/nationalarchives/components/message/message.css +1 -1
- package/nationalarchives/components/message/message.css.map +1 -1
- package/nationalarchives/components/message/message.scss +2 -3
- package/nationalarchives/components/message/phase-banner.stories.js +1 -1
- package/nationalarchives/components/pagination/fixtures.json +1 -2
- package/nationalarchives/components/pagination/macro-options.json +6 -0
- package/nationalarchives/components/pagination/pagination.stories.js +44 -0
- package/nationalarchives/components/pagination/template.njk +4 -1
- package/nationalarchives/components/phase-banner/fixtures.json +4 -8
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/analytics.js +30 -0
- package/nationalarchives/components/picture/fixtures.json +5 -10
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/quick-filters/_index.scss +1 -0
- package/nationalarchives/components/quick-filters/fixtures.json +51 -0
- package/nationalarchives/components/{filters → quick-filters}/macro-options.json +2 -2
- package/nationalarchives/components/quick-filters/macro.njk +3 -0
- package/nationalarchives/components/quick-filters/quick-filters.css +1 -0
- package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -0
- package/nationalarchives/components/{filters/filters.scss → quick-filters/quick-filters.scss} +10 -8
- package/nationalarchives/components/{filters/filters.stories.js → quick-filters/quick-filters.stories.js} +2 -2
- package/nationalarchives/components/quick-filters/template.njk +8 -0
- package/nationalarchives/components/radios/analytics.js +25 -0
- package/nationalarchives/components/radios/fixtures.json +6 -12
- package/nationalarchives/components/radios/radios.css +1 -1
- package/nationalarchives/components/radios/radios.css.map +1 -1
- package/nationalarchives/components/radios/radios.njk +12 -0
- package/nationalarchives/components/radios/template.njk +6 -13
- package/nationalarchives/components/search-field/analytics.js +22 -0
- package/nationalarchives/components/search-field/fixtures.json +3 -6
- 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-field/search-field.scss +7 -2
- package/nationalarchives/components/search-field/template.njk +4 -4
- package/nationalarchives/components/search-filters/_index.scss +1 -0
- package/nationalarchives/components/search-filters/fixtures.json +16 -0
- package/nationalarchives/components/search-filters/macro-options.json +39 -0
- package/nationalarchives/components/search-filters/macro.njk +3 -0
- package/nationalarchives/components/search-filters/search-filters.css +1 -0
- package/nationalarchives/components/search-filters/search-filters.css.map +1 -0
- package/nationalarchives/components/search-filters/search-filters.js +2 -0
- package/nationalarchives/components/search-filters/search-filters.js.map +1 -0
- package/nationalarchives/components/search-filters/search-filters.mjs +67 -0
- package/nationalarchives/components/search-filters/search-filters.scss +163 -0
- package/nationalarchives/components/search-filters/search-filters.stories.js +207 -0
- package/nationalarchives/components/search-filters/template.njk +107 -0
- package/nationalarchives/components/select/fixtures.json +6 -12
- package/nationalarchives/components/select/select.css +1 -1
- package/nationalarchives/components/select/select.css.map +1 -1
- package/nationalarchives/components/select/select.scss +1 -1
- package/nationalarchives/components/select/template.njk +4 -4
- package/nationalarchives/components/sensitive-image/fixtures.json +3 -6
- package/nationalarchives/components/skip-link/fixtures.json +1 -2
- 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 +1 -1
- package/nationalarchives/components/tabs/fixtures.json +1 -2
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/text-input/analytics.js +23 -0
- package/nationalarchives/components/text-input/fixtures.json +6 -12
- package/nationalarchives/components/text-input/template.njk +6 -10
- package/nationalarchives/components/text-input/text-input.css +1 -1
- package/nationalarchives/components/text-input/text-input.css.map +1 -1
- package/nationalarchives/components/text-input/text-input.njk +10 -0
- package/nationalarchives/components/text-input/text-input.scss +1 -1
- package/nationalarchives/components/textarea/analytics.js +23 -0
- package/nationalarchives/components/textarea/fixtures.json +6 -12
- package/nationalarchives/components/textarea/template.njk +5 -5
- package/nationalarchives/components/textarea/textarea.css +1 -1
- package/nationalarchives/components/textarea/textarea.css.map +1 -1
- package/nationalarchives/components/textarea/textarea.scss +1 -1
- package/nationalarchives/global-header-package.css +1 -1
- package/nationalarchives/global-header-package.css.map +1 -1
- package/nationalarchives/global-header-package.scss +4 -6
- package/nationalarchives/lib/analytics-helpers.mjs +68 -0
- package/nationalarchives/lib/cookies.mjs +59 -35
- package/nationalarchives/prototype-kit.css +1 -1
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +49 -22
- package/nationalarchives/stories/utilities/forms/forms.mdx +6 -6
- package/nationalarchives/stories/utilities/tables/tables.stories.js +30 -28
- package/nationalarchives/tests/analytics.test.js +11 -0
- package/nationalarchives/tests/cookies.test.js +21 -0
- package/nationalarchives/tests/uuid.test.js +0 -6
- package/nationalarchives/tools/_a11y.scss +11 -2
- package/nationalarchives/tools/_colour.scss +47 -14
- package/nationalarchives/utilities/_a11y.scss +4 -0
- package/nationalarchives/utilities/_forms.scss +7 -1
- package/nationalarchives/utilities/_global.scss +3 -1
- package/nationalarchives/utilities/_reset.scss +5 -2
- package/nationalarchives/utilities/_tables.scss +23 -6
- package/nationalarchives/utilities/_typography.scss +5 -21
- package/nationalarchives/variables/_a11y.scss +2 -0
- package/nationalarchives/variables/_colour.scss +2 -0
- package/nationalarchives/variables/_forms.scss +1 -1
- package/nationalarchives/variables/_index.scss +1 -0
- package/package.json +2 -2
- package/nationalarchives/components/filters/_index.scss +0 -1
- package/nationalarchives/components/filters/filters.css +0 -1
- package/nationalarchives/components/filters/filters.css.map +0 -1
- package/nationalarchives/components/filters/fixtures.json +0 -51
- package/nationalarchives/components/filters/macro.njk +0 -3
- package/nationalarchives/components/filters/template.njk +0 -8
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/button/_button-group.scss","../../../../src/nationalarchives/tools/_media.scss","../../../../src/nationalarchives/components/button/button.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"AAwJA,8IA9II,4hDAiJF,+BAHF,8IAlII,+9CAyIF,waAzIE,89CAkKJ,2CA6BE,qCAzBE,mCAHF,8IAzKE,0kDAgLA,+DAPF,8IA7JE,ykDAyKF,4IA3LE,4hDA+LF,0IAzLE,ykDA6LF,4JAvLE,89CA2LF,8MArLE,wkDCxBJ,kBACE,gBAEA,8BACE,aCLJ,kBACE,aACA,eACA,mBACA,SC4BA,wBDhCF,kBASI,sBACA,qBAGF,yBACE,UEXJ,YACE,oBAEA,oBACA,qBACA,uBACA,WCPA,mBAQA,YCEsB,IFCtB,yBACA,qBACA,kBACA,kBJkEA,sBAEA,0CAgCI,yBAIA,6CIlGJ,eAEA,iDJqDA,WACA,yBIhDA,kBJ+CA,WACA,+BI9CE,qBAEA,yBAGF,sBACE,cAEA,eACA,yBAGF,mBCtCA,YCKiB,IFoCf,+BAEA,2BAEA,sEJ0BF,cACA,kBIrBE,yBCRF,0BACA,0BC3CsC,MFuDtC,oBJoBA,yBAEA,iDAsCI,qBAEA,6CIzDF,yEJUF,WACA,gCILE,0BJIF,WACA,+CICE,2BAGF,wDAEE,gBClFF,mBDqFE,mBAEA,4EACE,iBA+BJ,uBA1BE,gBACA,eAEA,MAEA,YACA,cAEA,iCACE,aCtGJ,mBD2HA,yFAdE,gBACA,eAEA,6GACE,WCjHJ,oBFsDA,wBC2EE,8BApCA,gBACA,eAEA,MAEA,YACA,cAEA,wCACE,aCtGJ,mBDqIE,uGAxBA,gBACA,eAEA,2HACE,WCjHJ,qBD4IE,uDJjEF,WACA,uBAIA,yBAEA,wCIkEE,yCJzEF,WACA,uBI6EA,2CJzEA,yBAEA,wCAsCI,qBAEA,oCIsCF,8IJrFF,WACA,uBI0FE,iDJ3FF,cACA,6BAIA,sBAEA","file":"button.css","sourcesContent":["@use \"sass:map\";\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() {\n @each $name, $value in colour.$colour-palette-default {\n --#{$name}: #{$value};\n }\n}\n\n@mixin colour-css-vars-dark() {\n @each $name, $value in colour.$colour-palette-dark {\n --#{$name}: #{$value};\n }\n}\n\n@mixin colour-css-vars-high-contrast() {\n @each $name, $value in colour.$colour-palette-high-contrast {\n --#{$name}: #{$value};\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark() {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n --#{$name}: #{$value};\n }\n}\n\n@mixin accent-css-vars($colour) {\n @if $colour == \"yellow\" {\n --accent-background: #{brand-colour(\"yellow\")} !important;\n --accent-background-light: #{brand-colour(\"cream\")} !important;\n --accent-font-base: #{brand-colour(\"black\")} !important;\n --accent-font-dark: #{brand-colour(\"black\")} !important;\n --accent-font-light: #{brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{brand-colour(\"black\")} !important;\n --accent-link-visited: #{brand-colour(\"black\")} !important;\n --accent-keyline: #{brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"black\", 0.8)} !important;\n --button-accent-background: #{brand-colour(\"yellow\")} !important;\n } @else {\n --accent-font-base: #{brand-colour(\"white\")} !important;\n --accent-font-dark: #{brand-colour(\"white\")} !important;\n --accent-font-light: #{brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{brand-colour(\"white\")} !important;\n --accent-link-visited: #{brand-colour(\"white\")} !important;\n --accent-keyline: #{brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{brand-colour(\"white\")} !important;\n @if $colour == \"pink\" {\n --accent-background: #{brand-colour(\"maroon\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-pink\")} !important;\n --button-accent-background: #{brand-colour(\"maroon\")} !important;\n } @else if $colour == \"orange\" {\n --accent-background: #{brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-orange\")} !important;\n --button-accent-background: #{brand-colour(\"chestnut\")} !important;\n } @else if $colour == \"green\" {\n --accent-background: #{brand-colour(\"forest\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-green\")} !important;\n --button-accent-background: #{brand-colour(\"forest\")} !important;\n } @else if $colour == \"blue\" {\n --accent-background: #{brand-colour(\"navy\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-blue\")} !important;\n --button-accent-background: #{brand-colour(\"navy\")} !important;\n }\n }\n}\n\n@mixin colour-font(\n $colour,\n $important: false,\n $default-palette: colour.$colour-palette-default\n) {\n color: map.get($default-palette, $colour) if($important, !important, null);\n color: var(--#{$colour}) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n background-color: var(--#{$colour}) 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 $property: border-#{$direction};\n border-#{$direction}: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border-#{$direction}: $width\n var(--#{$colour})\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: map.get(\n colour.$colour-palette-default,\n $colour\n )\n if($important, !important, null);\n border-#{$direction}-color: var(--#{$colour})\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n border-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n border-color: var(--#{$colour}) 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 map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n outline: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n outline-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n outline-color: var(--#{$colour}) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n fill: var(--#{$colour}) if($important, !important, null);\n}\n\n%light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n%dark {\n @include colour-css-vars-dark;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast-dark;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast-dark;\n }\n}\n\n@mixin dark {\n @extend %dark;\n}\n\n%plain {\n .tna-template--system-theme & {\n @extend %light;\n\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark;\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark;\n }\n }\n\n .tna-template--light-theme & {\n @include colour-css-vars;\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast;\n }\n\n .tna-template--high-contrast-theme.tna-template--dark-theme & {\n @include colour-css-vars-high-contrast-dark;\n }\n\n --background: var(--page-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\", false, colour.$colour-palette-dark);\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\", false, colour.$colour-palette-dark);\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\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\", false, colour.$colour-palette-dark);\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%tint {\n @include colour-background(\"background-tint\");\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent-background {\n @include colour-background(\"accent-background\");\n}\n\n@mixin accent-background {\n @extend %accent-background;\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 // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\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 @include colour-background(\"background\");\n @include colour-font(\"font-base\");\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\n@mixin accent-light {\n @extend %accent-light;\n}\n\n@mixin on-high-contrast {\n .tna-template--high-contrast-theme & {\n @content;\n }\n\n .tna-template--system-theme & {\n @media (prefers-contrast: more) {\n @content;\n }\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:map\";\n@use \"../variables/spacing\";\n@use \"../tools/media\";\n\n%space-above {\n margin-top: 2rem;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above {\n @extend %space-above;\n}\n\n@function space($size) {\n @return map.get(spacing.$spacing, $size);\n}\n\n@function space-mobile($size) {\n @return map.get(spacing.$spacing-mobile, $size);\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n\n.tna-button-group {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 1rem;\n\n @include spacing.space-above;\n\n @include media.on-tiny {\n flex-direction: column;\n align-items: stretch;\n }\n\n &--small {\n gap: 0.5rem;\n }\n}\n","@use \"../variables/media\";\n\n// 0 ======= 320 = 480 ===== 768 == 1024 ========================== min-width/max-width (px)\n// | . | | |\n// |-TINY----------|-SMALL---|-MED--|-LARGE------------------------\n// | . | | |\n// |<------------->| | | on-tiny\n// |<----------------------->| | on-mobile\n// |<------------------------------>| on-smaller-than-large\n// | . |<------->| | on-small\n// | . |<------------------------- on-larger-than-tiny\n// | . | |<---->| on-medium\n// | . | |<--------------- on-larger-than-mobile\n// | . | | |<-------- on-large\n// |<------->. | | | Smallest device\n\n@mixin on-large() {\n @media #{media.$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{media.$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{media.$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{media.$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{media.$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{media.$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{media.$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{media.$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/typography\";\n@use \"button-group\";\n\n.tna-button {\n padding: 0.25rem 1rem;\n\n display: inline-flex;\n align-items: baseline;\n justify-content: center;\n gap: 0.75rem;\n\n @include typography.relative-font-size(18);\n @include typography.main-font-weight-bold;\n line-height: #{math.div(16, 18) * 2};\n text-decoration: none;\n text-align: center;\n text-wrap: balance;\n\n @include colour.colour-background(\"button-background\");\n\n @include colour.colour-border(\"button-background\", 0.25rem);\n\n cursor: pointer;\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"button-hover-text\");\n text-decoration: none;\n\n background: transparent;\n }\n\n .fa-solid {\n display: block;\n\n font-size: 0.9em;\n line-height: #{math.div(16, 18) * 2};\n }\n\n &--plain {\n @include typography.main-font-weight;\n\n background-color: transparent;\n\n border-color: transparent;\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"link\");\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n\n &--accent {\n @include colour.colour-background(\"button-accent-background\");\n\n @include colour.colour-border(\"button-accent-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-accent-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n &--icon-right {\n flex-direction: row-reverse;\n }\n\n &--small,\n &-group--small & {\n padding: 0 0.5rem;\n\n @include typography.relative-font-size(14);\n line-height: 1.5rem;\n\n .fa-solid {\n line-height: 2rem;\n }\n }\n\n @mixin icon-only {\n padding-right: 0;\n padding-left: 0;\n\n gap: 0;\n\n font-size: 0;\n line-height: 0;\n\n .fa-solid {\n width: 2.5rem;\n\n @include typography.relative-font-size(18);\n }\n }\n\n @mixin icon-only-small {\n padding-right: 0;\n padding-left: 0;\n\n .fa-solid {\n width: 2rem;\n\n @include typography.relative-font-size(18 * 0.9);\n }\n }\n\n &--icon-only {\n @include icon-only;\n }\n\n &--small#{&}--icon-only,\n &-group--small &--icon-only {\n @include icon-only-small;\n }\n\n @include media.on-mobile {\n &--icon-only-mobile {\n @include icon-only;\n }\n\n &--small#{&}--icon-only-mobile,\n &-group--small &--icon-only-mobile {\n @include icon-only-small;\n }\n }\n\n &--solid-hover {\n &:not(.tna-button--plain):hover {\n @include colour.colour-font(\"font-dark\");\n\n @include colour.colour-background(\"page-background\");\n }\n }\n\n .tna-background-accent & {\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n .tna-background-accent &--accent {\n @include colour.plain;\n\n @include colour.colour-background(\"page-background\");\n\n @include colour.colour-border(\"page-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"font-dark\");\n }\n\n &:hover {\n @include colour.colour-font(\"page-background\");\n\n @include colour.colour-background(\"font-dark\");\n }\n }\n}\n","@use \"sass:math\";\n@use \"colour\";\n@use \"../variables/typography\";\n\n@mixin relative-font-size($fontSizePx) {\n font-size: #{math.div($fontSizePx, 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-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: #{math.div(typography.$relative-1rem-px, 14)};\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n","@use \"sass:math\";\n\n$use-local-fonts: false !default;\n\n$relative-1rem-px: 16; // 16px is always 1rem\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: #{math.div($relative-1rem-px, $body-font-size-px) * 2} !default; // 1.77777\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font: \"Open Sans\" !default;\n$main-font-family: $main-font, sans-serif !default;\n$main-font-weight: 400 !default;\n$main-font-weight-bold: 700 !default;\n\n$heading-font-family: supria-sans-condensed, \"Arial Narrow\", sans-serif !default;\n$heading-font-weight: 500 !default;\n\n$detail-font-family: \"Roboto Mono\", monospace !default;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n"]}
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/button/_button-group.scss","../../../../src/nationalarchives/tools/_media.scss","../../../../src/nationalarchives/components/button/button.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"AAyLA,8IA7KM,ygDAgLJ,+BAHF,8IA7JM,48CAoKJ,waApKI,28CA6LN,2CA6BE,qCAzBE,mCAHF,8IAtMI,6kDA6MF,+DAPF,8IAtLI,4kDAkMJ,4IA1NI,4hDA8NJ,0IAtNI,4kDA0NJ,4JAlNI,89CAsNJ,8MA9MI,2kDChCN,kBACE,gBAEA,8BACE,aCLJ,kBACE,aACA,eACA,mBACA,SC4BA,wBDhCF,kBASI,sBACA,qBAGF,yBACE,UEXJ,YACE,oBAEA,oBACA,qBACA,uBACA,WCPA,mBAQA,YCEsB,IFCtB,iBACA,qBACA,kBACA,kBJ2EA,sBAEA,0CAoCI,sBAIA,0CI/GJ,eAEA,iDJ8DA,WACA,yBIzDA,kBJwDA,WACA,+BIvDE,qBAEA,yBAGF,sBACE,cAEA,eACA,yBAGF,mBCtCA,YCKiB,IFoCf,+BAEA,2BAEA,sEJmCF,cACA,kBI9BE,yBCRF,0BACA,0BC3CsC,MFuDtC,oBJ6BA,yBAEA,iDA0CI,qBAEA,6CItEF,yEJmBF,WACA,gCIdE,0BJaF,WACA,uBITA,wBACE,2BAGF,wDAEE,gBClFF,mBDqFE,mBA+BF,uBA3BE,gBACA,eAEA,MAEA,uBACA,yBAEA,iCACE,aClGJ,mBDwHA,yFAfE,gBACA,eAEA,6GACE,WC7GJ,oBDgHI,iBD1DJ,wBCwEE,8BArCA,gBACA,eAEA,MAEA,uBACA,yBAEA,wCACE,aClGJ,mBDkIE,uGAzBA,gBACA,eAEA,2HACE,WC7GJ,oBDgHI,kBAyBF,uDJrDF,WACA,uBAIA,yBAEA,wCIsDE,yCJ7DF,WACA,uBIiEA,2CJ7DA,yBAEA,wCA0CI,qBAEA,oCIsBF,8IJzEF,WACA,uBI8EE,iDJ/EF,cACA,6BAIA,sBAEA","file":"button.css","sourcesContent":["@use \"sass:map\";\n@use \"sass:list\";\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 accent-css-vars($colour) {\n @if $colour == \"yellow\" {\n --accent-background: #{brand-colour(\"yellow\")} !important;\n --accent-background-light: #{brand-colour(\"cream\")} !important;\n --accent-font-base: #{brand-colour(\"black\")} !important;\n --accent-font-dark: #{brand-colour(\"black\")} !important;\n --accent-font-light: #{brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{brand-colour(\"black\")} !important;\n --accent-link-visited: #{brand-colour(\"black\")} !important;\n --accent-keyline: #{brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"black\", 0.8)} !important;\n --button-accent-background: #{brand-colour(\"yellow\")} !important;\n } @else {\n --accent-font-base: #{brand-colour(\"white\")} !important;\n --accent-font-dark: #{brand-colour(\"white\")} !important;\n --accent-font-light: #{brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{brand-colour(\"white\")} !important;\n --accent-link-visited: #{brand-colour(\"white\")} !important;\n --accent-keyline: #{brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{brand-colour(\"white\")} !important;\n @if $colour == \"pink\" {\n --accent-background: #{brand-colour(\"maroon\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-pink\")} !important;\n --button-accent-background: #{brand-colour(\"maroon\")} !important;\n } @else if $colour == \"orange\" {\n --accent-background: #{brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-orange\")} !important;\n --button-accent-background: #{brand-colour(\"chestnut\")} !important;\n } @else if $colour == \"green\" {\n --accent-background: #{brand-colour(\"forest\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-green\")} !important;\n --button-accent-background: #{brand-colour(\"forest\")} !important;\n } @else if $colour == \"blue\" {\n --accent-background: #{brand-colour(\"navy\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-blue\")} !important;\n --button-accent-background: #{brand-colour(\"navy\")} !important;\n }\n }\n}\n\n@mixin colour-font(\n $colour,\n $important: false,\n $default-palette: colour.$colour-palette-default\n) {\n color: map.get($default-palette, $colour) if($important, !important, null);\n color: var(--#{$colour}) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n background-color: var(--#{$colour}) 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 $property: border-#{$direction};\n border-#{$direction}: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border-#{$direction}: $width\n var(--#{$colour})\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: map.get(\n colour.$colour-palette-default,\n $colour\n )\n if($important, !important, null);\n border-#{$direction}-color: var(--#{$colour})\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n border-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n border-color: var(--#{$colour}) 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 map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n outline: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n outline-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n outline-color: var(--#{$colour}) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n fill: var(--#{$colour}) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction) {\n @include colour-border(\"keyline\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-dark($direction) {\n @include colour-border(\"keyline-dark\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-accent($direction) {\n @include colour-border(\"accent-background\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-error($direction) {\n @include colour-border(\"form-error\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-brand($direction, $brandColour) {\n border-#{$direction}: 5px #{brand-colour($brandColour)} solid;\n}\n\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 .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n%dark {\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 .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n}\n\n@mixin dark {\n @extend %dark;\n}\n\n%plain {\n .tna-template--system-theme & {\n @extend %light;\n\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark;\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark;\n }\n }\n\n .tna-template--light-theme & {\n @include colour-css-vars;\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast;\n }\n\n .tna-template--high-contrast-theme.tna-template--dark-theme & {\n @include colour-css-vars-high-contrast-dark;\n }\n\n --background: var(--page-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\", false, colour.$colour-palette-dark);\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\", false, colour.$colour-palette-dark);\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\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\", false, colour.$colour-palette-dark);\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%tint {\n @include colour-background(\"background-tint\");\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent-background {\n @include colour-background(\"accent-background\");\n}\n\n@mixin accent-background {\n @extend %accent-background;\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 // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\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 @include colour-background(\"background\");\n @include colour-font(\"font-base\");\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\n@mixin accent-light {\n @extend %accent-light;\n}\n\n@mixin on-high-contrast {\n .tna-template--high-contrast-theme & {\n @content;\n }\n\n .tna-template--system-theme & {\n @media (prefers-contrast: more) {\n @content;\n }\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:map\";\n@use \"../variables/spacing\";\n@use \"../tools/media\";\n\n%space-above {\n margin-top: 2rem;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above {\n @extend %space-above;\n}\n\n@function space($size) {\n @return map.get(spacing.$spacing, $size);\n}\n\n@function space-mobile($size) {\n @return map.get(spacing.$spacing-mobile, $size);\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n\n.tna-button-group {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 1rem;\n\n @include spacing.space-above;\n\n @include media.on-tiny {\n flex-direction: column;\n align-items: stretch;\n }\n\n &--small {\n gap: 0.5rem;\n }\n}\n","@use \"../variables/media\";\n\n// 0 ======= 320 = 480 ===== 768 == 1024 ========================== min-width/max-width (px)\n// | . | | |\n// |-TINY----------|-SMALL---|-MED--|-LARGE------------------------\n// | . | | |\n// |<------------->| | | on-tiny\n// |<----------------------->| | on-mobile\n// |<------------------------------>| on-smaller-than-large\n// | . |<------->| | on-small\n// | . |<------------------------- on-larger-than-tiny\n// | . | |<---->| on-medium\n// | . | |<--------------- on-larger-than-mobile\n// | . | | |<-------- on-large\n// |<------->. | | | Smallest device\n\n@mixin on-large() {\n @media #{media.$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{media.$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{media.$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{media.$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{media.$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{media.$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{media.$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{media.$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/typography\";\n@use \"button-group\";\n\n.tna-button {\n padding: 0.25rem 1rem;\n\n display: inline-flex;\n align-items: baseline;\n justify-content: center;\n gap: 0.75rem;\n\n @include typography.relative-font-size(18);\n @include typography.main-font-weight-bold;\n line-height: 2rem;\n text-decoration: none;\n text-align: center;\n text-wrap: balance;\n\n @include colour.colour-background(\"button-background\");\n\n @include colour.colour-border(\"button-background\", 4px);\n\n cursor: pointer;\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"button-hover-text\");\n text-decoration: none;\n\n background: transparent;\n }\n\n .fa-solid {\n display: block;\n\n font-size: 0.9em;\n line-height: #{math.div(16, 18) * 2};\n }\n\n &--plain {\n @include typography.main-font-weight;\n\n background-color: transparent;\n\n border-color: transparent;\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"link\");\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n\n &--accent {\n @include colour.colour-background(\"button-accent-background\");\n\n @include colour.colour-border(\"button-accent-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-accent-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n &--icon-right {\n flex-direction: row-reverse;\n }\n\n &--small,\n &-group--small & {\n padding: 0 0.5rem;\n\n @include typography.relative-font-size(14);\n line-height: 1.5rem;\n }\n\n @mixin icon-only {\n padding-right: 0;\n padding-left: 0;\n\n gap: 0;\n\n font-size: 0 !important;\n line-height: 0 !important;\n\n .fa-solid {\n width: 2.5rem;\n\n @include typography.relative-font-size(18);\n }\n }\n\n @mixin icon-only-small {\n padding-right: 0;\n padding-left: 0;\n\n .fa-solid {\n width: 2rem;\n\n @include typography.relative-font-size(18 * 0.9);\n line-height: 2rem;\n }\n }\n\n &--icon-only {\n @include icon-only;\n }\n\n &--small#{&}--icon-only,\n &-group--small &--icon-only {\n @include icon-only-small;\n }\n\n @include media.on-mobile {\n &--icon-only-mobile {\n @include icon-only;\n }\n\n &--small#{&}--icon-only-mobile,\n &-group--small &--icon-only-mobile {\n @include icon-only-small;\n }\n }\n\n &--solid-hover {\n &:not(.tna-button--plain):hover {\n @include colour.colour-font(\"font-dark\");\n\n @include colour.colour-background(\"page-background\");\n }\n }\n\n .tna-background-accent & {\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n .tna-background-accent &--accent {\n @include colour.plain;\n\n @include colour.colour-background(\"page-background\");\n\n @include colour.colour-border(\"page-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"font-dark\");\n }\n\n &:hover {\n @include colour.colour-font(\"page-background\");\n\n @include colour.colour-background(\"font-dark\");\n }\n }\n}\n","@use \"sass:math\";\n@use \"colour\";\n@use \"../variables/typography\";\n\n@mixin relative-font-size($fontSizePx) {\n font-size: #{math.div($fontSizePx, 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-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: #{math.div(typography.$relative-1rem-px, 14)};\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n","@use \"sass:math\";\n\n$use-local-fonts: false !default;\n\n$relative-1rem-px: 16; // 16px is always 1rem\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: #{math.div($relative-1rem-px, $body-font-size-px) * 2} !default; // 1.77777\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font: \"Open Sans\" !default;\n$main-font-family: $main-font, sans-serif !default;\n$main-font-weight: 400 !default;\n$main-font-weight-bold: 700 !default;\n\n$heading-font-family: supria-sans-condensed, \"Arial Narrow\", sans-serif !default;\n$heading-font-weight: 500 !default;\n\n$detail-font-family: \"Roboto Mono\", monospace !default;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n"]}
|
@@ -14,14 +14,14 @@
|
|
14
14
|
|
15
15
|
@include typography.relative-font-size(18);
|
16
16
|
@include typography.main-font-weight-bold;
|
17
|
-
line-height:
|
17
|
+
line-height: 2rem;
|
18
18
|
text-decoration: none;
|
19
19
|
text-align: center;
|
20
20
|
text-wrap: balance;
|
21
21
|
|
22
22
|
@include colour.colour-background("button-background");
|
23
23
|
|
24
|
-
@include colour.colour-border("button-background",
|
24
|
+
@include colour.colour-border("button-background", 4px);
|
25
25
|
|
26
26
|
cursor: pointer;
|
27
27
|
|
@@ -89,10 +89,6 @@
|
|
89
89
|
|
90
90
|
@include typography.relative-font-size(14);
|
91
91
|
line-height: 1.5rem;
|
92
|
-
|
93
|
-
.fa-solid {
|
94
|
-
line-height: 2rem;
|
95
|
-
}
|
96
92
|
}
|
97
93
|
|
98
94
|
@mixin icon-only {
|
@@ -101,8 +97,8 @@
|
|
101
97
|
|
102
98
|
gap: 0;
|
103
99
|
|
104
|
-
font-size: 0;
|
105
|
-
line-height: 0;
|
100
|
+
font-size: 0 !important;
|
101
|
+
line-height: 0 !important;
|
106
102
|
|
107
103
|
.fa-solid {
|
108
104
|
width: 2.5rem;
|
@@ -119,6 +115,7 @@
|
|
119
115
|
width: 2rem;
|
120
116
|
|
121
117
|
@include typography.relative-font-size(18 * 0.9);
|
118
|
+
line-height: 2rem;
|
122
119
|
}
|
123
120
|
}
|
124
121
|
|
@@ -65,6 +65,9 @@ const Template = ({
|
|
65
65
|
});
|
66
66
|
|
67
67
|
export const Standard = Template.bind({});
|
68
|
+
Standard.parameters = {
|
69
|
+
chromatic: { disableSnapshot: true },
|
70
|
+
};
|
68
71
|
Standard.args = {
|
69
72
|
text: "Button",
|
70
73
|
href: "#",
|
@@ -72,6 +75,9 @@ Standard.args = {
|
|
72
75
|
};
|
73
76
|
|
74
77
|
export const Accent = Template.bind({});
|
78
|
+
Accent.parameters = {
|
79
|
+
chromatic: { disableSnapshot: true },
|
80
|
+
};
|
75
81
|
Accent.args = {
|
76
82
|
text: "Button",
|
77
83
|
href: "#",
|
@@ -80,6 +86,9 @@ Accent.args = {
|
|
80
86
|
};
|
81
87
|
|
82
88
|
export const Icon = Template.bind({});
|
89
|
+
Icon.parameters = {
|
90
|
+
chromatic: { disableSnapshot: true },
|
91
|
+
};
|
83
92
|
Icon.args = {
|
84
93
|
text: "Explore the collection",
|
85
94
|
href: "#",
|
@@ -88,6 +97,9 @@ Icon.args = {
|
|
88
97
|
};
|
89
98
|
|
90
99
|
export const RightAlignedIcon = Template.bind({});
|
100
|
+
RightAlignedIcon.parameters = {
|
101
|
+
chromatic: { disableSnapshot: true },
|
102
|
+
};
|
91
103
|
RightAlignedIcon.args = {
|
92
104
|
text: "Search",
|
93
105
|
href: "#",
|
@@ -97,6 +109,9 @@ RightAlignedIcon.args = {
|
|
97
109
|
};
|
98
110
|
|
99
111
|
export const IconOnly = Template.bind({});
|
112
|
+
IconOnly.parameters = {
|
113
|
+
chromatic: { disableSnapshot: true },
|
114
|
+
};
|
100
115
|
IconOnly.args = {
|
101
116
|
text: "Show as a list",
|
102
117
|
href: "#",
|
@@ -106,6 +121,9 @@ IconOnly.args = {
|
|
106
121
|
};
|
107
122
|
|
108
123
|
export const Small = Template.bind({});
|
124
|
+
Small.parameters = {
|
125
|
+
chromatic: { disableSnapshot: true },
|
126
|
+
};
|
109
127
|
Small.args = {
|
110
128
|
text: "Small button",
|
111
129
|
href: "#",
|
@@ -114,6 +132,9 @@ Small.args = {
|
|
114
132
|
};
|
115
133
|
|
116
134
|
export const SmallWithIcon = Template.bind({});
|
135
|
+
SmallWithIcon.parameters = {
|
136
|
+
chromatic: { disableSnapshot: true },
|
137
|
+
};
|
117
138
|
SmallWithIcon.args = {
|
118
139
|
text: "Explore the collection",
|
119
140
|
href: "#",
|
@@ -123,6 +144,9 @@ SmallWithIcon.args = {
|
|
123
144
|
};
|
124
145
|
|
125
146
|
export const SmallIconOnly = Template.bind({});
|
147
|
+
SmallIconOnly.parameters = {
|
148
|
+
chromatic: { disableSnapshot: true },
|
149
|
+
};
|
126
150
|
SmallIconOnly.args = {
|
127
151
|
text: "Explore the collection",
|
128
152
|
href: "#",
|
@@ -133,6 +157,9 @@ SmallIconOnly.args = {
|
|
133
157
|
};
|
134
158
|
|
135
159
|
export const Plain = Template.bind({});
|
160
|
+
Plain.parameters = {
|
161
|
+
chromatic: { disableSnapshot: true },
|
162
|
+
};
|
136
163
|
Plain.args = {
|
137
164
|
text: "Plain button",
|
138
165
|
href: "#",
|
@@ -141,6 +168,9 @@ Plain.args = {
|
|
141
168
|
};
|
142
169
|
|
143
170
|
export const SmallPlain = Template.bind({});
|
171
|
+
SmallPlain.parameters = {
|
172
|
+
chromatic: { disableSnapshot: true },
|
173
|
+
};
|
144
174
|
SmallPlain.args = {
|
145
175
|
text: "Plain small button",
|
146
176
|
href: "#",
|
@@ -150,6 +180,9 @@ SmallPlain.args = {
|
|
150
180
|
};
|
151
181
|
|
152
182
|
export const SmallPlainIcon = Template.bind({});
|
183
|
+
SmallPlainIcon.parameters = {
|
184
|
+
chromatic: { disableSnapshot: true },
|
185
|
+
};
|
153
186
|
SmallPlainIcon.args = {
|
154
187
|
text: "Plain small button",
|
155
188
|
href: "#",
|
@@ -160,47 +193,12 @@ SmallPlainIcon.args = {
|
|
160
193
|
};
|
161
194
|
|
162
195
|
export const ButtonElement = Template.bind({});
|
196
|
+
ButtonElement.parameters = {
|
197
|
+
chromatic: { disableSnapshot: true },
|
198
|
+
};
|
163
199
|
ButtonElement.args = {
|
164
200
|
text: "Button element",
|
165
201
|
href: "#",
|
166
202
|
buttonElement: true,
|
167
203
|
classes: "tna-button--demo",
|
168
204
|
};
|
169
|
-
|
170
|
-
const GroupTemplate = ({ buttons }) =>
|
171
|
-
`<div class="tna-button-group">
|
172
|
-
${buttons.map((button) => Template(button)).join("")}
|
173
|
-
</div>`;
|
174
|
-
|
175
|
-
export const Group = GroupTemplate.bind({});
|
176
|
-
Group.args = {
|
177
|
-
buttons: [
|
178
|
-
{
|
179
|
-
text: "Button 1",
|
180
|
-
href: "#",
|
181
|
-
classes: "tna-button--demo",
|
182
|
-
},
|
183
|
-
{
|
184
|
-
text: "Button 2",
|
185
|
-
href: "#",
|
186
|
-
accent: true,
|
187
|
-
classes: "tna-button--demo",
|
188
|
-
},
|
189
|
-
{
|
190
|
-
text: "Call us",
|
191
|
-
href: "#",
|
192
|
-
icon: "phone",
|
193
|
-
classes: "tna-button--demo",
|
194
|
-
},
|
195
|
-
{
|
196
|
-
text: "Button",
|
197
|
-
buttonElement: true,
|
198
|
-
classes: "tna-button--demo",
|
199
|
-
},
|
200
|
-
{
|
201
|
-
text: "Plain",
|
202
|
-
plain: true,
|
203
|
-
classes: "tna-button--demo",
|
204
|
-
},
|
205
|
-
],
|
206
|
-
};
|
@@ -7,8 +7,7 @@
|
|
7
7
|
"text": "Log in",
|
8
8
|
"href": "#"
|
9
9
|
},
|
10
|
-
"html": "<a href=\"#\" class=\"tna-button
|
11
|
-
"hidden": false
|
10
|
+
"html": "<a href=\"#\" class=\"tna-button\">Log in</a>"
|
12
11
|
},
|
13
12
|
{
|
14
13
|
"name": "with title",
|
@@ -17,8 +16,7 @@
|
|
17
16
|
"href": "#",
|
18
17
|
"title": "Log in to the service"
|
19
18
|
},
|
20
|
-
"html": "<a href=\"#\" class=\"tna-button
|
21
|
-
"hidden": false
|
19
|
+
"html": "<a href=\"#\" class=\"tna-button\" title=\"Log in to the service\">Log in</a>"
|
22
20
|
},
|
23
21
|
{
|
24
22
|
"name": "accent",
|
@@ -27,8 +25,7 @@
|
|
27
25
|
"href": "#",
|
28
26
|
"accent": true
|
29
27
|
},
|
30
|
-
"html": "<a href=\"#\" class=\"tna-button tna-button--accent\">Log in</a>"
|
31
|
-
"hidden": false
|
28
|
+
"html": "<a href=\"#\" class=\"tna-button tna-button--accent\">Log in</a>"
|
32
29
|
},
|
33
30
|
{
|
34
31
|
"name": "with classes",
|
@@ -37,8 +34,7 @@
|
|
37
34
|
"href": "#",
|
38
35
|
"classes": "button__test-class"
|
39
36
|
},
|
40
|
-
"html": "<a href=\"#\" class=\"tna-button button__test-class\">Log in</a>"
|
41
|
-
"hidden": false
|
37
|
+
"html": "<a href=\"#\" class=\"tna-button button__test-class\">Log in</a>"
|
42
38
|
},
|
43
39
|
{
|
44
40
|
"name": "with attributes",
|
@@ -49,8 +45,7 @@
|
|
49
45
|
"data-testattribute": "foobar"
|
50
46
|
}
|
51
47
|
},
|
52
|
-
"html": "<a href=\"#\" class=\"tna-button
|
53
|
-
"hidden": false
|
48
|
+
"html": "<a href=\"#\" class=\"tna-button\" data-testattribute=\"foobar\">Log in</a>"
|
54
49
|
}
|
55
50
|
]
|
56
51
|
}
|
@@ -1,25 +1,26 @@
|
|
1
|
-
{%- set
|
1
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
2
|
{%- if params.accent -%}
|
3
|
-
{%- set
|
3
|
+
{%- set containerClasses = containerClasses.concat('tna-button--accent') -%}
|
4
4
|
{%- endif -%}
|
5
5
|
{%- if params.small -%}
|
6
|
-
{%- set
|
6
|
+
{%- set containerClasses = containerClasses.concat('tna-button--small') -%}
|
7
7
|
{%- endif -%}
|
8
8
|
{%- if params.plain -%}
|
9
|
-
{%- set
|
9
|
+
{%- set containerClasses = containerClasses.concat('tna-button--plain') -%}
|
10
10
|
{%- endif -%}
|
11
11
|
{%- if params.iconOnly -%}
|
12
|
-
{%- set
|
12
|
+
{%- set containerClasses = containerClasses.concat('tna-button--icon-only') -%}
|
13
13
|
{%- endif -%}
|
14
14
|
{%- if params.iconOnlyOnMobile -%}
|
15
|
-
{%- set
|
15
|
+
{%- set containerClasses = containerClasses.concat('tna-button--icon-only-mobile') -%}
|
16
16
|
{%- endif -%}
|
17
17
|
{%- if params.rightAlignIcon -%}
|
18
|
-
{%- set
|
18
|
+
{%- set containerClasses = containerClasses.concat('tna-button--icon-right') -%}
|
19
19
|
{%- endif -%}
|
20
|
-
|
21
|
-
|
20
|
+
{%- set classes = containerClasses | join(' ') -%}
|
21
|
+
<{{ 'button' if params.buttonElement else 'a' }}{%- if not params.buttonElement %} href="{{ params.href }}"{%- endif %} class="tna-button{% if classes %} {{ classes }}{% endif %}"{%- if params.buttonElement %} type="{{ params.buttonType or 'button' }}"{% endif -%}{%- if params.title %} title="{{ params.title }}"{% endif %}{% for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
22
|
+
{% if params.icon -%}
|
22
23
|
<i class="fa-solid fa-{{ params.icon }}" aria-hidden="true"></i>
|
23
24
|
{% endif -%}
|
24
|
-
{{ params.text
|
25
|
+
{{ params.text }}
|
25
26
|
</{{ 'button' if params.buttonElement else 'a' }}>
|
@@ -1 +1 @@
|
|
1
|
-
.tna-card--contrast,.tna-card--accent .tna-hgroup__supertitle:not(.tna-hgroup__supertitle--plain){--background: var(--contrast-background);--font-base: var(--contrast-font-base);--font-dark: var(--contrast-font-dark);--font-light: var(--contrast-font-light);--icon-light: var(--contrast-icon-light);--link: var(--contrast-link);--link-visited: var(--contrast-link-visited);--keyline: var(--contrast-keyline);--keyline-dark: var(--contrast-keyline-dark);--button-text: var(--contrast-button-text);--button-background: var(--contrast-button-background);--button-hover-text: var(--contrast-button-hover-text);--button-hover-background: var(--contrast-button-hover-background);background-color:var(--background);color:rgb(255 255 255/0.95);color:var(--font-base)}.tna-card--accent{--background: var(--accent-background);--font-base: var(--accent-font-base);--font-dark: var(--accent-font-dark);--font-light: var(--accent-font-light);--icon-light: var(--accent-icon-light);--link: var(--accent-link);--link-visited: var(--accent-link);--keyline: var(--accent-keyline);--keyline-dark: var(--accent-keyline-dark);background-color:var(--background);color:rgb(255 255 255/0.95);color:var(--font-base)}.tna-card{margin-top:2rem}.tna-card:first-child{margin-top:0}.tna-card__inner{display:flex;flex-direction:column}.tna-card__heading{order:2}.tna-card__heading-link::after{display:none !important}.tna-card__image-container{height:0;margin-bottom:1rem;padding-bottom:66.6666666667%;position:relative;order:1}.tna-card__image{position:absolute;inset:0}.tna-card__image img{width:100%;height:100%;object-fit:cover}.tna-card__image-label{max-width:calc(100% - 1rem);position:absolute;top:.5rem;left:.5rem}.tna-card__body{padding-top:1rem;order:3}.tna-card__meta{display:flex;flex-wrap:wrap;gap:.5rem 1.5rem;line-height:1.3;list-style:none}.tna-card__meta+p{margin-top:1rem}.tna-card__actions{margin-top:2rem;order:4}.tna-card__action{font-weight:700}.tna-card__action .fa-solid{margin-right:.5rem}.tna-card--contrast .tna-card__inner,.tna-card--accent .tna-card__inner{padding-bottom:1rem}.tna-card--contrast .tna-card__heading,.tna-card--contrast .tna-card__body,.tna-card--contrast .tna-card__actions,.tna-card--accent .tna-card__heading,.tna-card--accent .tna-card__body,.tna-card--accent .tna-card__actions{margin-right:1rem;margin-left:1rem}.tna-card--accent .tna-hgroup__supertitle:not(.tna-hgroup__supertitle--plain){border-color:#1e1e1e;border-color:var(--contrast-background)}.tna-card--horizontal{aspect-ratio:auto 3/1;position:relative}@media(min-width: 48.0625em){.tna-card--horizontal .tna-card__inner{margin-left:50%;padding:2rem}.tna-card--horizontal .tna-card__image-container{height:auto;min-height:50%;margin-bottom:0;padding-bottom:0;display:block;position:absolute;inset:0 50% 0 0}.tna-card--horizontal .tna-card__heading,.tna-card--horizontal .tna-card__body,.tna-card--horizontal .tna-card__actions{margin-right:0;margin-left:0}}@media(max-width: 48em){.tna-card--horizontal.tna-card--contrast .tna-card__inner,.tna-card--horizontal.tna-card--accent .tna-card__inner{padding:0 0 1rem}.tna-card--horizontal.tna-card--contrast .tna-card__image-container,.tna-card--horizontal.tna-card--accent .tna-card__image-container{margin-bottom:1rem}.tna-card--horizontal.tna-card--contrast .tna-card__heading,.tna-card--horizontal.tna-card--contrast .tna-card__body,.tna-card--horizontal.tna-card--contrast .tna-card__actions,.tna-card--horizontal.tna-card--accent .tna-card__heading,.tna-card--horizontal.tna-card--accent .tna-card__body,.tna-card--horizontal.tna-card--accent .tna-card__actions{margin-right:1rem;margin-left:1rem}}@media(forced-colors: active){.tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}.tna-card:not(.tna-card--horizontal) .tna-card__inner{padding-bottom:1rem}.tna-card:not(.tna-card--horizontal) .tna-card__heading,.tna-card:not(.tna-card--horizontal) .tna-card__body,.tna-card:not(.tna-card--horizontal) .tna-card__actions{margin-right:1rem;margin-left:1rem}}.tna-template--high-contrast-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__inner{padding-bottom:1rem}.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__heading,.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__body,.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__actions{margin-right:1rem;margin-left:1rem}@media(prefers-contrast: more){.tna-template--system-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__inner{padding-bottom:1rem}.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__heading,.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__body,.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__actions{margin-right:1rem;margin-left:1rem}}.tna-template--high-contrast-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}@media(prefers-contrast: more){.tna-template--system-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}}/*# sourceMappingURL=card.css.map */
|
1
|
+
.tna-card--contrast,.tna-card--accent .tna-hgroup__supertitle:not(.tna-hgroup__supertitle--plain){--background: var(--contrast-background);--font-base: var(--contrast-font-base);--font-dark: var(--contrast-font-dark);--font-light: var(--contrast-font-light);--icon-light: var(--contrast-icon-light);--link: var(--contrast-link);--link-visited: var(--contrast-link-visited);--keyline: var(--contrast-keyline);--keyline-dark: var(--contrast-keyline-dark);--button-text: var(--contrast-button-text);--button-background: var(--contrast-button-background);--button-hover-text: var(--contrast-button-hover-text);--button-hover-background: var(--contrast-button-hover-background);background-color:var(--background);color:rgb(255 255 255/0.95);color:var(--font-base)}.tna-card--accent{--background: var(--accent-background);--font-base: var(--accent-font-base);--font-dark: var(--accent-font-dark);--font-light: var(--accent-font-light);--icon-light: var(--accent-icon-light);--link: var(--accent-link);--link-visited: var(--accent-link);--keyline: var(--accent-keyline);--keyline-dark: var(--accent-keyline-dark);background-color:var(--background);color:rgb(255 255 255/0.95);color:var(--font-base)}.tna-card{margin-top:2rem}.tna-card:first-child{margin-top:0}.tna-card__inner{display:flex;flex-direction:column}.tna-card__heading{order:2}.tna-card__heading-link::after{display:none !important}.tna-card__image-container{height:0;margin-bottom:1rem;padding-bottom:66.6666666667%;position:relative;order:1}.tna-card__image{position:absolute;inset:0}.tna-card__image img{width:100%;height:100%;object-fit:cover}.tna-card__image-label{max-width:calc(100% - 1rem);position:absolute;top:.5rem;left:.5rem}.tna-card__body{padding-top:1rem;order:3}.tna-card__meta{display:flex;flex-wrap:wrap;gap:.5rem 1.5rem;line-height:1.3;list-style:none}.tna-card__meta+p{margin-top:1rem}.tna-card__actions{margin-top:2rem;order:4}.tna-card__action{font-weight:700}.tna-card__action .fa-solid{margin-right:.5rem}.tna-card--contrast .tna-card__inner,.tna-card--accent .tna-card__inner{padding-bottom:1rem}.tna-card--contrast .tna-card__heading,.tna-card--contrast .tna-card__body,.tna-card--contrast .tna-card__actions,.tna-card--accent .tna-card__heading,.tna-card--accent .tna-card__body,.tna-card--accent .tna-card__actions{margin-right:1rem;margin-left:1rem}.tna-card--accent .tna-hgroup__supertitle:not(.tna-hgroup__supertitle--plain){border-color:#1e1e1e;border-color:var(--contrast-background)}.tna-card--horizontal{aspect-ratio:auto 3/1;position:relative}@media(min-width: 48.0625em){.tna-card--horizontal .tna-card__inner{margin-left:50%;padding:2rem}.tna-card--horizontal .tna-card__image-container{height:auto;min-height:50%;margin-bottom:0;padding-bottom:0;display:block;position:absolute;inset:0 50% 0 0}.tna-card--horizontal .tna-card__heading,.tna-card--horizontal .tna-card__body,.tna-card--horizontal .tna-card__actions{margin-right:0;margin-left:0}}@media(max-width: 48em){.tna-card--horizontal.tna-card--contrast .tna-card__inner,.tna-card--horizontal.tna-card--accent .tna-card__inner{padding:0 0 1rem}.tna-card--horizontal.tna-card--contrast .tna-card__image-container,.tna-card--horizontal.tna-card--accent .tna-card__image-container{margin-bottom:1rem}.tna-card--horizontal.tna-card--contrast .tna-card__heading,.tna-card--horizontal.tna-card--contrast .tna-card__body,.tna-card--horizontal.tna-card--contrast .tna-card__actions,.tna-card--horizontal.tna-card--accent .tna-card__heading,.tna-card--horizontal.tna-card--accent .tna-card__body,.tna-card--horizontal.tna-card--accent .tna-card__actions{margin-right:1rem;margin-left:1rem}}.tna-card__inner:has(.tna-card__heading+.tna-card__body){padding-top:.5rem;border-top:5px #26262a solid;border-top:5px var(--keyline-dark) solid}@media(forced-colors: active){.tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}.tna-card:not(.tna-card--horizontal) .tna-card__inner{padding-bottom:1rem}.tna-card:not(.tna-card--horizontal) .tna-card__heading,.tna-card:not(.tna-card--horizontal) .tna-card__body,.tna-card:not(.tna-card--horizontal) .tna-card__actions{margin-right:1rem;margin-left:1rem}}.tna-template--high-contrast-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__inner{padding-bottom:1rem}.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__heading,.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__body,.tna-template--high-contrast-theme .tna-card:not(.tna-template--high-contrast-theme .tna-card--horizontal) .tna-card__actions{margin-right:1rem;margin-left:1rem}@media(prefers-contrast: more){.tna-template--system-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__inner{padding-bottom:1rem}.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__heading,.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__body,.tna-template--system-theme .tna-card:not(.tna-template--system-theme .tna-card--horizontal) .tna-card__actions{margin-right:1rem;margin-left:1rem}}.tna-template--high-contrast-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}@media(prefers-contrast: more){.tna-template--system-theme .tna-card{border:1px #26262a solid;border:1px var(--keyline-dark) solid}}/*# sourceMappingURL=card.css.map */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/card/card.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_media.scss"],"names":[],"mappings":"AA4NA,kGACE,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEAlJA,mCAPA,4BACA,uBA6LF,kBACE,uCACA,qCACA,qCACA,uCACA,uCACA,2BACA,mCACA,iCACA,2CAhMA,mCAPA,4BACA,uBC7EF,UACE,gBAEA,sBACE,aCCF,iBACE,aACA,sBAGF,mBACE,QAIA,+BACE,wBAIJ,2BACE,SACA,mBACA,8BAEA,kBACA,QAGF,iBACE,kBACA,QAEA,qBACE,WACA,YAEA,iBAIJ,uBACE,4BAEA,kBACA,UACA,WAGF,gBACE,iBAEA,QAGF,gBACE,aACA,eACA,iBAEA,gBAEA,gBAEA,kBACE,gBAIJ,mBACE,gBAEA,QAGF,kBClEA,YCEsB,IFmEpB,4BACE,mBAMF,wEACE,oBAGF,8NAGE,kBACA,iBAWF,8EFiBE,qBAEA,wCEZJ,sBACE,sBAEA,kBG7EF,6BHgFI,uCACE,gBACA,aAGF,iDACE,YACA,eACA,gBACA,iBAEA,cAEA,kBACA,gBAGF,wHAGE,eACA,eGnFN,wBH2FI,kHACE,iBAGF,sIACE,mBAGF,4VAGE,kBACA,kBF0MN,8BEtWF,UFiHM,yBAIA,qCEgDA,sDACE,oBAGF,qKAGE,kBACA,kBF6KN,6CAzOI,yBAIA,qCEgDA,4HACE,oBAGF,uXAGE,kBACA,iBFkLJ,+BADF,sCA7OI,yBAIA,qCEgDA,8GACE,oBAGF,6UAGE,kBACA,kBF6KN,6CAzOI,yBAIA,qCA0OF,+BADF,sCA7OI,yBAIA","file":"card.css","sourcesContent":["@use \"sass:map\";\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() {\n @each $name, $value in colour.$colour-palette-default {\n --#{$name}: #{$value};\n }\n}\n\n@mixin colour-css-vars-dark() {\n @each $name, $value in colour.$colour-palette-dark {\n --#{$name}: #{$value};\n }\n}\n\n@mixin colour-css-vars-high-contrast() {\n @each $name, $value in colour.$colour-palette-high-contrast {\n --#{$name}: #{$value};\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark() {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n --#{$name}: #{$value};\n }\n}\n\n@mixin accent-css-vars($colour) {\n @if $colour == \"yellow\" {\n --accent-background: #{brand-colour(\"yellow\")} !important;\n --accent-background-light: #{brand-colour(\"cream\")} !important;\n --accent-font-base: #{brand-colour(\"black\")} !important;\n --accent-font-dark: #{brand-colour(\"black\")} !important;\n --accent-font-light: #{brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{brand-colour(\"black\")} !important;\n --accent-link-visited: #{brand-colour(\"black\")} !important;\n --accent-keyline: #{brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"black\", 0.8)} !important;\n --button-accent-background: #{brand-colour(\"yellow\")} !important;\n } @else {\n --accent-font-base: #{brand-colour(\"white\")} !important;\n --accent-font-dark: #{brand-colour(\"white\")} !important;\n --accent-font-light: #{brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{brand-colour(\"white\")} !important;\n --accent-link-visited: #{brand-colour(\"white\")} !important;\n --accent-keyline: #{brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{brand-colour(\"white\")} !important;\n @if $colour == \"pink\" {\n --accent-background: #{brand-colour(\"maroon\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-pink\")} !important;\n --button-accent-background: #{brand-colour(\"maroon\")} !important;\n } @else if $colour == \"orange\" {\n --accent-background: #{brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-orange\")} !important;\n --button-accent-background: #{brand-colour(\"chestnut\")} !important;\n } @else if $colour == \"green\" {\n --accent-background: #{brand-colour(\"forest\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-green\")} !important;\n --button-accent-background: #{brand-colour(\"forest\")} !important;\n } @else if $colour == \"blue\" {\n --accent-background: #{brand-colour(\"navy\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-blue\")} !important;\n --button-accent-background: #{brand-colour(\"navy\")} !important;\n }\n }\n}\n\n@mixin colour-font(\n $colour,\n $important: false,\n $default-palette: colour.$colour-palette-default\n) {\n color: map.get($default-palette, $colour) if($important, !important, null);\n color: var(--#{$colour}) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n background-color: var(--#{$colour}) 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 $property: border-#{$direction};\n border-#{$direction}: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border-#{$direction}: $width\n var(--#{$colour})\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: map.get(\n colour.$colour-palette-default,\n $colour\n )\n if($important, !important, null);\n border-#{$direction}-color: var(--#{$colour})\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n border-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n border-color: var(--#{$colour}) 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 map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n outline: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n outline-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n outline-color: var(--#{$colour}) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n fill: var(--#{$colour}) if($important, !important, null);\n}\n\n%light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n%dark {\n @include colour-css-vars-dark;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast-dark;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast-dark;\n }\n}\n\n@mixin dark {\n @extend %dark;\n}\n\n%plain {\n .tna-template--system-theme & {\n @extend %light;\n\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark;\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark;\n }\n }\n\n .tna-template--light-theme & {\n @include colour-css-vars;\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast;\n }\n\n .tna-template--high-contrast-theme.tna-template--dark-theme & {\n @include colour-css-vars-high-contrast-dark;\n }\n\n --background: var(--page-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\", false, colour.$colour-palette-dark);\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\", false, colour.$colour-palette-dark);\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\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\", false, colour.$colour-palette-dark);\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%tint {\n @include colour-background(\"background-tint\");\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent-background {\n @include colour-background(\"accent-background\");\n}\n\n@mixin accent-background {\n @extend %accent-background;\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 // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\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 @include colour-background(\"background\");\n @include colour-font(\"font-base\");\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\n@mixin accent-light {\n @extend %accent-light;\n}\n\n@mixin on-high-contrast {\n .tna-template--high-contrast-theme & {\n @content;\n }\n\n .tna-template--system-theme & {\n @media (prefers-contrast: more) {\n @content;\n }\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:map\";\n@use \"../variables/spacing\";\n@use \"../tools/media\";\n\n%space-above {\n margin-top: 2rem;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above {\n @extend %space-above;\n}\n\n@function space($size) {\n @return map.get(spacing.$spacing, $size);\n}\n\n@function space-mobile($size) {\n @return map.get(spacing.$spacing-mobile, $size);\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/typography\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n\n.tna-card {\n @include spacing.space-above;\n\n &__inner {\n display: flex;\n flex-direction: column;\n }\n\n &__heading {\n order: 2;\n }\n\n &__heading-link {\n &::after {\n display: none !important;\n }\n }\n\n &__image-container {\n height: 0;\n margin-bottom: 1rem;\n padding-bottom: #{math.div(2, 3) * 100%};\n\n position: relative;\n order: 1;\n }\n\n &__image {\n position: absolute;\n inset: 0;\n\n img {\n width: 100%;\n height: 100%;\n\n object-fit: cover;\n }\n }\n\n &__image-label {\n max-width: calc(100% - 1rem);\n\n position: absolute;\n top: 0.5rem;\n left: 0.5rem;\n }\n\n &__body {\n padding-top: 1rem;\n\n order: 3;\n }\n\n &__meta {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem 1.5rem;\n\n line-height: 1.3;\n\n list-style: none;\n\n + p {\n margin-top: 1rem;\n }\n }\n\n &__actions {\n margin-top: 2rem;\n\n order: 4;\n }\n\n &__action {\n @include typography.main-font-weight-bold;\n\n .fa-solid {\n margin-right: 0.5rem;\n }\n }\n\n &--contrast,\n &--accent {\n .tna-card__inner {\n padding-bottom: 1rem;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 1rem;\n margin-left: 1rem;\n }\n }\n\n &--contrast {\n @include colour.contrast;\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 &--horizontal {\n aspect-ratio: auto 3/1;\n\n position: relative;\n\n @include media.on-larger-than-mobile {\n .tna-card__inner {\n margin-left: 50%;\n padding: 2rem;\n }\n\n .tna-card__image-container {\n height: auto;\n min-height: 50%;\n margin-bottom: 0;\n padding-bottom: 0;\n\n display: block;\n\n position: absolute;\n inset: 0 50% 0 0;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 0;\n margin-left: 0;\n }\n }\n }\n\n &--horizontal#{&}--contrast,\n &--horizontal#{&}--accent {\n @include media.on-mobile {\n .tna-card__inner {\n padding: 0 0 1rem;\n }\n\n .tna-card__image-container {\n margin-bottom: 1rem;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 1rem;\n margin-left: 1rem;\n }\n }\n }\n\n @include colour.on-high-contrast-and-forced-colours {\n @include colour.colour-border(\"keyline-dark\", 1px);\n\n &:not(#{&}--horizontal) {\n .tna-card__inner {\n padding-bottom: 1rem;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 1rem;\n margin-left: 1rem;\n }\n }\n }\n\n @include colour.on-high-contrast {\n @include colour.colour-border(\"keyline-dark\", 1px);\n }\n}\n","@use \"sass:math\";\n@use \"colour\";\n@use \"../variables/typography\";\n\n@mixin relative-font-size($fontSizePx) {\n font-size: #{math.div($fontSizePx, 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-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: #{math.div(typography.$relative-1rem-px, 14)};\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n","@use \"sass:math\";\n\n$use-local-fonts: false !default;\n\n$relative-1rem-px: 16; // 16px is always 1rem\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: #{math.div($relative-1rem-px, $body-font-size-px) * 2} !default; // 1.77777\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font: \"Open Sans\" !default;\n$main-font-family: $main-font, sans-serif !default;\n$main-font-weight: 400 !default;\n$main-font-weight-bold: 700 !default;\n\n$heading-font-family: supria-sans-condensed, \"Arial Narrow\", sans-serif !default;\n$heading-font-weight: 500 !default;\n\n$detail-font-family: \"Roboto Mono\", monospace !default;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n","@use \"../variables/media\";\n\n// 0 ======= 320 = 480 ===== 768 == 1024 ========================== min-width/max-width (px)\n// | . | | |\n// |-TINY----------|-SMALL---|-MED--|-LARGE------------------------\n// | . | | |\n// |<------------->| | | on-tiny\n// |<----------------------->| | on-mobile\n// |<------------------------------>| on-smaller-than-large\n// | . |<------->| | on-small\n// | . |<------------------------- on-larger-than-tiny\n// | . | |<---->| on-medium\n// | . | |<--------------- on-larger-than-mobile\n// | . | | |<-------- on-large\n// |<------->. | | | Smallest device\n\n@mixin on-large() {\n @media #{media.$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{media.$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{media.$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{media.$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{media.$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{media.$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{media.$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{media.$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n"]}
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/card/card.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_media.scss"],"names":[],"mappings":"AA6PA,kGACE,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEA1KA,mCAPA,4BACA,uBAqNF,kBACE,uCACA,qCACA,qCACA,uCACA,uCACA,2BACA,mCACA,iCACA,2CAxNA,mCAPA,4BACA,uBCtFF,UACE,gBAEA,sBACE,aCCF,iBACE,aACA,sBAGF,mBACE,QAIA,+BACE,wBAIJ,2BACE,SACA,mBACA,8BAEA,kBACA,QAGF,iBACE,kBACA,QAEA,qBACE,WACA,YAEA,iBAIJ,uBACE,4BAEA,kBACA,UACA,WAGF,gBACE,iBAEA,QAGF,gBACE,aACA,eACA,iBAEA,gBAEA,gBAEA,kBACE,gBAIJ,mBACE,gBAEA,QAGF,kBClEA,YCEsB,IFmEpB,4BACE,mBAMF,wEACE,oBAGF,8NAGE,kBACA,iBAWF,8EF8BE,qBAEA,wCEzBJ,sBACE,sBAEA,kBG7EF,6BHgFI,uCACE,gBACA,aAGF,iDACE,YACA,eACA,gBACA,iBAEA,cAEA,kBACA,gBAGF,wHAGE,eACA,eGnFN,wBH2FI,kHACE,iBAGF,sIACE,mBAGF,4VAGE,kBACA,kBAKN,yDACE,kBFvDE,6BAIA,yCAwRJ,8BEvYF,UF8HM,yBAIA,qCEyCA,sDACE,oBAGF,qKAGE,kBACA,kBFwMN,6CA7PI,yBAIA,qCEyCA,4HACE,oBAGF,uXAGE,kBACA,iBF6MJ,+BADF,sCAjQI,yBAIA,qCEyCA,8GACE,oBAGF,6UAGE,kBACA,kBFwMN,6CA7PI,yBAIA,qCA8PF,+BADF,sCAjQI,yBAIA","file":"card.css","sourcesContent":["@use \"sass:map\";\n@use \"sass:list\";\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 accent-css-vars($colour) {\n @if $colour == \"yellow\" {\n --accent-background: #{brand-colour(\"yellow\")} !important;\n --accent-background-light: #{brand-colour(\"cream\")} !important;\n --accent-font-base: #{brand-colour(\"black\")} !important;\n --accent-font-dark: #{brand-colour(\"black\")} !important;\n --accent-font-light: #{brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{brand-colour(\"black\")} !important;\n --accent-link-visited: #{brand-colour(\"black\")} !important;\n --accent-keyline: #{brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"black\", 0.8)} !important;\n --button-accent-background: #{brand-colour(\"yellow\")} !important;\n } @else {\n --accent-font-base: #{brand-colour(\"white\")} !important;\n --accent-font-dark: #{brand-colour(\"white\")} !important;\n --accent-font-light: #{brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{brand-colour(\"white\")} !important;\n --accent-link-visited: #{brand-colour(\"white\")} !important;\n --accent-keyline: #{brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{brand-colour(\"white\")} !important;\n @if $colour == \"pink\" {\n --accent-background: #{brand-colour(\"maroon\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-pink\")} !important;\n --button-accent-background: #{brand-colour(\"maroon\")} !important;\n } @else if $colour == \"orange\" {\n --accent-background: #{brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-orange\")} !important;\n --button-accent-background: #{brand-colour(\"chestnut\")} !important;\n } @else if $colour == \"green\" {\n --accent-background: #{brand-colour(\"forest\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-green\")} !important;\n --button-accent-background: #{brand-colour(\"forest\")} !important;\n } @else if $colour == \"blue\" {\n --accent-background: #{brand-colour(\"navy\")} !important;\n --accent-background-light: #{brand-colour(\"pastel-blue\")} !important;\n --button-accent-background: #{brand-colour(\"navy\")} !important;\n }\n }\n}\n\n@mixin colour-font(\n $colour,\n $important: false,\n $default-palette: colour.$colour-palette-default\n) {\n color: map.get($default-palette, $colour) if($important, !important, null);\n color: var(--#{$colour}) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n background-color: var(--#{$colour}) 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 $property: border-#{$direction};\n border-#{$direction}: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border-#{$direction}: $width\n var(--#{$colour})\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: map.get(\n colour.$colour-palette-default,\n $colour\n )\n if($important, !important, null);\n border-#{$direction}-color: var(--#{$colour})\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n border: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n border-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n border-color: var(--#{$colour}) 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 map.get(colour.$colour-palette-default, $colour)\n $style\n if($important, !important, null);\n outline: $width var(--#{$colour}) $style if($important, !important, null);\n } @else {\n outline-color: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n outline-color: var(--#{$colour}) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: map.get(colour.$colour-palette-default, $colour)\n if($important, !important, null);\n fill: var(--#{$colour}) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction) {\n @include colour-border(\"keyline\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-dark($direction) {\n @include colour-border(\"keyline-dark\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-accent($direction) {\n @include colour-border(\"accent-background\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-error($direction) {\n @include colour-border(\"form-error\", 5px, solid, $direction);\n}\n\n@mixin thick-keyline-brand($direction, $brandColour) {\n border-#{$direction}: 5px #{brand-colour($brandColour)} solid;\n}\n\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 .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n%dark {\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 .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n}\n\n@mixin dark {\n @extend %dark;\n}\n\n%plain {\n .tna-template--system-theme & {\n @extend %light;\n\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark;\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark;\n }\n }\n\n .tna-template--light-theme & {\n @include colour-css-vars;\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark;\n }\n\n .tna-template--high-contrast-theme & {\n @include colour-css-vars-high-contrast;\n }\n\n .tna-template--high-contrast-theme.tna-template--dark-theme & {\n @include colour-css-vars-high-contrast-dark;\n }\n\n --background: var(--page-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\", false, colour.$colour-palette-dark);\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\", false, colour.$colour-palette-dark);\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\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\", false, colour.$colour-palette-dark);\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%tint {\n @include colour-background(\"background-tint\");\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent-background {\n @include colour-background(\"accent-background\");\n}\n\n@mixin accent-background {\n @extend %accent-background;\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 // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\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 @include colour-background(\"background\");\n @include colour-font(\"font-base\");\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\n@mixin accent-light {\n @extend %accent-light;\n}\n\n@mixin on-high-contrast {\n .tna-template--high-contrast-theme & {\n @content;\n }\n\n .tna-template--system-theme & {\n @media (prefers-contrast: more) {\n @content;\n }\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:map\";\n@use \"../variables/spacing\";\n@use \"../tools/media\";\n\n%space-above {\n margin-top: 2rem;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above {\n @extend %space-above;\n}\n\n@function space($size) {\n @return map.get(spacing.$spacing, $size);\n}\n\n@function space-mobile($size) {\n @return map.get(spacing.$spacing-mobile, $size);\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{$amount} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{$amount} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/typography\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n\n.tna-card {\n @include spacing.space-above;\n\n &__inner {\n display: flex;\n flex-direction: column;\n }\n\n &__heading {\n order: 2;\n }\n\n &__heading-link {\n &::after {\n display: none !important;\n }\n }\n\n &__image-container {\n height: 0;\n margin-bottom: 1rem;\n padding-bottom: #{math.div(2, 3) * 100%};\n\n position: relative;\n order: 1;\n }\n\n &__image {\n position: absolute;\n inset: 0;\n\n img {\n width: 100%;\n height: 100%;\n\n object-fit: cover;\n }\n }\n\n &__image-label {\n max-width: calc(100% - 1rem);\n\n position: absolute;\n top: 0.5rem;\n left: 0.5rem;\n }\n\n &__body {\n padding-top: 1rem;\n\n order: 3;\n }\n\n &__meta {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem 1.5rem;\n\n line-height: 1.3;\n\n list-style: none;\n\n + p {\n margin-top: 1rem;\n }\n }\n\n &__actions {\n margin-top: 2rem;\n\n order: 4;\n }\n\n &__action {\n @include typography.main-font-weight-bold;\n\n .fa-solid {\n margin-right: 0.5rem;\n }\n }\n\n &--contrast,\n &--accent {\n .tna-card__inner {\n padding-bottom: 1rem;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 1rem;\n margin-left: 1rem;\n }\n }\n\n &--contrast {\n @include colour.contrast;\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 &--horizontal {\n aspect-ratio: auto 3/1;\n\n position: relative;\n\n @include media.on-larger-than-mobile {\n .tna-card__inner {\n margin-left: 50%;\n padding: 2rem;\n }\n\n .tna-card__image-container {\n height: auto;\n min-height: 50%;\n margin-bottom: 0;\n padding-bottom: 0;\n\n display: block;\n\n position: absolute;\n inset: 0 50% 0 0;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 0;\n margin-left: 0;\n }\n }\n }\n\n &--horizontal#{&}--contrast,\n &--horizontal#{&}--accent {\n @include media.on-mobile {\n .tna-card__inner {\n padding: 0 0 1rem;\n }\n\n .tna-card__image-container {\n margin-bottom: 1rem;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 1rem;\n margin-left: 1rem;\n }\n }\n }\n\n &__inner:has(&__heading + &__body) {\n padding-top: 0.5rem;\n\n @include colour.thick-keyline-dark(top);\n }\n\n @include colour.on-high-contrast-and-forced-colours {\n @include colour.colour-border(\"keyline-dark\", 1px);\n\n &:not(#{&}--horizontal) {\n .tna-card__inner {\n padding-bottom: 1rem;\n }\n\n .tna-card__heading,\n .tna-card__body,\n .tna-card__actions {\n margin-right: 1rem;\n margin-left: 1rem;\n }\n }\n }\n\n @include colour.on-high-contrast {\n @include colour.colour-border(\"keyline-dark\", 1px);\n }\n}\n","@use \"sass:math\";\n@use \"colour\";\n@use \"../variables/typography\";\n\n@mixin relative-font-size($fontSizePx) {\n font-size: #{math.div($fontSizePx, 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-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: #{math.div(typography.$relative-1rem-px, 14)};\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n","@use \"sass:math\";\n\n$use-local-fonts: false !default;\n\n$relative-1rem-px: 16; // 16px is always 1rem\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: #{math.div($relative-1rem-px, $body-font-size-px) * 2} !default; // 1.77777\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font: \"Open Sans\" !default;\n$main-font-family: $main-font, sans-serif !default;\n$main-font-weight: 400 !default;\n$main-font-weight-bold: 700 !default;\n\n$heading-font-family: supria-sans-condensed, \"Arial Narrow\", sans-serif !default;\n$heading-font-weight: 500 !default;\n\n$detail-font-family: \"Roboto Mono\", monospace !default;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n","@use \"../variables/media\";\n\n// 0 ======= 320 = 480 ===== 768 == 1024 ========================== min-width/max-width (px)\n// | . | | |\n// |-TINY----------|-SMALL---|-MED--|-LARGE------------------------\n// | . | | |\n// |<------------->| | | on-tiny\n// |<----------------------->| | on-mobile\n// |<------------------------------>| on-smaller-than-large\n// | . |<------->| | on-small\n// | . |<------------------------- on-larger-than-tiny\n// | . | |<---->| on-medium\n// | . | |<--------------- on-larger-than-mobile\n// | . | | |<-------- on-large\n// |<------->. | | | Smallest device\n\n@mixin on-large() {\n @media #{media.$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{media.$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{media.$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{media.$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{media.$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{media.$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{media.$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{media.$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n"]}
|
@@ -165,6 +165,12 @@
|
|
165
165
|
}
|
166
166
|
}
|
167
167
|
|
168
|
+
&__inner:has(&__heading + &__body) {
|
169
|
+
padding-top: 0.5rem;
|
170
|
+
|
171
|
+
@include colour.thick-keyline-dark(top);
|
172
|
+
}
|
173
|
+
|
168
174
|
@include colour.on-high-contrast-and-forced-colours {
|
169
175
|
@include colour.colour-border("keyline-dark", 1px);
|
170
176
|
|
@@ -209,6 +209,17 @@ Accent.args = {
|
|
209
209
|
classes: "tna-card--demo",
|
210
210
|
};
|
211
211
|
|
212
|
+
export const NoImage = Template.bind({});
|
213
|
+
NoImage.args = {
|
214
|
+
title: "Card title",
|
215
|
+
headingLevel: 3,
|
216
|
+
headingSize: "s",
|
217
|
+
href: "#",
|
218
|
+
body: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.</p>",
|
219
|
+
htmlElement: "article",
|
220
|
+
classes: "tna-card--demo",
|
221
|
+
};
|
222
|
+
|
212
223
|
export const Horizontal = Template.bind({});
|
213
224
|
Horizontal.args = {
|
214
225
|
supertitle: "Card supertitle",
|