diff --git a/assets-src/styles/advanced.scss b/assets-src/styles/advanced.scss index 0f1b42a0..a1e2e27a 100755 --- a/assets-src/styles/advanced.scss +++ b/assets-src/styles/advanced.scss @@ -23,7 +23,6 @@ /*------------------------------------*\ #Mixins \*------------------------------------*/ -@import "sass/20-mixins/font-sizes"; @import "sass/20-mixins/media-query"; @import "sass/20-mixins/stack"; diff --git a/assets-src/styles/core.scss b/assets-src/styles/core.scss index b83fa6d1..47c9e363 100755 --- a/assets-src/styles/core.scss +++ b/assets-src/styles/core.scss @@ -9,6 +9,7 @@ @import "sass/00-settings/colors"; //@import "sass/00-settings/debug"; @import "sass/00-settings/fonts"; +@import "sass/00-settings/font-sizes"; @import "sass/00-settings/typesetting"; @@ -24,7 +25,6 @@ /*------------------------------------*\ #Mixins \*------------------------------------*/ -@import "sass/20-mixins/font-sizes"; @import "sass/20-mixins/media-query"; @import "sass/20-mixins/stack"; @@ -32,21 +32,17 @@ /*------------------------------------*\ #Base - - Normalize comes first for the cascade \*------------------------------------*/ -@import "../../node_modules/normalize.css/normalize"; +@import "sass/30-base/global-reset"; @import "sass/30-base/animation"; @import "sass/30-base/quotes"; @import "sass/30-base/body"; -@import "sass/30-base/box-sizing"; @import "sass/30-base/buttons"; @import "sass/30-base/focus"; @import "sass/30-base/forms"; @import "sass/30-base/hide-and-show"; @import "sass/30-base/html-elements"; @import "sass/30-base/icons"; -@import "sass/30-base/images"; @import "sass/30-base/links"; @import "sass/30-base/lists"; @import "sass/30-base/skip-link"; @@ -73,6 +69,8 @@ /*------------------------------------*\ #Core components \*------------------------------------*/ +@import "sass/50-core-components/component"; +@import "sass/50-core-components/avatars"; @import "sass/50-core-components/header"; @import "sass/50-core-components/archive-banner"; @import "sass/50-core-components/logo"; diff --git a/assets-src/styles/sass/00-settings/_font-sizes.scss b/assets-src/styles/sass/00-settings/_font-sizes.scss new file mode 100644 index 00000000..86eaec89 --- /dev/null +++ b/assets-src/styles/sass/00-settings/_font-sizes.scss @@ -0,0 +1,20 @@ +/*------------------------------------*\ + #Font sizes + + Fluid type calculations generated using Utopia: + https://utopia.fyi/type/calculator/?c=320,16,1.125,1120,18,1.125,7,1,&s=0.75%7C0.5%7C0.25,1.5%7C2%7C3%7C4%7C6,s-l&g=s,l,xl,12 + + CSS custom property names have been adapted from Utopia, add namespacing, give explicit usage context and use kebab case. +\*------------------------------------*/ + +:root { + --w3c-text-01: clamp(0.8889rem, 0.8444rem + 0.2222vw, 1rem); + --w3c-text-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); + --w3c-text-1: clamp(1.125rem, 1.0688rem + 0.2813vw, 1.2656rem); + --w3c-text-2: clamp(1.2656rem, 1.2023rem + 0.3164vw, 1.4238rem); + --w3c-text-3: clamp(1.4238rem, 1.3526rem + 0.356vw, 1.6018rem); + --w3c-text-4: clamp(1.6018rem, 1.5217rem + 0.4005vw, 1.802rem); + --w3c-text-5: clamp(1.802rem, 1.7119rem + 0.4505vw, 2.0273rem); + --w3c-text-6: clamp(2.0273rem, 1.9259rem + 0.5068vw, 2.2807rem); + --w3c-text-7: clamp(2.2807rem, 2.1667rem + 0.5702vw, 2.5658rem); +} \ No newline at end of file diff --git a/assets-src/styles/sass/30-base/_body.scss b/assets-src/styles/sass/30-base/_body.scss index ad7def8f..57750f1d 100644 --- a/assets-src/styles/sass/30-base/_body.scss +++ b/assets-src/styles/sass/30-base/_body.scss @@ -2,21 +2,13 @@ #Body \*------------------------------------*/ - -html { - height: 100%; -} - /** - Typographical styles for fonts are in 40-base/_typography.scss + Typographical styles for fonts are in 30-base/_typography.scss */ body { background-color: $white; color: $off-black; - min-height: 100%; overflow-x: hidden; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; } /** @@ -26,5 +18,5 @@ Styles needed for a sticky footer display: grid; grid-template-columns: 100%; grid-template-rows: 1fr auto; - min-height: 100vh; + min-block-size: 100vh; } \ No newline at end of file diff --git a/assets-src/styles/sass/30-base/_box-sizing.scss b/assets-src/styles/sass/30-base/_box-sizing.scss deleted file mode 100644 index 4665397c..00000000 --- a/assets-src/styles/sass/30-base/_box-sizing.scss +++ /dev/null @@ -1,13 +0,0 @@ -/*------------------------------------*\ - #Box sizing -\*------------------------------------*/ - -*, -*::before, -*::after { - box-sizing: border-box; - font-family: inherit; - margin: 0; - overflow-wrap: break-word; - padding: 0; -} \ No newline at end of file diff --git a/assets-src/styles/sass/30-base/_buttons.scss b/assets-src/styles/sass/30-base/_buttons.scss index 356b1938..4faa72c9 100755 --- a/assets-src/styles/sass/30-base/_buttons.scss +++ b/assets-src/styles/sass/30-base/_buttons.scss @@ -1,7 +1,9 @@ /*------------------------------------*\ #Buttons - 1. High contrast themes tend to eliminate background-color. + 1. Prevent `.button` going full-width if a child of a flex column. + + 2. High contrast themes tend to eliminate background-color. With no border set, we need to apply a transparent outline to maintain the button shape. The negative outline-offset moves the outline inside the perimeter so it behaves like a border. @@ -9,16 +11,18 @@ button, .button { + align-items: center; + align-self: start; /* 1 */ background-color: $link-color; border: solid 2px $link-color; border-radius: rem(24); color: $white; - display: inline-block; - font-size: rem(14); + display: inline-flex; + font-size: var(--w3c-text-01); font-weight: $emphasis; - line-height: 1.5; - outline: 2px solid transparent; /* 1 */ - outline-offset: -2px; /* 1 */ + justify-content: center; + outline: 2px solid transparent; /* 2 */ + outline-offset: -2px; /* 2 */ padding: rem(11) rem(24); &:hover { @@ -34,10 +38,6 @@ button, } } -button:not([type="submit"]) { - text-align: start; -} - /** Remove link styling from links styled as buttons. @@ -47,19 +47,9 @@ Remove link styling from links styled as buttons. } -/** -Remove link styling from actual buttons styled as buttons. - */ -button.button, -input[type="submit"].button { - text-decoration: none; -} - - // Full-width buttons -.button--wide { - text-align: center; - width: 100%; +.button--wide.button--wide { + inline-size: 100%; } @@ -102,6 +92,7 @@ input[type="submit"].button { // Disabled buttons .button[disabled], +.button[disabled], .button.js-disabled { background-color: $twiki-gray; border-color: $twiki-gray; diff --git a/assets-src/styles/sass/30-base/_details-and-summary.scss b/assets-src/styles/sass/30-base/_details-and-summary.scss index a586a6c9..d6d5cf94 100644 --- a/assets-src/styles/sass/30-base/_details-and-summary.scss +++ b/assets-src/styles/sass/30-base/_details-and-summary.scss @@ -6,24 +6,23 @@ summary { color: $link-color; cursor: pointer; display: inline-block; - padding-left: rem(25); + padding-block: rem(10); + padding-inline-start: rem(25); position: relative; &::before { - border-color: transparent; - border-left-color: inherit; - border-style: solid; - border-width: 7px 0 7px 12.124px; - bottom: 0; - clip-path: polygon(0% 0%, 100% 50%, 0% 100%); - content: ''; - display: block; - height: 0; - left: 0; - margin: auto; - position: absolute; - top: rem(-1); - width: 0; + block-size: 0; + border-color: transparent; + border-inline-start-color: inherit; + border-style: solid; + border-width: 7px 0 7px 12.124px; + content: ''; + display: block; + inline-size: 0; + inset-block: rem(-1) 0; + inset-inline-start: 0; + margin: auto; + position: absolute; } &::-webkit-details-marker { @@ -36,11 +35,7 @@ summary { span { display: inline-block; - padding-bottom: rem(10); - padding-top: rem(10); - text-decoration: underline; /* 1 */ - text-decoration-skip-ink: auto; // Not supported by Safari - text-underline-offset: 0.25em; // Supported by Safari + text-decoration: underline; } &:focus { @@ -55,28 +50,24 @@ summary { } -details { - margin-bottom: 1rem; - margin-top: 1rem; -} +// details { +// margin-bottom: 1rem; +// margin-top: 1rem; +// } + +// details[open] > summary { +// margin-bottom: 1rem; +// } -details[open] > summary { - margin-bottom: 1rem; +[dir="rtl"] summary::before { + border-width: 7px 12.124px 7px 0; } + details[open] > summary::before { - transform: rotate(90deg); + transform: rotate(90deg); } -[dir="rtl"] { - summary { - padding-left: 0; - padding-right: rem(25); - - &::before { - left: auto; - right: 0; - transform: rotate(180deg); - } - } +[dir="rtl"] details[open] > summary::before { + transform: rotate(-90deg); } \ No newline at end of file diff --git a/assets-src/styles/sass/30-base/_focus.scss b/assets-src/styles/sass/30-base/_focus.scss index 5b61b38e..8b677133 100644 --- a/assets-src/styles/sass/30-base/_focus.scss +++ b/assets-src/styles/sass/30-base/_focus.scss @@ -13,8 +13,8 @@ } /** -Where focus is moved to the target via JavaScript, it is -acceptable not to show a focus outline. +Where focus is programmatically moved to a target element that is not interactive, we +suppress the focus styles. See https://github.com/twbs/bootstrap/issues/29875#issuecomment-582648069 */ main:focus, #main:focus, diff --git a/assets-src/styles/sass/30-base/_forms.scss b/assets-src/styles/sass/30-base/_forms.scss index c102ab8a..51cd96a4 100755 --- a/assets-src/styles/sass/30-base/_forms.scss +++ b/assets-src/styles/sass/30-base/_forms.scss @@ -11,7 +11,7 @@ fieldset { // If you want a border etc., apply this to a wrapping container for the fieldset border: 0; margin: 0; - min-width: 0; + min-inline-size: 0; padding: 0.01em 0 0 0; } @@ -23,17 +23,14 @@ End of resets for the fieldset element */ -//.field-group__heading {} +// .field-group + .field-group { +// margin-block-start: 2.5rem; +// } - -.field-group + .field-group { - margin-top: 2.5rem; -} - -form > * + *, -.field-group > * + * { - margin-top: 1.75rem; -} +// form > * + *, +// .field-group > * + * { +// margin-block-start: 1.75rem; +// } /** Group inputs to line up side-by-side @@ -44,25 +41,17 @@ Group inputs to line up side-by-side } .input-group > * + * { - margin-left: rem(30); -} - -[dir="rtl"] { - .input-group > * + * { - - margin-left: 0; - margin-right: rem(30); - - } + margin-inline-start: rem(30); } .field-legend { - @include txt-saturn; + //@include txt-saturn; + font-size: var(--w3c-text-1); font-weight: bold; } .field { - max-width: rem($text-measure); + max-inline-size: rem($text-measure); } label, @@ -73,25 +62,26 @@ label, display: block; } -.field-label, -.faux-label { - margin-bottom: 0.25rem; -} +// .field-label, +// .faux-label { +// margin-block-end: 0.25rem; +// } .field-label, .group-legend { font-weight: bold; - + .field-hint { - margin-top: 0.25rem; - } + // + .field-hint { + // margin-block-start: 0.25rem; + // } } .field-hint { - @include txt-pluto; + //@include txt-pluto; + font-size: var(--w3c-text-01); color: $storm-gray; - margin-bottom: 0.25rem; - max-width: rem($text-measure); + // margin-block-end: 0.25rem; + max-inline-size: rem($text-measure); } .required { @@ -114,9 +104,9 @@ textarea, -webkit-appearance: none; border: 2px solid; border-radius: 0; - line-height: 1.25; + inline-size: 100%; + //line-height: 1.25; padding: rem(5); - width: 100%; &:focus { box-shadow: inset 0 0 0 2px; @@ -144,11 +134,9 @@ select, &:focus { border-color: currentColor; box-shadow: inset 0 0 0 4px; - margin-left: rem(-5); - margin-right: rem(-5); + margin-inline: rem(-5); outline: 3px solid $focus-color; - padding-left: rem(5); - padding-right: rem(5); + padding-inline: rem(5); } } @@ -169,9 +157,9 @@ select { background-color: transparent; border: 2px solid; border-radius: 0; - line-height: 1.25; + inline-size: 100%; + //line-height: 1.25; padding: rem(5); - width: 100%; &:focus { box-shadow: inset 0 0 0 2px; @@ -213,18 +201,11 @@ Memorable dates (e.g. date of birth) */ .memorable-date { display: inline-block; - margin-top: 0; + margin-block-start: 0; } .memorable-date + .memorable-date { - margin-left: 1rem; -} - -[dir="rtl"] { - .memorable-date + .memorable-date { - margin-left: auto; - margin-right: 1rem; - } + margin-inline-start: 1rem; } @@ -235,8 +216,8 @@ Radio/checkbox inputs .checkbox-item { clear: left; float: left; - margin-top: 0.25rem; - padding-left: rem(34); + margin-block-start: 0.25rem; + padding-inline-start: rem(34); position: relative; &::after { @@ -251,38 +232,27 @@ Radio/checkbox inputs .checkbox-item { clear: right; float: right; - padding-left: 0; - padding-right: rem(34); } } .radio-item input, .checkbox-item input { + block-size: rem(44); cursor: pointer; - height: rem(44); - left: rem(-10); + inline-size: rem(44); + inset-block-start: rem(-2); + inset-inline-start: rem(-10); margin: 0; opacity: 0; position: absolute; - top: rem(-2); - width: rem(44); z-index: 1; } -[dir="rtl"] { - .radio-item input, - .checkbox-item input { - left: auto; - right: rem(-10); - } -} - .radio-item label, .checkbox-item label { cursor: pointer; display: inline-block; - margin-bottom: 0; - margin-top: rem(-2); + margin-block: rem(-2) 0; padding: rem(11) rem(15) rem(10) rem(1); touch-action: manipulation; @@ -294,11 +264,11 @@ Radio/checkbox inputs &::before { background: transparent; + block-size: rem(24); border: 2px solid; - height: rem(24); - left: 0; - top: rem(8); - width: rem(24); + inline-size: rem(24); + inset-block-start: rem(8); + inset-inline-start: 0; } } @@ -306,11 +276,6 @@ Radio/checkbox inputs .radio-item label, .checkbox-item label { padding: rem(11) rem(1) rem(10) rem(15); - - &::before { - left: auto; - right: 0; - } } } @@ -322,47 +287,33 @@ Radio/checkbox inputs &::after { background: currentColor; + block-size: 0; border: 5px solid; - height: 0; - left: rem(7); + inline-size: 0; + inset-block-start: rem(15); + inset-inline-start: rem(7); opacity: 0; - top: rem(15); - width: 0; - } -} - -[dir="rtl"] { - .radio-item label::after { - left: auto; - right: rem(7); } } .checkbox-item label { &::after { background: transparent; + block-size: rem(6.5); border: solid; - border-top-color: transparent; + border-block-start-color: transparent; border-width: 0 0 3px 3px; - height: rem(6.5); - left: rem(6); + inline-size: rem(12); + inset-block-start: rem(15); + inset-inline-start: rem(6); opacity: 0; - top: rem(15); transform: rotate(-45deg); - width: rem(12); - } -} - -[dir="rtl"] { - .checkbox-item label::after { - left: auto; - right: rem(6); } } .checkbox-group--cluster .checkbox-item { clear: none; - margin-right: rem(12); + margin-block-end: rem(12); } // Radio/checkbox input with hover @@ -417,15 +368,15 @@ Segmented options. Can use either radio or checkbox inputs. The purpose is to show all available options outright, rather than hide them behind a &::before { background: transparent; - height: rem(24); - left: rem(10); - top: rem(10); - width: rem(24); + block-size: rem(24); + inline-size: rem(24); + inset-block-start: rem(10); + inset-inline-start: rem(10); } &::after { background: transparent; + block-size: rem(6.5); border: solid; - border-top-color: transparent; + border-block-start-color: transparent; border-width: 0 0 3px 3px; - height: rem(6.5); - left: rem(16); + inline-size: rem(12); + inset-block-start: rem(17); + inset-inline-start: rem(16); opacity: 0; - top: rem(17); transform: rotate(-45deg); - width: rem(12); } } input { cursor: pointer; - height: rem(44); + block-size: rem(44); + inline-size: rem(44); + inset-block-start: 0; + inset-inline-end: 0; margin: 0; opacity: 0; position: absolute; - right: 0; - top: 0; - width: rem(44); z-index: 1; } .segmented-label { - @include stack(.5em); + //@include stack(.5em); display: block; padding: rem(10); - padding-left: rem(44); + padding-inline-start: rem(44); span { display: block; @@ -510,60 +461,36 @@ show all available options outright, rather than hide them behind a