design_system 0.7.0
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +91 -0
- data/Rakefile +47 -0
- data/app/assets/config/design_system_manifest.js +0 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/_base.scss +3 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/all.scss +7 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/_index.scss +38 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/accordion/_accordion.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/accordion/_index.scss +368 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/back-link/_back-link.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/back-link/_index.scss +81 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/breadcrumbs/_index.scss +132 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/button/_button.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/button/_index.scss +260 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/character-count/_character-count.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/character-count/_index.scss +42 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/checkboxes/_checkboxes.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/checkboxes/_index.scss +309 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/cookie-banner/_cookie-banner.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/cookie-banner/_index.scss +57 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/date-input/_date-input.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/date-input/_index.scss +26 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/details/_details.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/details/_index.scss +137 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-message/_error-message.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-message/_index.scss +12 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-summary/_error-summary.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/error-summary/_index.scss +54 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/exit-this-page/_exit-this-page.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/exit-this-page/_index.scss +90 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/fieldset/_fieldset.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/fieldset/_index.scss +67 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/file-upload/_file-upload.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/file-upload/_index.scss +216 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/footer/_footer.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/footer/_index.scss +192 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/header/_header.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/header/_index.scss +546 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/hint/_hint.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/hint/_index.scss +43 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/input/_index.scss +166 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/input/_input.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/inset-text/_index.scss +24 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/inset-text/_inset-text.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/label/_index.scss +44 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/label/_label.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/notification-banner/_index.scss +91 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/notification-banner/_notification-banner.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/pagination/_index.scss +226 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/pagination/_pagination.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/panel/_index.scss +56 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/panel/_panel.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/password-input/_index.scss +55 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/password-input/_password-input.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/phase-banner/_index.scss +34 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/phase-banner/_phase-banner.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/radios/_index.scss +326 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/radios/_radios.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/select/_index.scss +57 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/select/_select.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/service-navigation/_index.scss +252 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/service-navigation/_service-navigation.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/skip-link/_index.scss +50 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/skip-link/_skip-link.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/summary-list/_index.scss +267 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/summary-list/_summary-list.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/table/_index.scss +73 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/table/_table.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tabs/_index.scss +132 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tabs/_tabs.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tag/_index.scss +95 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/tag/_tag.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/task-list/_index.scss +77 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/task-list/_task-list.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/textarea/_index.scss +48 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/textarea/_textarea.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/warning-text/_index.scss +64 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/components/warning-text/_warning-text.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_global-styles.scss +18 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_govuk-frontend-properties.scss +13 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_links.scss +40 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_lists.scss +65 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_section-break.scss +49 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/core/_typography.scss +187 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_clearfix.scss +15 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_colour.scss +165 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_device-pixels.scss +36 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_focused.scss +57 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_font-faces.scss +39 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_grid.scss +61 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_index.scss +12 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_links.scss +389 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_media-queries.scss +80 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_shape-arrow.scss +80 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_spacing.scss +171 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_typography.scss +286 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/helpers/_visually-hidden.scss +86 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/index.scss +9 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_button-group.scss +78 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_form-group.scss +23 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_grid.scss +24 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_main-wrapper.scss +53 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_template.scss +55 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/objects/_width-container.scss +75 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_all.scss +7 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_display.scss +24 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_index.scss +5 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_spacing.scss +84 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_text-align.scss +14 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_typography.scss +40 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/overrides/_width.scss +46 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_assets.scss +82 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_colours-applied.scss +193 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_colours-organisations.scss +380 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_colours-palette.scss +35 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_global-styles.scss +13 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_index.scss +34 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_links.scss +47 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_measurements.scss +105 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_media-queries.scss +23 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_spacing.scss +76 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_typography-font.scss +50 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_typography-responsive.scss +315 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/settings/_warnings.scss +76 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_exports.scss +33 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_font-url.scss +26 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_image-url.scss +26 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_px-to-em.scss +20 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_px-to-rem.scss +20 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/tools/_rebrand.scss +63 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_clearfix.scss +5 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_index.scss +2 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/utilities/_visually-hidden.scss +9 -0
- data/app/assets/stylesheets/design_system/govuk-frontend-5.11.1/vendor/_sass-mq.scss +347 -0
- data/app/assets/stylesheets/design_system/govuk.scss +7 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/_index.scss +38 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/action-link/_action-link.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/action-link/_index.scss +73 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/back-link/_back-link.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/back-link/_index.scss +66 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/breadcrumb/_breadcrumb.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/breadcrumb/_index.scss +138 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/button/_button.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/button/_index.scss +257 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/card/_card.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/card/_index.scss +321 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/character-count/_character-count.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/character-count/_index.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/checkboxes/_checkboxes.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/checkboxes/_index.scss +155 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/contents-list/_contents-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/contents-list/_index.scss +40 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/date-input/_date-input.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/date-input/_index.scss +29 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/details/_details.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/details/_index.scss +211 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/do-dont-list/_do-dont-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/do-dont-list/_index.scss +23 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-message/_error-message.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-message/_index.scss +17 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-summary/_error-summary.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/error-summary/_index.scss +72 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/fieldset/_fieldset.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/fieldset/_index.scss +65 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/footer/_footer.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/footer/_index.scss +87 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-base.scss +495 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-organisation.scss +126 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-service.scss +60 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-transactional.scss +61 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header-white.scss +117 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_header.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/header/_index.scss +5 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hero/_hero.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hero/_index.scss +187 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hint/_hint.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/hint/_index.scss +51 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/images/_images.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/images/_index.scss +48 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/input/_index.scss +149 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/input/_input.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/inset-text/_index.scss +28 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/inset-text/_inset-text.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/label/_index.scss +53 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/label/_label.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/pagination/_index.scss +95 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/pagination/_pagination.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/panel/_index.scss +57 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/panel/_panel.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/radios/_index.scss +180 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/radios/_radios.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/select/_index.scss +44 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/select/_select.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/skip-link/_index.scss +34 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/skip-link/_skip-link.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/summary-list/_index.scss +183 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/summary-list/_summary-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tables/_index.scss +181 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tables/_tables.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tabs/_index.scss +120 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tabs/_tabs.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tag/_index.scss +92 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/tag/_tag.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/task-list/_index.scss +101 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/task-list/_task-list.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/textarea/_index.scss +30 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/textarea/_textarea.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/warning-callout/_index.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/components/warning-callout/_warning-callout.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/_index.scss +11 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/all.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_forms.scss +16 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_index.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_links.scss +42 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_page.scss +43 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/elements/_table.scss +62 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/generic/_box-sizing.scss +26 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/generic/_font-face.scss +47 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/generic/_index.scss +6 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_form-group.scss +25 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_grid.scss +23 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_index.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_main-wrapper.scss +96 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/objects/_width-container.scss +63 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_breakpoints.scss +18 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_colours.scss +188 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_globals.scss +82 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_index.scss +10 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_spacing.scss +79 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_typography.scss +176 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/settings/_warnings.scss +82 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_icons.scss +105 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_index.scss +4 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_lists.scss +115 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_section-break.scss +71 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/styles/_typography.scss +297 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_all.scss +8 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_exports.scss +47 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_focused.scss +86 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_functions.scss +45 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_grid.scss +138 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_ifff.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_index.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_links.scss +184 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_mixins.scss +520 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_sass-mq.scss +79 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_shape-arrow.scss +91 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_spacing.scss +192 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/tools/_typography.scss +259 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_clearfix.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_display.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_float.scss +15 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_grid-widths.scss +97 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_index.scss +16 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_link-nowrap.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_list-border.scss +20 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_reading-width.scss +16 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_spacing.scss +88 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_text-align.scss +19 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_typography.scss +72 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_visually-hidden.scss +20 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/utilities/_widths.scss +62 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/core/vendor/sass-mq.scss +316 -0
- data/app/assets/stylesheets/design_system/nhsuk-frontend-9.6.4/nhsuk.scss +1 -0
- data/app/assets/stylesheets/design_system/nhsuk.scss +5 -0
- data/app/controllers/concerns/design_system/branded.rb +21 -0
- data/app/helpers/css_helper.rb +13 -0
- data/app/helpers/design_system_helper.rb +113 -0
- data/app/javascript/design_system/controllers/hello_world_controller.js +7 -0
- data/app/javascript/design_system/controllers/show_password_controller.js +40 -0
- data/app/javascript/design_system/index.js +11 -0
- data/app/views/govuk/_navigation.html.erb +14 -0
- data/app/views/layouts/_alert_and_notice.html.erb +7 -0
- data/app/views/layouts/govuk/application.html.erb +196 -0
- data/app/views/layouts/govuk/full_page.html.erb +2 -0
- data/app/views/layouts/govuk/left_panel.html.erb +2 -0
- data/app/views/layouts/nhsuk/application.html.erb +132 -0
- data/app/views/layouts/nhsuk/full_page.html.erb +2 -0
- data/app/views/layouts/nhsuk/left_panel.html.erb +2 -0
- data/app/views/nhsuk/_navigation.html.erb +25 -0
- data/config/importmap.rb +4 -0
- data/config/initializers/govuk_form_builder_overrides.rb +128 -0
- data/config/routes.rb +3 -0
- data/lib/design_system/all.rb +3 -0
- data/lib/design_system/components/summary_list.rb +53 -0
- data/lib/design_system/components/tab.rb +20 -0
- data/lib/design_system/components/table.rb +68 -0
- data/lib/design_system/engine.rb +30 -0
- data/lib/design_system/generic/builders/base.rb +18 -0
- data/lib/design_system/generic/builders/button.rb +35 -0
- data/lib/design_system/generic/builders/callout.rb +28 -0
- data/lib/design_system/generic/builders/concerns/brand_derivable.rb +14 -0
- data/lib/design_system/generic/builders/elements/breadcrumbs.rb +45 -0
- data/lib/design_system/generic/builders/elements/form.rb +23 -0
- data/lib/design_system/generic/builders/elements/headings.rb +31 -0
- data/lib/design_system/generic/builders/fixed_elements.rb +38 -0
- data/lib/design_system/generic/builders/heading.rb +38 -0
- data/lib/design_system/generic/builders/link.rb +37 -0
- data/lib/design_system/generic/builders/notification.rb +43 -0
- data/lib/design_system/generic/builders/pagination_renderer.rb +85 -0
- data/lib/design_system/generic/builders/panel.rb +18 -0
- data/lib/design_system/generic/builders/summary_list.rb +84 -0
- data/lib/design_system/generic/builders/tab.rb +17 -0
- data/lib/design_system/generic/builders/table.rb +76 -0
- data/lib/design_system/generic/form_builder.rb +54 -0
- data/lib/design_system/generic.rb +15 -0
- data/lib/design_system/govuk/builders/button.rb +57 -0
- data/lib/design_system/govuk/builders/callout.rb +26 -0
- data/lib/design_system/govuk/builders/elements/breadcrumbs.rb +33 -0
- data/lib/design_system/govuk/builders/elements/headings.rb +18 -0
- data/lib/design_system/govuk/builders/fixed_elements.rb +17 -0
- data/lib/design_system/govuk/builders/heading.rb +11 -0
- data/lib/design_system/govuk/builders/link.rb +23 -0
- data/lib/design_system/govuk/builders/notification.rb +11 -0
- data/lib/design_system/govuk/builders/pagination_renderer.rb +80 -0
- data/lib/design_system/govuk/builders/panel.rb +18 -0
- data/lib/design_system/govuk/builders/summary_list.rb +44 -0
- data/lib/design_system/govuk/builders/tab.rb +56 -0
- data/lib/design_system/govuk/builders/table.rb +79 -0
- data/lib/design_system/govuk/form_builder.rb +430 -0
- data/lib/design_system/govuk.rb +19 -0
- data/lib/design_system/nhsuk/builders/button.rb +11 -0
- data/lib/design_system/nhsuk/builders/callout.rb +11 -0
- data/lib/design_system/nhsuk/builders/elements/breadcrumbs.rb +47 -0
- data/lib/design_system/nhsuk/builders/fixed_elements.rb +15 -0
- data/lib/design_system/nhsuk/builders/heading.rb +11 -0
- data/lib/design_system/nhsuk/builders/link.rb +21 -0
- data/lib/design_system/nhsuk/builders/notification.rb +17 -0
- data/lib/design_system/nhsuk/builders/pagination_renderer.rb +16 -0
- data/lib/design_system/nhsuk/builders/panel.rb +11 -0
- data/lib/design_system/nhsuk/builders/summary_list.rb +34 -0
- data/lib/design_system/nhsuk/builders/tab.rb +11 -0
- data/lib/design_system/nhsuk/builders/table.rb +68 -0
- data/lib/design_system/nhsuk/form_builder.rb +83 -0
- data/lib/design_system/nhsuk.rb +18 -0
- data/lib/design_system/registry.rb +40 -0
- data/lib/design_system/version.rb +3 -0
- data/lib/design_system.rb +7 -0
- data/lib/tasks/design_system_tasks.rake +4 -0
- data/lib/tasks/govuk.rake +122 -0
- data/lib/tasks/nhsuk.rake +108 -0
- data/public/design_system/static/design_system-0.7.0/design_system.js +1309 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/bold-affa96571d-v2.woff +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/fonts/light-f591b13f7d-v2.woff +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/govuk-frontend.min.js +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/govuk-frontend.min.js.map +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/favicon.ico +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/favicon.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-crest.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-180.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-192.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-512.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-icon-mask.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/images/govuk-opengraph-image.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/manifest.json +39 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/favicon.ico +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/favicon.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-crest.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-180.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-192.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-512.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-icon-mask.svg +1 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/images/govuk-opengraph-image.png +0 -0
- data/public/design_system/static/govuk-frontend-5.11.1/rebrand/manifest.json +39 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/apple-touch-icon-180x180.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/apple-touch-icon.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon-192x192.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.ico +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/favicon.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/largetile-310x310.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/mediumtile-144x144.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/mediumtile-150x150.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/smalltile-70x70.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/favicons/widetile-310x150.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-left.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-right-circle.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-arrow-right.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-chevron-left.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-chevron-right.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-close.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-cross.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-emdash-small.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-emdash.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-minus.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-plus.svg +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-search.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/icons/icon-tick.svg +3 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/logos/logo-nhs.svg +5 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/logos/nhs-logo.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/logos/open-graph.png +0 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/nhsuk.js +4 -0
- data/public/design_system/static/nhsuk-frontend-9.6.4/nhsuk.min.js +1 -0
- data/public/design_system/static/stimulus-3.2.2/stimulus-loading.js +87 -0
- data/public/design_system/static/tailwind-4.1.6/index.js +8 -0
- metadata +517 -0
@@ -0,0 +1,520 @@
|
|
1
|
+
@use "../settings" as *;
|
2
|
+
@use "sass-mq" as *;
|
3
|
+
@use "spacing" as *;
|
4
|
+
@use "typography" as *;
|
5
|
+
|
6
|
+
////
|
7
|
+
/// Mixins
|
8
|
+
///
|
9
|
+
/// @group tools
|
10
|
+
////
|
11
|
+
|
12
|
+
/// Clearfix mixin
|
13
|
+
///
|
14
|
+
/// @see utilities/clearfix
|
15
|
+
///
|
16
|
+
/// @example scss
|
17
|
+
/// @include nhsuk-clearfix();
|
18
|
+
///
|
19
|
+
|
20
|
+
@mixin nhsuk-clearfix() {
|
21
|
+
&::after {
|
22
|
+
clear: both;
|
23
|
+
content: "";
|
24
|
+
display: block;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
/// Clearfix mixin (deprecated)
|
29
|
+
///
|
30
|
+
/// @alias nhsuk-clearfix
|
31
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-clearfix
|
32
|
+
|
33
|
+
@mixin clearfix() {
|
34
|
+
@include nhsuk-warning("clearfix", "clearfix is deprecated. Use nhsuk-clearfix instead.");
|
35
|
+
@include nhsuk-clearfix;
|
36
|
+
}
|
37
|
+
|
38
|
+
/// Reading width mixin, add a maximum width
|
39
|
+
/// to large pieces of content
|
40
|
+
///
|
41
|
+
/// @see utilities/reading-width
|
42
|
+
///
|
43
|
+
/// @example scss
|
44
|
+
/// @include nhsuk-reading-width();
|
45
|
+
///
|
46
|
+
|
47
|
+
@mixin nhsuk-reading-width() {
|
48
|
+
max-width: 44em;
|
49
|
+
}
|
50
|
+
|
51
|
+
/// Reading width mixin, add a maximum width
|
52
|
+
/// to large pieces of content (deprecated)
|
53
|
+
///
|
54
|
+
/// @alias nhsuk-reading-width
|
55
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-reading-width
|
56
|
+
|
57
|
+
@mixin reading-width() {
|
58
|
+
@include nhsuk-warning("reading-width", "reading-width is deprecated. Use nhsuk-reading-width instead.");
|
59
|
+
@include nhsuk-reading-width;
|
60
|
+
}
|
61
|
+
|
62
|
+
/// Helper function containing the common code for the following two mixins
|
63
|
+
///
|
64
|
+
/// @link https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
65
|
+
/// - Hiding Content for Accessibility, Jonathan Snook, February 2011
|
66
|
+
/// @link https://github.com/h5bp/html5-boilerplate/blob/9f13695d21ff92c55c78dfa9f16bb02a1b6e911f/src/css/main.css#L121-L158
|
67
|
+
/// - h5bp/html5-boilerplate - Thanks!
|
68
|
+
///
|
69
|
+
/// @param {Boolean} $important [true] - Whether to mark as `!important`
|
70
|
+
///
|
71
|
+
/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)
|
72
|
+
|
73
|
+
@mixin _nhsuk-visually-hide-content($important: true) {
|
74
|
+
position: absolute if($important, !important, null);
|
75
|
+
|
76
|
+
width: 1px if($important, !important, null);
|
77
|
+
height: 1px if($important, !important, null);
|
78
|
+
// If margin is set to a negative value it can cause text to be announced in
|
79
|
+
// the wrong order in VoiceOver for OSX
|
80
|
+
margin: 0 if($important, !important, null);
|
81
|
+
padding: 0 if($important, !important, null);
|
82
|
+
|
83
|
+
overflow: hidden if($important, !important, null);
|
84
|
+
|
85
|
+
// `clip` is needed for IE11 support
|
86
|
+
clip: rect(0 0 0 0) if($important, !important, null);
|
87
|
+
clip-path: inset(50%) if($important, !important, null);
|
88
|
+
|
89
|
+
border: 0 if($important, !important, null);
|
90
|
+
|
91
|
+
// For long content, line feeds are not interpreted as spaces and small width
|
92
|
+
// causes content to wrap 1 word per line:
|
93
|
+
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
94
|
+
white-space: nowrap if($important, !important, null);
|
95
|
+
|
96
|
+
// Prevent users from selecting or copying visually-hidden text. This prevents
|
97
|
+
// a user unintentionally copying more text than they intended and needing to
|
98
|
+
// manually trim it down again.
|
99
|
+
user-select: none;
|
100
|
+
}
|
101
|
+
|
102
|
+
/// Hide an element visually, but have it available for screen readers
|
103
|
+
///
|
104
|
+
/// @see utilities/visually-hidden
|
105
|
+
///
|
106
|
+
/// @param {Boolean} $important [true] - Whether to mark as `!important`
|
107
|
+
///
|
108
|
+
/// @example scss
|
109
|
+
/// @include nhsuk-visually-hidden;
|
110
|
+
///
|
111
|
+
|
112
|
+
@mixin nhsuk-visually-hidden($important: true) {
|
113
|
+
@include _nhsuk-visually-hide-content($important: $important);
|
114
|
+
|
115
|
+
// Absolute positioning has the unintended consequence of removing any
|
116
|
+
// whitespace surrounding visually hidden text from the accessibility tree.
|
117
|
+
// Insert a space character before and after visually hidden text to separate
|
118
|
+
// it from any visible text surrounding it.
|
119
|
+
&::before {
|
120
|
+
content: "\00a0";
|
121
|
+
}
|
122
|
+
|
123
|
+
&::after {
|
124
|
+
content: "\00a0";
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
/// Hide an element visually, but have it available for screen readers
|
129
|
+
/// (deprecated)
|
130
|
+
///
|
131
|
+
/// @alias nhsuk-visually-hidden
|
132
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-visually-hidden
|
133
|
+
|
134
|
+
@mixin visually-hidden() {
|
135
|
+
@include nhsuk-visually-hidden;
|
136
|
+
}
|
137
|
+
|
138
|
+
/// Hide an element visually, but have it available for screen readers whilst
|
139
|
+
/// allowing the element to be focused when navigated to via the keyboard (e.g.
|
140
|
+
/// for the skip link)
|
141
|
+
///
|
142
|
+
/// @param {Boolean} $important [true] - Whether to mark as `!important`
|
143
|
+
///
|
144
|
+
/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)
|
145
|
+
|
146
|
+
@mixin nhsuk-visually-hidden-focusable($important: true) {
|
147
|
+
// IE 11 doesn't support the combined `:not(:active, :focus)` syntax.
|
148
|
+
&:not(:active):not(:focus) {
|
149
|
+
@include _nhsuk-visually-hide-content($important: $important);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
/// Hide an element visually, but have it available for screen readers whilst
|
154
|
+
/// allowing the element to be focused when navigated to via the keyboard (e.g.
|
155
|
+
/// for the skip link) (deprecated)
|
156
|
+
///
|
157
|
+
/// @alias nhsuk-visually-hidden-focusable
|
158
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-visually-hidden-focusable
|
159
|
+
|
160
|
+
@mixin visually-hidden-focusable($args...) {
|
161
|
+
@include nhsuk-warning(
|
162
|
+
"visually-hidden-focusable",
|
163
|
+
"visually-hidden-focusable is deprecated. Use nhsuk-visually-hidden-focusable instead."
|
164
|
+
);
|
165
|
+
@include nhsuk-visually-hidden-focusable($args...);
|
166
|
+
}
|
167
|
+
|
168
|
+
/// Show an element visually that has previously been hidden by visually-hidden
|
169
|
+
///
|
170
|
+
/// For differences between mobile and desktop views, use $display to set the CSS display property
|
171
|
+
///
|
172
|
+
/// @param {String} $display [null] - CSS display property (optional)
|
173
|
+
/// @param {Boolean} $important [true] - Whether to mark as `!important`
|
174
|
+
///
|
175
|
+
/// @deprecated To be removed in v11.0, use @media queries to apply `visually-hidden` instead
|
176
|
+
|
177
|
+
@mixin visually-shown($display: null, $important: true) {
|
178
|
+
@include nhsuk-warning(
|
179
|
+
"visually-shown",
|
180
|
+
"visually-shown is deprecated. Use @media queries to apply `visually-hidden` instead."
|
181
|
+
);
|
182
|
+
|
183
|
+
position: static if($important, !important, null);
|
184
|
+
width: auto if($important, !important, null);
|
185
|
+
height: auto if($important, !important, null);
|
186
|
+
margin: 0 if($important, !important, null);
|
187
|
+
padding: 0 if($important, !important, null);
|
188
|
+
overflow: visible if($important, !important, null);
|
189
|
+
clip: auto if($important, !important, null);
|
190
|
+
clip-path: none if($important, !important, null);
|
191
|
+
border: none if($important, !important, null);
|
192
|
+
white-space: normal if($important, !important, null);
|
193
|
+
user-select: auto if($important, !important, null);
|
194
|
+
|
195
|
+
@if $display {
|
196
|
+
display: $display;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
/// Top and bottom margin mixin, remove
|
201
|
+
/// the top and bottom margin spacing
|
202
|
+
///
|
203
|
+
/// @see utilities/top-and-bottom
|
204
|
+
///
|
205
|
+
/// @example scss
|
206
|
+
/// @include nhsuk-top-and-bottom;
|
207
|
+
///
|
208
|
+
|
209
|
+
@mixin nhsuk-top-and-bottom() {
|
210
|
+
& > *:first-child {
|
211
|
+
margin-top: 0;
|
212
|
+
}
|
213
|
+
|
214
|
+
& > *:last-child {
|
215
|
+
margin-bottom: 0;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
/// Top and bottom margin mixin, remove
|
220
|
+
/// the top and bottom margin spacing (deprecated)
|
221
|
+
///
|
222
|
+
/// @alias nhsuk-top-and-bottom
|
223
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-top-and-bottom
|
224
|
+
|
225
|
+
@mixin top-and-bottom() {
|
226
|
+
@include nhsuk-warning("top-and-bottom", "top-and-bottom is deprecated and will be removed in a future release.");
|
227
|
+
@include nhsuk-top-and-bottom;
|
228
|
+
}
|
229
|
+
|
230
|
+
/// Panel mixin
|
231
|
+
///
|
232
|
+
/// See components/_panel
|
233
|
+
///
|
234
|
+
/// @example scss
|
235
|
+
/// @include nhsuk-panel($color_nhsuk-blue, $color_nhsuk-white);
|
236
|
+
///
|
237
|
+
|
238
|
+
@mixin nhsuk-panel($panel-background-color, $panel-text-color) {
|
239
|
+
background-color: $panel-background-color;
|
240
|
+
color: $panel-text-color;
|
241
|
+
|
242
|
+
@include nhsuk-top-and-bottom;
|
243
|
+
@include nhsuk-responsive-margin(7, "bottom");
|
244
|
+
@include nhsuk-responsive-margin(7, "top");
|
245
|
+
@include nhsuk-responsive-padding(5);
|
246
|
+
|
247
|
+
@include nhsuk-media-query($media-type: print) {
|
248
|
+
border: 1px solid $nhsuk-print-text-color;
|
249
|
+
page-break-inside: avoid;
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
/// Panel mixin (deprecated)
|
254
|
+
///
|
255
|
+
/// @alias nhsuk-panel
|
256
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-panel
|
257
|
+
|
258
|
+
@mixin panel($args...) {
|
259
|
+
@include nhsuk-warning("panel", "panel is deprecated. Use nhsuk-panel instead.");
|
260
|
+
@include nhsuk-panel($args...);
|
261
|
+
}
|
262
|
+
|
263
|
+
/// Panel with label mixin, inherits panel styling
|
264
|
+
/// and removes padding top for the label positioning
|
265
|
+
///
|
266
|
+
/// Used in-conjunction with @mixin heading-label
|
267
|
+
///
|
268
|
+
/// @see components/_warning-component
|
269
|
+
///
|
270
|
+
/// @example scss
|
271
|
+
/// @include nhsuk-panel-with-label($color_nhsuk-blue, $color_nhsuk-white);
|
272
|
+
///
|
273
|
+
|
274
|
+
@mixin nhsuk-panel-with-label($panel-background-color, $panel-text-color, $panel-border-color) {
|
275
|
+
border: 1px solid $panel-border-color;
|
276
|
+
// stylelint-disable-next-line declaration-no-important
|
277
|
+
padding-top: 0 !important;
|
278
|
+
|
279
|
+
@include nhsuk-panel($panel-background-color, $panel-text-color);
|
280
|
+
}
|
281
|
+
|
282
|
+
/// Panel with label mixin, inherits panel styling
|
283
|
+
/// and removes padding top for the label positioning (deprecated)
|
284
|
+
///
|
285
|
+
/// @alias nhsuk-panel-with-label
|
286
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-panel-with-label
|
287
|
+
|
288
|
+
@mixin panel-with-label($args...) {
|
289
|
+
@include nhsuk-warning("panel-with-label", "panel-with-label is deprecated. Use nhsuk-panel-with-label instead.");
|
290
|
+
@include nhsuk-panel-with-label($args...);
|
291
|
+
}
|
292
|
+
|
293
|
+
/// Heading label mixin, adds a tab heading to
|
294
|
+
/// warning callout, do and don't lists and panel
|
295
|
+
///
|
296
|
+
/// Used in-conjunction with @mixin panel-with-label
|
297
|
+
///
|
298
|
+
/// @see components/_warning-component
|
299
|
+
///
|
300
|
+
/// 1. Background colour to be set on the @include.
|
301
|
+
/// 2. Text colour to be set on the @include.
|
302
|
+
/// 3. Display inline-block so it does not take up the full width.
|
303
|
+
/// 4. Margin -24px left and right aligns the heading to the box.
|
304
|
+
/// 5. Top positioning set to minus to make the heading
|
305
|
+
/// sit just outside the box.
|
306
|
+
///
|
307
|
+
/// @example scss
|
308
|
+
/// @include nhsuk-heading-label($color_nhsuk-blue, $color_nhsuk-white);
|
309
|
+
///
|
310
|
+
|
311
|
+
@mixin nhsuk-heading-label($heading-background-color, $heading-text-color) {
|
312
|
+
background-color: $heading-background-color; // [1]
|
313
|
+
color: $heading-text-color; // [2]
|
314
|
+
display: inline-block; // [3]
|
315
|
+
margin: nhsuk-spacing(0) nhsuk-spacing(0) nhsuk-spacing(2) -33px;
|
316
|
+
padding: nhsuk-spacing(2) nhsuk-spacing(5);
|
317
|
+
position: relative;
|
318
|
+
top: -16px; // [5]
|
319
|
+
|
320
|
+
@include nhsuk-font-size(26);
|
321
|
+
|
322
|
+
@include nhsuk-media-query($until: tablet) {
|
323
|
+
margin-left: -25px;
|
324
|
+
margin-right: 0;
|
325
|
+
padding: nhsuk-spacing(2) nhsuk-spacing(4);
|
326
|
+
top: -8px; // [5]
|
327
|
+
}
|
328
|
+
|
329
|
+
@include nhsuk-media-query($media-type: print) {
|
330
|
+
background: none;
|
331
|
+
color: $color_nhsuk-black;
|
332
|
+
top: 0;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
/// Heading label mixin, adds a tab heading to
|
337
|
+
/// warning callout, do and don't lists and panel (deprecated)
|
338
|
+
///
|
339
|
+
/// @alias nhsuk-heading-label
|
340
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-heading-label
|
341
|
+
|
342
|
+
@mixin heading-label($args...) {
|
343
|
+
@include nhsuk-warning("heading-label", "heading-label is deprecated. Use nhsuk-heading-label instead.");
|
344
|
+
@include nhsuk-heading-label($args...);
|
345
|
+
}
|
346
|
+
|
347
|
+
/// Care card mixin, used for creating
|
348
|
+
/// different coloured care cards
|
349
|
+
///
|
350
|
+
/// @see components/card/card
|
351
|
+
///
|
352
|
+
/// @example scss
|
353
|
+
/// @include nhsuk-care-card($color_nhsuk-blue, $color_nhsuk-white, 4px);
|
354
|
+
///
|
355
|
+
|
356
|
+
@mixin nhsuk-care-card($heading-background-color, $heading-text-color, $print-border-size) {
|
357
|
+
.nhsuk-card--care__heading-container {
|
358
|
+
background-color: $heading-background-color;
|
359
|
+
color: $heading-text-color;
|
360
|
+
}
|
361
|
+
|
362
|
+
@include nhsuk-media-query($media-type: print) {
|
363
|
+
border: $print-border-size solid $nhsuk-print-text-color;
|
364
|
+
color: $nhsuk-print-text-color;
|
365
|
+
page-break-inside: avoid;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
/// Care card mixin, used for creating
|
370
|
+
/// different coloured care cards (deprecated)
|
371
|
+
///
|
372
|
+
/// @alias nhsuk-care-card
|
373
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-care-card
|
374
|
+
|
375
|
+
@mixin care-card($args...) {
|
376
|
+
@include nhsuk-warning("care-card", "care-card is deprecated. Use nhsuk-care-card instead.");
|
377
|
+
@include nhsuk-care-card($args...);
|
378
|
+
}
|
379
|
+
|
380
|
+
/// Print colour mixin, sets the text print colour
|
381
|
+
/// warning callout, do and don't lists and panels
|
382
|
+
///
|
383
|
+
/// @see components/_care-card
|
384
|
+
///
|
385
|
+
/// @example scss
|
386
|
+
/// @include nhsuk-print-color($nhsuk-print-text-color);
|
387
|
+
///
|
388
|
+
|
389
|
+
@mixin nhsuk-print-color($print-color) {
|
390
|
+
@include nhsuk-media-query($media-type: print) {
|
391
|
+
color: $print-color;
|
392
|
+
fill: $print-color;
|
393
|
+
|
394
|
+
&:active,
|
395
|
+
&:focus,
|
396
|
+
&:visited {
|
397
|
+
color: $nhsuk-print-text-color;
|
398
|
+
}
|
399
|
+
}
|
400
|
+
}
|
401
|
+
|
402
|
+
/// Print colour mixin, sets the text print colour
|
403
|
+
/// warning callout, do and don't lists and panels (deprecated)
|
404
|
+
///
|
405
|
+
/// @alias nhsuk-print-color
|
406
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-print-color
|
407
|
+
|
408
|
+
@mixin print-color($args...) {
|
409
|
+
@include nhsuk-warning("print-color", "print-color is deprecated. Use nhsuk-print-color instead.");
|
410
|
+
@include nhsuk-print-color($args...);
|
411
|
+
}
|
412
|
+
|
413
|
+
/// Print hide mixin, hides the element from print
|
414
|
+
///
|
415
|
+
/// @example scss
|
416
|
+
/// @include nhsuk-print-hide();
|
417
|
+
///
|
418
|
+
|
419
|
+
@mixin nhsuk-print-hide() {
|
420
|
+
@include nhsuk-media-query($media-type: print) {
|
421
|
+
display: none;
|
422
|
+
}
|
423
|
+
}
|
424
|
+
|
425
|
+
/// Print hide mixin, hides the element from print (deprecated)
|
426
|
+
///
|
427
|
+
/// @alias nhsuk-print-hide
|
428
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-print-hide
|
429
|
+
|
430
|
+
@mixin print-hide($args...) {
|
431
|
+
@include nhsuk-warning("print-hide", "print-hide is deprecated. Use nhsuk-print-hide instead.");
|
432
|
+
@include nhsuk-print-hide($args...);
|
433
|
+
}
|
434
|
+
|
435
|
+
/// Flex mixin
|
436
|
+
///
|
437
|
+
/// @example scss
|
438
|
+
/// @include nhsuk-flex;
|
439
|
+
///
|
440
|
+
|
441
|
+
@mixin nhsuk-flex() {
|
442
|
+
display: flex;
|
443
|
+
flex-wrap: wrap;
|
444
|
+
}
|
445
|
+
|
446
|
+
// Flex mixin (deprecated)
|
447
|
+
///
|
448
|
+
/// @alias nhsuk-flex
|
449
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-flex
|
450
|
+
|
451
|
+
@mixin flex($args...) {
|
452
|
+
@include nhsuk-warning("flex", "flex is deprecated. Use nhsuk-flex instead.");
|
453
|
+
@include nhsuk-flex($args...);
|
454
|
+
}
|
455
|
+
|
456
|
+
/// Flex item mixin
|
457
|
+
///
|
458
|
+
/// @example scss
|
459
|
+
/// @include nhsuk-flex-item;
|
460
|
+
///
|
461
|
+
|
462
|
+
@mixin nhsuk-flex-item() {
|
463
|
+
display: flex;
|
464
|
+
|
465
|
+
@include nhsuk-media-query($until: desktop) {
|
466
|
+
flex: 0 0 100%;
|
467
|
+
}
|
468
|
+
}
|
469
|
+
|
470
|
+
// Flex item mixin (deprecated)
|
471
|
+
///
|
472
|
+
/// @alias nhsuk-flex-item
|
473
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-flex-item
|
474
|
+
|
475
|
+
@mixin flex-item($args...) {
|
476
|
+
@include nhsuk-warning("flex-item", "flex-item is deprecated. Use nhsuk-flex-item instead.");
|
477
|
+
@include nhsuk-flex-item($args...);
|
478
|
+
}
|
479
|
+
|
480
|
+
/// Remove margin mobile mixin
|
481
|
+
///
|
482
|
+
/// Removes left and right margin at tablet breakpoint
|
483
|
+
|
484
|
+
@mixin nhsuk-remove-margin-mobile() {
|
485
|
+
@include nhsuk-media-query($until: tablet) {
|
486
|
+
margin-left: -$nhsuk-gutter-half;
|
487
|
+
margin-right: -$nhsuk-gutter-half;
|
488
|
+
}
|
489
|
+
}
|
490
|
+
|
491
|
+
/// Remove margin mobile mixin (deprecated)
|
492
|
+
///
|
493
|
+
/// Removes left and right margin at tablet breakpoint
|
494
|
+
///
|
495
|
+
/// @alias nhsuk-remove-margin-mobile
|
496
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-remove-margin-mobile
|
497
|
+
|
498
|
+
@mixin remove-margin-mobile() {
|
499
|
+
@include nhsuk-warning(
|
500
|
+
"remove-margin-mobile",
|
501
|
+
"remove-margin-mobile is deprecated. Use nhsuk-remove-margin-mobile instead."
|
502
|
+
);
|
503
|
+
|
504
|
+
@include nhsuk-remove-margin-mobile;
|
505
|
+
}
|
506
|
+
|
507
|
+
/// NHS logo size helper
|
508
|
+
///
|
509
|
+
/// Saves duplicating the code for when using the logo as a link.
|
510
|
+
/// Used in the header and footer.
|
511
|
+
|
512
|
+
@mixin nhsuk-logo-size {
|
513
|
+
height: 40px;
|
514
|
+
width: 100px;
|
515
|
+
}
|
516
|
+
|
517
|
+
@mixin nhsuk-logo-size-small {
|
518
|
+
height: 32px;
|
519
|
+
width: 80px;
|
520
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
@use "sass:list";
|
2
|
+
@use "sass:map";
|
3
|
+
@use "sass:meta";
|
4
|
+
@use "../settings" as *;
|
5
|
+
@use "../vendor/sass-mq" as * with (
|
6
|
+
$mq-breakpoints: $nhsuk-breakpoints,
|
7
|
+
$mq-show-breakpoints: if(
|
8
|
+
meta.variable-exists(nhsuk-show-breakpoints) and $nhsuk-show-breakpoints,
|
9
|
+
map.keys($nhsuk-breakpoints),
|
10
|
+
()
|
11
|
+
)
|
12
|
+
);
|
13
|
+
|
14
|
+
////
|
15
|
+
/// Wrangle sass-mq config...
|
16
|
+
///
|
17
|
+
/// @group tools
|
18
|
+
////
|
19
|
+
|
20
|
+
@forward "../vendor/sass-mq";
|
21
|
+
|
22
|
+
/// Helpers
|
23
|
+
|
24
|
+
/// Media query
|
25
|
+
///
|
26
|
+
/// This is a currently a wrapper for sass-mq - abstracted so that we can
|
27
|
+
/// replace it in the future if we so choose.
|
28
|
+
///
|
29
|
+
/// @param {String | Boolean} $from [false] - One of $nhsuk-breakpoints
|
30
|
+
/// @param {String | Boolean} $until [false] - One of $nhsuk-breakpoints
|
31
|
+
/// @param {String | Boolean} $and [false] - Additional media query parameters
|
32
|
+
/// @param {String} $media-type [all] - Media type: screen, print…
|
33
|
+
///
|
34
|
+
/// @ignore Undocumented mq API, for advanced use only:
|
35
|
+
/// @ignore @param {Map} $breakpoints [$nhsuk-breakpoints]
|
36
|
+
///
|
37
|
+
/// @content styling rules, wrapped into a @media query when $responsive is true
|
38
|
+
///
|
39
|
+
/// @example scss
|
40
|
+
/// .element {
|
41
|
+
/// @include nhsuk-media-query($from: mobile) {
|
42
|
+
/// color: red;
|
43
|
+
/// }
|
44
|
+
/// @include nhsuk-media-query($until: tablet) {
|
45
|
+
/// color: blue;
|
46
|
+
/// }
|
47
|
+
/// @include nhsuk-media-query(mobile, tablet) {
|
48
|
+
/// color: green;
|
49
|
+
/// }
|
50
|
+
/// @include nhsuk-media-query($from: tablet, $and: '(orientation: landscape)') {
|
51
|
+
/// color: teal;
|
52
|
+
/// }
|
53
|
+
/// @include nhsuk-media-query(950px) {
|
54
|
+
/// color: hotpink;
|
55
|
+
/// }
|
56
|
+
/// @include nhsuk-media-query(tablet, $media-type: screen) {
|
57
|
+
/// color: hotpink;
|
58
|
+
/// }
|
59
|
+
/// }
|
60
|
+
///
|
61
|
+
/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)
|
62
|
+
|
63
|
+
@mixin nhsuk-media-query($args...) {
|
64
|
+
@include mq($args..., $silence-warning: true) {
|
65
|
+
@content;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
/// Media query (deprecated)
|
70
|
+
///
|
71
|
+
/// @alias nhsuk-media-query
|
72
|
+
/// @deprecated To be removed in v11.0, replaced by nhsuk-media-query
|
73
|
+
|
74
|
+
@mixin govuk-media-query($args...) {
|
75
|
+
@include nhsuk-warning("govuk-media-query", "govuk-media-query is deprecated. Use nhsuk-media-query instead.");
|
76
|
+
@include nhsuk-media-query($args...) {
|
77
|
+
@content;
|
78
|
+
}
|
79
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
@use "../settings/warnings" as *;
|
3
|
+
|
4
|
+
////
|
5
|
+
/// Shape arrow
|
6
|
+
///
|
7
|
+
/// @group tools
|
8
|
+
////
|
9
|
+
|
10
|
+
/// Calculate the height of an equilateral triangle
|
11
|
+
/// Multiplying half the length of the base of an equilateral triangle by the
|
12
|
+
/// square root of three gives us its height. We use 1.732 as an approximation.
|
13
|
+
///
|
14
|
+
/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)
|
15
|
+
///
|
16
|
+
/// @param {Number} $base - Length of the base of the triangle
|
17
|
+
/// @return {Number} Calculated height of the triangle
|
18
|
+
|
19
|
+
@function _nhsuk-equilateral-height($base) {
|
20
|
+
$square-root-of-three: 1.732;
|
21
|
+
|
22
|
+
@return math.div($base, 2) * $square-root-of-three;
|
23
|
+
}
|
24
|
+
|
25
|
+
/// Arrow mixin
|
26
|
+
///
|
27
|
+
/// Generate Arrows (triangles) by using a mix of transparent (1) and coloured
|
28
|
+
/// borders. The coloured borders inherit the text colour of the element (2).
|
29
|
+
///
|
30
|
+
/// Ensure the arrow is rendered correctly if browser colours are overridden by
|
31
|
+
/// providing a clip path (3). Without this the transparent borders are
|
32
|
+
/// overridden to become visible which results in a square.
|
33
|
+
///
|
34
|
+
/// We need both because older browsers do not support clip-path.
|
35
|
+
///
|
36
|
+
/// @param {String} $direction - Direction for arrow: up, right, down, left.
|
37
|
+
/// @param {Number} $base - Length of the triangle 'base' side
|
38
|
+
/// @param {Number} $height [null] - Height of triangle. Omit for equilateral.
|
39
|
+
/// @param {String} $display [block] - CSS display property of the arrow
|
40
|
+
///
|
41
|
+
/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)
|
42
|
+
|
43
|
+
@mixin nhsuk-shape-arrow($direction, $base, $height: null, $display: block) {
|
44
|
+
display: $display;
|
45
|
+
|
46
|
+
width: 0;
|
47
|
+
height: 0;
|
48
|
+
|
49
|
+
border-style: solid;
|
50
|
+
border-color: transparent; // 1
|
51
|
+
|
52
|
+
$perpendicular: math.div($base, 2);
|
53
|
+
|
54
|
+
@if not $height {
|
55
|
+
$height: _nhsuk-equilateral-height($base);
|
56
|
+
}
|
57
|
+
|
58
|
+
@if $direction == "up" {
|
59
|
+
clip-path: polygon(50% 0%, 0% 100%, 100% 100%); // 3
|
60
|
+
|
61
|
+
border-width: 0 $perpendicular $height;
|
62
|
+
border-bottom-color: inherit; // 2
|
63
|
+
} @else if $direction == "right" {
|
64
|
+
clip-path: polygon(0% 0%, 100% 50%, 0% 100%); // 3
|
65
|
+
|
66
|
+
border-width: $perpendicular 0 $perpendicular $height;
|
67
|
+
border-left-color: inherit; // 2
|
68
|
+
} @else if $direction == "down" {
|
69
|
+
clip-path: polygon(0% 0%, 50% 100%, 100% 0%); // 3
|
70
|
+
|
71
|
+
border-width: $height $perpendicular 0 $perpendicular;
|
72
|
+
border-top-color: inherit; // 2
|
73
|
+
} @else if $direction == "left" {
|
74
|
+
clip-path: polygon(0% 50%, 100% 100%, 100% 0%); // 3
|
75
|
+
|
76
|
+
border-width: $perpendicular $height $perpendicular 0;
|
77
|
+
border-right-color: inherit; // 2
|
78
|
+
} @else {
|
79
|
+
@error "Invalid arrow direction: expected `up`, `right`, `down` or `left`, got `#{$direction}`";
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
/// Arrow mixin (deprecated)
|
84
|
+
///
|
85
|
+
/// @alias nhsuk-shape-arrow
|
86
|
+
/// @deprecated To be removed in v10.0, replaced by nhsuk-shape-arrow
|
87
|
+
|
88
|
+
@mixin govuk-shape-arrow($args...) {
|
89
|
+
@include nhsuk-warning("govuk-shape-arrow", "govuk-shape-arrow is deprecated. Use nhsuk-shape-arrow instead.");
|
90
|
+
@include nhsuk-shape-arrow($args...);
|
91
|
+
}
|