diff --git a/packages/css/documentation/coding-conventions.md b/packages/css/documentation/coding-conventions.md index 7528788efd..944fd6a1c7 100644 --- a/packages/css/documentation/coding-conventions.md +++ b/packages/css/documentation/coding-conventions.md @@ -13,8 +13,8 @@ Still, we define its thickness and offset for the initial state. ```css .ams-link { text-decoration: none; - text-decoration-thickness: 2px; - text-underline-offset: 3px; + text-decoration-thickness: 0.125rem; + text-underline-offset: 0.1667em; &:hover { text-decoration: underline; @@ -30,8 +30,8 @@ Still, we define its thickness and offset for the initial state. &:hover { text-decoration: underline; - text-decoration-thickness: 2px; - text-underline-offset: 3px; + text-decoration-thickness: 0.125rem; + text-underline-offset: 0.1667em; } } ``` diff --git a/packages/css/src/components/card/card.scss b/packages/css/src/components/card/card.scss index 156b6f7f1c..bb9e7e11d6 100644 --- a/packages/css/src/components/card/card.scss +++ b/packages/css/src/components/card/card.scss @@ -14,7 +14,7 @@ &:has(:focus-visible) { outline-color: -webkit-focus-ring-color; outline-style: auto; - outline-width: 1px; + outline-width: 0.0625rem; } /* diff --git a/packages/css/src/components/header/header.scss b/packages/css/src/components/header/header.scss index 13789b6702..c04ef1ad5c 100644 --- a/packages/css/src/components/header/header.scss +++ b/packages/css/src/components/header/header.scss @@ -65,13 +65,13 @@ } } -// Temporary, will move to megamenu (and/or iconButton) +// Temporary – will move to Mega Menu and/or Icon Button .ams-header__menu-button { background-color: transparent; background-image: url("data:image/svg+xml;utf8,"); background-position: center right; background-repeat: no-repeat; - background-size: 19px 19px; + background-size: 1.1875rem 1.1875rem; border: 0; color: var(--ams-page-menu-item-color); font-family: var(--ams-page-menu-item-font-family); @@ -79,7 +79,7 @@ font-weight: var(--ams-page-menu-item-font-weight); line-height: var(--ams-page-menu-item-line-height); margin-block: 0; - padding-inline: 0 30px; + padding-inline: 0 1.875rem; text-align: center; touch-action: manipulation; } diff --git a/packages/css/src/components/switch/switch.scss b/packages/css/src/components/switch/switch.scss index a8195597f7..016ab1100f 100644 --- a/packages/css/src/components/switch/switch.scss +++ b/packages/css/src/components/switch/switch.scss @@ -16,13 +16,15 @@ } .ams-switch__label { + --ams-switch-track-padding: 0.0625rem; + background-color: var(--ams-switch-background-color); border-radius: calc(var(--ams-switch-thumb-width) * 2); cursor: pointer; display: inline-block; outline-offset: var(--ams-switch-outline-offset); - padding-block: 1px; - padding-inline: 1px; + padding-block: var(--ams-switch-track-padding); + padding-inline: var(--ams-switch-track-padding); transition: background-color 0.2s ease-in-out; width: var(--ams-switch-width); @@ -51,10 +53,11 @@ } .ams-switch__input:checked + .ams-switch__label::before { - // The 2px is to account for the 1px padding-inline on the label - transform: translate(calc(var(--ams-switch-width) - var(--ams-switch-thumb-width) - 2px)); + transform: translate( + calc(var(--ams-switch-width) - var(--ams-switch-thumb-width) - 2 * var(--ams-switch-track-padding)) + ); } .ams-switch:hover .ams-switch__input:enabled + .ams-switch__label::before { - box-shadow: 0 0 0 2px var(--ams-switch-thumb-hover-color); + box-shadow: var(--ams-switch-thumb-hover-box-shadow); } diff --git a/proprietary/tokens/src/common/ams/focus.tokens.json b/proprietary/tokens/src/common/ams/focus.tokens.json index a1570eb814..641da6698f 100644 --- a/proprietary/tokens/src/common/ams/focus.tokens.json +++ b/proprietary/tokens/src/common/ams/focus.tokens.json @@ -1,7 +1,7 @@ { "ams": { "focus": { - "outline-offset": { "value": "2px" } + "outline-offset": { "value": "0.125rem" } } } } diff --git a/proprietary/tokens/src/common/ams/link-appearance.tokens.json b/proprietary/tokens/src/common/ams/link-appearance.tokens.json index f24002709d..8daf5456e3 100644 --- a/proprietary/tokens/src/common/ams/link-appearance.tokens.json +++ b/proprietary/tokens/src/common/ams/link-appearance.tokens.json @@ -3,7 +3,7 @@ "link-appearance": { "color": { "value": "{ams.color.primary-blue}" }, "text-decoration-thickness": { "value": "{ams.border.width.md}" }, - "text-underline-offset": { "value": "0.375rem" }, + "text-underline-offset": { "value": "0.3333em" }, "hover": { "color": { "value": "{ams.color.dark-blue}" } }, @@ -17,7 +17,7 @@ "text-decoration-line": { "value": "underline" }, "hover": { "text-decoration-thickness": { "value": "{ams.border.width.lg}" }, - "text-underline-offset": { "value": "0.3125rem" } + "text-underline-offset": { "value": "0.2778em" } } }, "subtle": { diff --git a/proprietary/tokens/src/components/ams/switch.tokens.json b/proprietary/tokens/src/components/ams/switch.tokens.json index d058f4bcdf..2813abc8f7 100644 --- a/proprietary/tokens/src/components/ams/switch.tokens.json +++ b/proprietary/tokens/src/components/ams/switch.tokens.json @@ -1,21 +1,22 @@ { "ams": { "switch": { - "font-family": { "value": "{ams.text.font-family}" }, "background-color": { "value": "{ams.color.neutral-grey3}" }, + "font-family": { "value": "{ams.text.font-family}" }, + "outline-offset": { "value": "{ams.focus.outline-offset}" }, "width": { "value": "3.5rem" }, "thumb": { "background-color": { "value": "{ams.color.primary-white}" }, "width": { "value": "1.75rem" }, "height": { "value": "1.75rem" }, "hover": { + "box-shadow": { "value": "0 0 0 0.125rem {ams.switch.thumb.hover.color}" }, "color": { "value": "{ams.color.dark-blue}" } } }, "checked": { "background-color": { "value": "{ams.color.primary-blue}" } }, - "outline-offset": { "value": "{ams.focus.outline-offset}" }, "disabled": { "background-color": { "value": "{ams.color.neutral-grey2}" } } diff --git a/storybook/config/preview-body.html b/storybook/config/preview-body.html index 5a5f4d4cb8..9debb3fd07 100644 --- a/storybook/config/preview-body.html +++ b/storybook/config/preview-body.html @@ -10,7 +10,7 @@ .ams-docs-figure > img { display: block; max-width: 100%; - outline: 1px dashed #e8e8e8; + outline: 0.0625rem dashed #e8e8e8; } .ams-docs-figure > figcaption { @@ -46,7 +46,7 @@ } .ams-docs-card { - border: 1px solid hotpink; + border: 0.0625rem solid hotpink; display: flex; flex-direction: column; gap: 0.5rem; @@ -56,7 +56,7 @@ .ams-docs-dark-background { background-color: #004699; - margin: -16px; /* stylelint-disable-line */ - padding: 16px; /* stylelint-disable-line */ + margin: -1rem; /* stylelint-disable-line */ + padding: 1rem; /* stylelint-disable-line */ } diff --git a/storybook/config/storybook-overrides.css b/storybook/config/storybook-overrides.css index 81c6981cb9..976f5bc5aa 100644 --- a/storybook/config/storybook-overrides.css +++ b/storybook/config/storybook-overrides.css @@ -37,13 +37,13 @@ color: #004699; text-decoration: underline; text-decoration-thickness: 0.125rem; - text-underline-offset: 0.375rem; + text-underline-offset: 0.3333em; } .sbdocs-content.sbdocs-content .sbdocs-a:hover { color: #102e62; text-decoration-thickness: 0.1875rem; - text-underline-offset: 0.3125rem; + text-underline-offset: 0.2778em; } .sbdocs-content.sbdocs-content > :is(h1, h2, h3, h4, h5, h6), diff --git a/storybook/src/components/Link/Link.stories.tsx b/storybook/src/components/Link/Link.stories.tsx index 044add7c0e..3f1e6c08b2 100644 --- a/storybook/src/components/Link/Link.stories.tsx +++ b/storybook/src/components/Link/Link.stories.tsx @@ -62,7 +62,7 @@ export const onDarkBackground: Story = { }, decorators: [ (Story) => ( -
+
), @@ -75,7 +75,7 @@ export const onLightBackground: Story = { }, decorators: [ (Story) => ( -
+
), diff --git a/storybook/src/docs/components/color-palette.css b/storybook/src/docs/components/color-palette.css index ffd76821a8..6b8354b970 100644 --- a/storybook/src/docs/components/color-palette.css +++ b/storybook/src/docs/components/color-palette.css @@ -19,7 +19,7 @@ .ams-storybook-color-palette__example { aspect-ratio: 16 / 9; - border: 1px solid rgb(0 0 0 / 12.5%); + border: 0.0625rem solid rgb(0 0 0 / 12.5%); grid-area: example; }