From 4e48c78d69aba1ae2fd3797dda9e3b888338d179 Mon Sep 17 00:00:00 2001 From: Mike O'Donnell Date: Fri, 27 Oct 2023 11:53:17 -0400 Subject: [PATCH] fix(styles): card updates --- packages/styles/src/card.scss | 17 +- .../stories/Components/card/card.stories.js | 2 +- .../Components/card/object-card.example.html | 38 +- .../Components/card/table-card.example.html | 8 +- .../tests/__snapshots__/styles.test.ts.snap | 665 ++++++++++++++++-- 5 files changed, 640 insertions(+), 90 deletions(-) diff --git a/packages/styles/src/card.scss b/packages/styles/src/card.scss index 553e64fa56..078118c6e1 100644 --- a/packages/styles/src/card.scss +++ b/packages/styles/src/card.scss @@ -193,8 +193,6 @@ $fd-card-header-outline-offset: 0.0625rem !default; @include fd-flex() { align-items: flex-end; } - - margin-top: 0.25rem; } &__subtitle { @@ -212,6 +210,7 @@ $fd-card-header-outline-offset: 0.0625rem !default; text-align: right; margin: var(--fdCard_Counter_Margin); white-space: nowrap; + color: var(--sapTile_TitleTextColor); @include fd-rtl() { margin: var(--fdCard_Counter_Margin_RTL); @@ -323,6 +322,10 @@ $fd-card-header-outline-offset: 0.0625rem !default; overflow: hidden; } + .#{$list} { + @include fd-set-paddings-x(0.125rem); + } + &:last-child { border-bottom-left-radius: $fd-card-border-radius; border-bottom-right-radius: $fd-card-border-radius; @@ -388,6 +391,10 @@ $fd-card-header-outline-offset: 0.0625rem !default; @include fd-reset(); padding-bottom: 0.5rem; + + h3 { + font-size: var(--sapFontSize); + } } &__content-group { @@ -411,8 +418,6 @@ $fd-card-header-outline-offset: 0.0625rem !default; } & > * { - margin-bottom: 0.25rem; - &:last-child { margin-bottom: 0; } @@ -441,6 +446,10 @@ $fd-card-header-outline-offset: 0.0625rem !default; } &--table { + .#{$block}__header { + padding-bottom: 0.5rem; + } + @include fd-compact-or-condensed() { .#{$block}__content { padding-bottom: 0.5rem; diff --git a/packages/styles/stories/Components/card/card.stories.js b/packages/styles/stories/Components/card/card.stories.js index b89718aa8b..6a3142fbd9 100644 --- a/packages/styles/stories/Components/card/card.stories.js +++ b/packages/styles/stories/Components/card/card.stories.js @@ -121,4 +121,4 @@ Component (class) | Description ` } } -}; \ No newline at end of file +}; diff --git a/packages/styles/stories/Components/card/object-card.example.html b/packages/styles/stories/Components/card/object-card.example.html index cae8b9ab79..112361af4c 100644 --- a/packages/styles/stories/Components/card/object-card.example.html +++ b/packages/styles/stories/Components/card/object-card.example.html @@ -19,23 +19,23 @@
-
Group Title 1
+

Group Title 1

- Label - Text + Label: + Text
- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -43,14 +43,14 @@
Group Title 2
- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -97,14 +97,14 @@

Group Title 1

- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -122,14 +122,14 @@

Group Title 2

- Label - Text + Label: + Text
- Label - Text + Label: + Text
diff --git a/packages/styles/stories/Components/card/table-card.example.html b/packages/styles/stories/Components/card/table-card.example.html index 8a74955296..0b3af74f04 100644 --- a/packages/styles/stories/Components/card/table-card.example.html +++ b/packages/styles/stories/Components/card/table-card.example.html @@ -15,7 +15,7 @@ - + Name Status @@ -28,7 +28,7 @@ - + Banana @@ -45,7 +45,7 @@ - + Pineapple @@ -62,7 +62,7 @@ - + Orange diff --git a/packages/styles/tests/__snapshots__/styles.test.ts.snap b/packages/styles/tests/__snapshots__/styles.test.ts.snap index e1ee662425..194d6c33ab 100644 --- a/packages/styles/tests/__snapshots__/styles.test.ts.snap +++ b/packages/styles/tests/__snapshots__/styles.test.ts.snap @@ -11190,23 +11190,23 @@ exports[`Check stories > Components/Card > Story ObjectCard > Should match snaps
-
Group Title 1
+

Group Title 1

- Label - Text + Label: + Text
- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -11214,14 +11214,14 @@ exports[`Check stories > Components/Card > Story ObjectCard > Should match snaps
Group Title 2
- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -11268,14 +11268,14 @@ exports[`Check stories > Components/Card > Story ObjectCard > Should match snaps
- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -11293,14 +11293,14 @@ exports[`Check stories > Components/Card > Story ObjectCard > Should match snaps
- Label - Text + Label: + Text
- Label - Text + Label: + Text
@@ -11330,7 +11330,7 @@ exports[`Check stories > Components/Card > Story TableCard > Should match snapsh - + Name Status @@ -11343,7 +11343,7 @@ exports[`Check stories > Components/Card > Story TableCard > Should match snapsh - + Banana @@ -11360,7 +11360,7 @@ exports[`Check stories > Components/Card > Story TableCard > Should match snapsh - + Pineapple @@ -11377,7 +11377,7 @@ exports[`Check stories > Components/Card > Story TableCard > Should match snapsh - + Orange @@ -33569,57 +33569,417 @@ exports[`Check stories > Components/Rating Indicator > Story DifferentValues > S exports[`Check stories > Components/Rating Indicator > Story Disabled > Should match snapshot 1`] = ` "
+

Default:

- - + + - + - + - + - + - +
(2 of 5)
+
+

Default:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ (2 of 5) +
+
" `; exports[`Check stories > Components/Rating Indicator > Story DisplayMode > Should match snapshot 1`] = ` "
-
-
- - +

Default:

+
+
+ + - - + + - - + + - - + + - - + + - - -
- (2 of 5) + + +
+ (2 of 5) +
+
+
+

Half values:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ (2.5 of 5)
+
" `; @@ -33811,29 +34171,210 @@ exports[`Check stories > Components/Rating Indicator > Story HalfValues > Should exports[`Check stories > Components/Rating Indicator > Story NonInteractive > Should match snapshot 1`] = ` "
-
-
- - +

Default:

+
+
+ + - - + + - - + + - - + + - - + + - - -
- (2 of 5) + +
+ (2 of 5)
+
+ +
+

Half values:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ (2.5 of 5) +
+
" `;