From 1f29f358ab7b831c502e8fa2cbd284d1853ff6af Mon Sep 17 00:00:00 2001 From: Aram <37216945+alimpens@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:08:45 +0200 Subject: [PATCH] feat: Add border to Avatar in forced colors mode (#1578) --- packages/css/src/components/avatar/avatar.scss | 9 +++++++++ proprietary/tokens/src/components/ams/avatar.tokens.json | 3 +++ 2 files changed, 12 insertions(+) diff --git a/packages/css/src/components/avatar/avatar.scss b/packages/css/src/components/avatar/avatar.scss index 36b17f68a1..eb5f47e9f5 100644 --- a/packages/css/src/components/avatar/avatar.scss +++ b/packages/css/src/components/avatar/avatar.scss @@ -20,6 +20,15 @@ } } +.ams-avatar:not(.ams-avatar--has-image) { + @media (forced-colors: active) { + border-style: solid; + border-width: var(--ams-avatar-forced-colors-border-width); + padding-block: calc(var(--ams-avatar-padding-block) - var(--ams-avatar-forced-colors-border-width)); + padding-inline: calc(var(--ams-avatar-padding-inline) - var(--ams-avatar-forced-colors-border-width)); + } +} + .ams-avatar--has-image { inline-size: calc(var(--ams-avatar-line-height) * var(--ams-avatar-font-size) + 2 * var(--ams-avatar-padding-inline)); overflow: hidden; diff --git a/proprietary/tokens/src/components/ams/avatar.tokens.json b/proprietary/tokens/src/components/ams/avatar.tokens.json index 1d9688a5a7..727faa1844 100644 --- a/proprietary/tokens/src/components/ams/avatar.tokens.json +++ b/proprietary/tokens/src/components/ams/avatar.tokens.json @@ -20,6 +20,9 @@ "background-color": { "value": "{ams.color.dark-green}" }, "color": { "value": "{ams.color.primary-white}" } }, + "forced-colors": { + "border-width": { "value": "{ams.border.width.md}" } + }, "green": { "background-color": { "value": "{ams.color.green}" }, "color": { "value": "{ams.color.primary-black}" }