Skip to content

Commit c9b3bc7

Browse files
fix(coachmark): enforces consistent spacing from image to header and header to text with action menu present
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent f21b9a5 commit c9b3bc7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

components/coachmark/dist/metadata.json

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
".spectrum-CoachMark-content",
99
".spectrum-CoachMark-footer",
1010
".spectrum-CoachMark-header",
11+
".spectrum-CoachMark-header:has(.spectrum-CoachMark-action-menu)",
1112
".spectrum-CoachMark-image",
1213
".spectrum-CoachMark-image-wrapper",
1314
".spectrum-CoachMark-image-wrapper--fixedHeight",
@@ -28,6 +29,7 @@
2829
"--mod-coachmark-content-line-height",
2930
"--mod-coachmark-header-to-body",
3031
"--mod-coachmark-heading-to-action-button",
32+
"--mod-coachmark-image-to-heading",
3133
"--mod-coachmark-max-width",
3234
"--mod-coachmark-media-fixed-height",
3335
"--mod-coachmark-media-min-height",
@@ -68,6 +70,7 @@
6870
"--spectrum-coachmark-content-font-weight",
6971
"--spectrum-coachmark-header-to-body",
7072
"--spectrum-coachmark-heading-to-action-button",
73+
"--spectrum-coachmark-image-to-heading",
7174
"--spectrum-coachmark-max-width",
7275
"--spectrum-coachmark-media-fixed-height",
7376
"--spectrum-coachmark-media-min-height",
@@ -104,6 +107,7 @@
104107
"--spectrum-spacing-100",
105108
"--spectrum-spacing-200",
106109
"--spectrum-spacing-300",
110+
"--spectrum-spacing-75",
107111
"--spectrum-title-line-height",
108112
"--spectrum-title-sans-serif-font-weight",
109113
"--spectrum-title-serif-font-style"

components/coachmark/index.css

+8-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
/* layout */
2626
--spectrum-coachmark-padding: var(--spectrum-coach-mark-edge-to-content);
27+
--spectrum-coachmark-image-to-heading: var(--spectrum-coach-mark-edge-to-content);
2728
--spectrum-coachmark-heading-to-action-button: var(--spectrum-spacing-300);
2829
--spectrum-coachmark-header-to-body: var(--spectrum-spacing-200);
2930
--spectrum-coachmark-body-to-footer: var(--spectrum-spacing-300);
@@ -97,13 +98,19 @@
9798

9899
/* Wrapper contains title, action-menu */
99100
.spectrum-CoachMark-header {
100-
padding-block-start: var(--mod-coachmark-padding, var(--spectrum-coachmark-padding));
101+
padding-block-start: var(--mod-coachmark-image-to-heading, var(--spectrum-coachmark-image-to-heading));
101102
display: flex;
102103
justify-content: space-between;
103104
align-items: center;
104105
margin-block-end: var(--mod-coachmark-header-to-body, var(--spectrum-coachmark-header-to-body));
105106
}
106107

108+
/* Enforces consistent spacing from image to header and header to text with action menu present */
109+
.spectrum-CoachMark-header:has(.spectrum-CoachMark-action-menu) {
110+
--mod-coachmark-image-to-heading: calc(var(--spectrum-spacing-200) * 1.55);
111+
--mod-coachmark-header-to-body: calc(var(--spectrum-spacing-75) * 1.6);
112+
}
113+
107114
/* Text wrapper for the title content; sides besdie action menu if present */
108115
.spectrum-CoachMark-title {
109116
color: var(--mod-coachmark-title-color, var(--spectrum-coachmark-title-color));

0 commit comments

Comments
 (0)