From ee3411e68c13711d0f8bc04d115f0410123b5069 Mon Sep 17 00:00:00 2001 From: eirikbacker Date: Wed, 8 Jan 2025 08:12:51 +0100 Subject: [PATCH 1/4] fix: support hidden attribute --- packages/css/src/badge.css | 5 ++++- packages/css/src/breadcrumbs.css | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/css/src/badge.css b/packages/css/src/badge.css index 97325f3ffc..3e52715737 100644 --- a/packages/css/src/badge.css +++ b/packages/css/src/badge.css @@ -30,8 +30,11 @@ } .ds-badge--position { + &:not([hidden]) { + display: inline-flex; + } + box-sizing: border-box; - display: inline-flex; position: relative; height: fit-content; width: fit-content; diff --git a/packages/css/src/breadcrumbs.css b/packages/css/src/breadcrumbs.css index bd47f4cc62..548078c21b 100644 --- a/packages/css/src/breadcrumbs.css +++ b/packages/css/src/breadcrumbs.css @@ -5,7 +5,9 @@ --dsc-breadcrumbs-color: var(--ds-color-text-subtle); & > :is(ol, ul) { - display: flex; + &:not([hidden]) { + display: flex; + } flex-wrap: wrap; list-style-type: none; margin: 0; From aba77ad2ee87c53faa4554c3e3bd198c3dbe57cf Mon Sep 17 00:00:00 2001 From: eirikbacker Date: Wed, 8 Jan 2025 09:31:34 +0100 Subject: [PATCH 2/4] fix: support hidden attribute --- packages/css/src/avatar.css | 5 ++++- packages/css/src/badge.css | 8 ++++---- packages/css/src/card.css | 7 +++++-- packages/css/src/chip.css | 5 ++++- packages/css/src/combobox.css | 1 - packages/css/src/details.css | 5 ++++- packages/css/src/dropdown.css | 5 ++++- packages/css/src/field.css | 20 ++++++++++++++++---- packages/css/src/pagination.css | 5 ++++- packages/css/src/popover.css | 5 ++++- packages/css/src/search.css | 5 ++++- packages/css/src/skeleton.css | 10 ++++++++-- packages/css/src/skiplink.css | 5 ++++- packages/css/src/table.css | 5 ++++- packages/css/src/tag.css | 5 ++++- packages/css/src/togglegroup.css | 5 ++++- 16 files changed, 77 insertions(+), 24 deletions(-) diff --git a/packages/css/src/avatar.css b/packages/css/src/avatar.css index 872dce7fe4..e69540d73d 100644 --- a/packages/css/src/avatar.css +++ b/packages/css/src/avatar.css @@ -11,7 +11,6 @@ border-radius: var(--dsc-avatar-border-radius); box-sizing: border-box; color: var(--dsc-avatar-color); - display: inline-flex; flex-shrink: 0; font-weight: var(--ds-font-weight-medium); height: var(--dsc-avatar-size); @@ -22,6 +21,10 @@ user-select: none; width: var(--dsc-avatar-size); + &:not([hidden]) { + display: inline-flex; + } + &:not(:has(img)) { padding: var(--dsc-avatar-padding); } diff --git a/packages/css/src/badge.css b/packages/css/src/badge.css index 3e52715737..8fb4abf59e 100644 --- a/packages/css/src/badge.css +++ b/packages/css/src/badge.css @@ -30,15 +30,15 @@ } .ds-badge--position { - &:not([hidden]) { - display: inline-flex; - } - box-sizing: border-box; position: relative; height: fit-content; width: fit-content; + &:not([hidden]) { + display: inline-flex; + } + & .ds-badge::before { position: absolute; } diff --git a/packages/css/src/card.css b/packages/css/src/card.css index 903332ed12..3860907664 100644 --- a/packages/css/src/card.css +++ b/packages/css/src/card.css @@ -24,13 +24,16 @@ border: var(--dsc-card-border); box-sizing: border-box; color: var(--dsc-card-color); - display: block; font-family: inherit; margin: 0; overflow: clip; /* Needed to clip media elements and and Card.Block */ padding: var(--dsc-card-padding); text-align: inherit; + &:not([hidden]) { + display: block; + } + &:not([data-size]) { font-size: inherit; /* Ensure inheriting font-size when