Skip to content

Commit 35e528f

Browse files
authored
refactor(*): components use label size over body size tokens [run-chromatic][skip-cd] (#763)
2 parents 9474a9e + 1a1db3a commit 35e528f

32 files changed

Lines changed: 857 additions & 63 deletions

playground/Theming.html

Lines changed: 783 additions & 0 deletions
Large diffs are not rendered by default.

src/components/Accordion/accordion-item.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
:host([density="compact"]) .accordion-body {
12-
font-size: var(--sgds-font-size-body-sm);
12+
font-size: var(--sgds-font-size-label-sm);
1313
line-height: var(--sgds-line-height-2-xs);
1414
}
1515

@@ -99,7 +99,7 @@ slot[name="caret"] sgds-icon {
9999
.accordion-body {
100100
padding: 0;
101101
overflow: hidden;
102-
font-size: var(--sgds-font-size-body-md);
102+
font-size: var(--sgds-font-size-label-md);
103103
line-height: var(--sgds-line-height-xs);
104104
color: var(--sgds-body-color-subtle);
105105
}

src/components/Alert/alert-link.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.alert-link:hover {
88
color: var(--sgds-alert-color);
99
text-decoration-line: underline;
10-
font-size: var(--sgds-font-size-body-sm);
10+
font-size: var(--sgds-font-size-label-sm);
1111
font-weight: var(--sgds-font-weight-regular);
1212
line-height: var(--sgds-line-height-2-xs);
1313
}

src/components/Alert/alert.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@
9797
}
9898
.alert-content__description {
9999
display: inline;
100-
font-size: var(--sgds-font-size-body-sm);
100+
font-size: var(--sgds-font-size-label-sm);
101101
font-weight: var(--sgds-font-weight-regular);
102102
line-height: var(--sgds-line-height-2-xs);
103103
}
104104

105105
.alert-content__description::slotted(*) {
106-
font-size: var(--sgds-font-size-body-sm);
106+
font-size: var(--sgds-font-size-label-sm);
107107
font-weight: var(--sgds-font-weight-regular);
108108
line-height: var(--sgds-line-height-2-xs);
109109
}

src/components/Breadcrumb/breadcrumb-item.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
gap: var(--sgds-gap-xs);
44
align-items: center;
55
min-width: 0;
6+
font-size: var(--sgds-font-size-link-md);
67
}
78

89
:host .nav-link::slotted(*) {

src/components/Datepicker/datepicker.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
--datepicker-selected-date-bg: var(--sgds-primary);
99
--datepicker-selected-date-color: white;
1010

11-
font-size: var(--sgds-font-size-14);
1211
}
1312

1413
:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu {

src/components/DescriptionList/description-list-group.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ slot[name="title"]::slotted(*) {
1212
color: var(--sgds-heading-color-default);
1313
font-weight: var(--sgds-font-weight-semibold);
1414
letter-spacing: var(--sgds-letter-spacing-tight);
15-
font-size: var(--sgds-font-size-24);
16-
line-height: var(--sgds-line-height-32);
15+
font-size: var(--sgds-font-size-heading-sm);
16+
line-height: var(--sgds-line-height-sm);
1717
}
1818

1919
slot[name="description"]::slotted(*) {
2020
font-weight: var(--sgds-font-weight-regular);
2121
color: var(--sgds-color-subtle);
22-
font-size: var(--sgds-font-size-16);
23-
line-height: var(--sgds-line-height-24);
22+
font-size: var(--sgds-font-size-label-md);
23+
line-height: var(--sgds-line-height-xs);
2424
}
2525

2626
.header {

src/components/DescriptionList/description-list.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
.label {
2525
color: var(--sgds-color-default);
2626
font-weight: var(--sgds-font-weight-semibold);
27-
font-size: var(--sgds-font-size-16);
27+
font-size: var(--sgds-font-size-label-md);
2828
}
2929

3030
.data {
3131
color: var(--sgds-color-subtle);
32-
font-size: var(--sgds-font-size-16);
32+
font-size: var(--sgds-font-size-label-md);
3333
font-weight: var(--sgds-font-weight-regular);
3434
margin: 0;
3535
}

src/components/Drawer/drawer.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ sgds-close-button.drawer-close {
105105

106106
slot[name="title"]::slotted(*) {
107107
margin-bottom: var(--sgds-margin-none) !important;
108-
font-size: var(--sgds-font-size-24) !important;
108+
font-size: var(--sgds-font-size-heading-sm) !important;
109109
color: var(--sgds-color-default) !important;
110110
}
111111

src/components/Dropdown/dropdown-item.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
color: var(--sgds-color-default);
1313
text-align: inherit;
1414
cursor: pointer;
15+
font-size: var(--sgds-font-size-label-sm);
1516
}
1617

1718
.dropdown-item:hover {

0 commit comments

Comments
 (0)