Skip to content

Commit 3bca98a

Browse files
committed
fix(components): manual format adjustment to CSS
1 parent 85e6c49 commit 3bca98a

File tree

11 files changed

+68
-67
lines changed

11 files changed

+68
-67
lines changed

packages/components/src/styles/components/alert.scss

+2-3
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@
145145

146146
&.hds-alert--type-inline {
147147
background-color: var(--token-color-surface-faint);
148-
border-color: var(
149-
--token-color-border-strong
150-
); // notice: in the "neutral" color the "inline" has a slightly darker border color compared to the others to increase contrast (eg. could be used on a light gray background)
148+
// notice: in the "neutral" color the "inline" has a slightly darker border color compared to the others to increase contrast (eg. could be used on a light gray background)
149+
border-color: var(--token-color-border-strong);
151150
}
152151

153152
// different color by design

packages/components/src/styles/components/app-side-nav/content.scss

+5-4
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,18 @@
5858

5959
// LIST (root elements)
6060

61-
.hds-app-side-nav__list-wrapper, // <nav> element
61+
// <nav> element
62+
.hds-app-side-nav__list-wrapper,
63+
// <ul> element
6264
.hds-app-side-nav__list {
63-
// <ul> element
6465
margin: 0;
6566
padding: 0;
6667
}
6768

6869
// ITEM (generic container)
6970

71+
// <li> element
7072
.hds-app-side-nav__list-item {
71-
// <li> element
7273
position: relative; // for the "active" state indicator
7374
list-style-type: none;
7475

@@ -77,8 +78,8 @@
7778
}
7879
}
7980

81+
// <a>/<button> element (via Hds::Interactive)
8082
.hds-app-side-nav__list-item-link {
81-
// <a>/<button> element (via Hds::Interactive)
8283
display: flex;
8384
gap: var(--token-app-side-nav-body-list-item-content-spacing-horizontal);
8485
align-items: center;

packages/components/src/styles/components/badge-count.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ $hds-badge-count-border-width: 1px;
2828
// these values later may come from the design tokens
2929
$hds-badge-count-size-props: (
3030
"small": (
31+
// 13px = 0.8125rem
3132
"font-size": 0.8125rem,
32-
// 13px
3333
"height": 1.25rem,
34+
// 16px = 1.2308
3435
"line-height": 1.2308,
35-
// 16px
3636
"padding-vertical": 0.125rem,
3737
"padding-horizontal": 0.5rem,
3838
),
3939
"medium": (
40+
// 13px = 0.8125rem
4041
"font-size": 0.8125rem,
41-
// 13px
4242
"height": 1.5rem,
43+
// 16px = 1.2308
4344
"line-height": 1.2308,
44-
// 16px
4545
"padding-vertical": 0.25rem,
4646
"padding-horizontal": 0.75rem,
4747
),
4848
"large": (
49+
// 16px = 1rem
4950
"font-size": 1rem,
50-
// 16px
5151
"height": 2rem,
52+
// 24px = 1.5
5253
"line-height": 1.5,
53-
// 24px
5454
"padding-vertical": 0.25rem,
5555
"padding-horizontal": 0.875rem,
5656
),

packages/components/src/styles/components/badge.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,35 +67,35 @@ $hds-badge-colors-props: (
6767
// these values later may come from the design tokens
6868
$hds-badge-size-props: (
6969
"small": (
70+
// 13px = 0.8125rem
7071
"font-size": 0.8125rem,
71-
// 13px
7272
"gap": 0.25rem,
7373
"height": 1.25rem,
7474
"icon-size": 0.75rem,
75+
// 16px = 1.2308
7576
"line-height": 1.2308,
76-
// 16px
7777
"padding-vertical": 0.125rem,
7878
"padding-horizontal": 0.375rem,
7979
),
8080
"medium": (
81+
// 13px = 0.8125rem
8182
"font-size": 0.8125rem,
82-
// 13px
8383
"gap": 0.25rem,
8484
"height": 1.5rem,
8585
"icon-size": 1rem,
86+
// 16px = 1.2308
8687
"line-height": 1.2308,
87-
// 16px
8888
"padding-vertical": 0.25rem,
8989
"padding-horizontal": 0.5rem,
9090
),
9191
"large": (
92+
// 16px = 1rem
9293
"font-size": 1rem,
93-
// 16px
9494
"gap": 0.375rem,
9595
"height": 2rem,
9696
"icon-size": 1rem,
97+
// 24px = 1.5
9798
"line-height": 1.5,
98-
// 24px
9999
"padding-vertical": 0.25rem,
100100
"padding-horizontal": 0.5rem,
101101
),

packages/components/src/styles/components/dismiss-button.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
&:hover,
2121
&.mock-hover {
22+
// we re-use the pseudo-element created by the "focus-ring" mixin
2223
&::before {
23-
// we re-use the pseudo-element created by the "focus-ring" mixin
2424
background-color: rgba(#dedfe3, 0.4);
2525
}
2626
}

packages/components/src/styles/components/form/group.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
// FORM > GROUP
88
//
99

10+
// notice: this is a <fieldset> element
1011
.hds-form-group {
11-
// notice: this is a <fieldset> element
1212
display: block;
1313
margin: 0;
1414
padding: 0;
1515
border: none;
1616
}
1717

18+
// notice: this is a <legend> element
1819
.hds-form-group__legend {
19-
// notice: this is a <legend> element
2020
margin: 0 0 8px 0;
2121
padding: 0;
2222
}

packages/components/src/styles/components/icon-tile.scss

+13-13
Original file line numberDiff line numberDiff line change
@@ -60,42 +60,42 @@ $hds-icon-tile-border-width: 1px;
6060
// these values later may come from the design tokens
6161
$hds-icon-tile-size-props: (
6262
"small": (
63+
// 28px = 1.75rem
6364
"size": 1.75rem,
64-
// 28px
6565
"border-radius": 5px,
66+
// 16px = 1rem
6667
"icon-size": 1rem,
67-
// 16px
68+
// 18px = 1.125rem
6869
"logo-size": 1.125rem,
69-
// 18px
70+
// 18px = 1.125rem
7071
"extra-size": 1.125rem,
71-
// 18px
7272
"extra-border-radius": 4px,
7373
"extra-icon-size": 0.75rem,
7474
),
7575
"medium": (
76+
// 40px = 2.5rem
7677
"size": 2.5rem,
77-
// 40px
7878
"border-radius": 6px,
79+
// 24px = 1.5rem
7980
"icon-size": 1.5rem,
80-
// 24px
81+
// 28px = 1.75rem
8182
"logo-size": 1.75rem,
82-
// 28px
83+
// 20px = 1.25rem
8384
"extra-size": 1.25rem,
84-
// 20px
8585
"extra-border-radius": 5px,
86+
// 12px = .75rem
8687
"extra-icon-size": 0.75rem,
87-
// 12px
8888
),
8989
"large": (
90+
// 48px = 3rem
9091
"size": 3rem,
91-
// 48px
9292
"border-radius": 6px,
93+
// 24px = 1.5rem
9394
"icon-size": 1.5rem,
94-
// 24px
95+
// 32px = 2rem
9596
"logo-size": 2rem,
96-
// 32px
97+
// 24px = 1.5rem
9798
"extra-size": 1.5rem,
98-
// 24px
9999
"extra-border-radius": 5px,
100100
"extra-icon-size": 1rem,
101101
),

packages/components/src/styles/components/link/standalone.scss

+9-9
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,28 @@ $hds-link-standalone-border-width: 1px;
4949
// these values later may come from the design tokens
5050
$hds-link-standalone-size-props: (
5151
"small": (
52+
// 13px = 0.8125rem
5253
"font-size": 0.8125rem,
53-
// 13px;
54+
// 12px = 0.75rem
5455
"icon-size": 0.75rem,
55-
// 12px
56+
// 16px ~= 1.231
5657
"line-height": 1.231,
57-
// ~16px
5858
),
5959
"medium": (
60+
// 14px = 0.875rem
6061
"font-size": 0.875rem,
61-
// 14px
62+
// 16px = 1rem
6263
"icon-size": 1rem,
63-
// 16px
64+
// 16px ~= 1.143
6465
"line-height": 1.143,
65-
// ~16px
6666
),
6767
"large": (
68+
// 16px = 1rem
6869
"font-size": 1rem,
69-
// 16px
70+
// 24px = 1.5rem
7071
"icon-size": 1.5rem,
71-
// 24px
72+
// 24px = 1.5
7273
"line-height": 1.5,
73-
// 24px
7474
),
7575
);
7676

packages/components/src/styles/components/pagination.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ $hds-pagination-layout-breakpoint: 1000px;
155155

156156
// indicator underline
157157
// notice: in all these calculations we have to take in account that there's a 1px transparent border
158+
// notice: we use the `::before` for the focus
158159
&::after {
159-
// notice: we use the `::before` for the focus
160160
position: absolute;
161161
right: calc(var(--token-pagination-nav-indicator-spacing) - 1px);
162162
bottom: -1px;

packages/components/src/styles/components/side-nav/content.scss

+5-4
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,27 @@
5858

5959
// LIST (root elements)
6060

61-
.hds-side-nav__list-wrapper, // <nav> element
61+
// <nav> element
62+
.hds-side-nav__list-wrapper,
63+
// <ul> element
6264
.hds-side-nav__list {
63-
// <ul> element
6465
margin: 0;
6566
padding: 0;
6667
}
6768

6869
// ITEM (generic container)
6970

71+
// <li> element
7072
.hds-side-nav__list-item {
71-
// <li> element
7273
list-style-type: none;
7374

7475
& + & {
7576
margin-top: var(--token-side-nav-body-list-item-spacing-vertical);
7677
}
7778
}
7879

80+
// <a>/<button> element (via Hds::Interactive)
7981
.hds-side-nav__list-item-link {
80-
// <a>/<button> element (via Hds::Interactive)
8182
display: flex;
8283
gap: var(--token-side-nav-body-list-item-content-spacing-horizontal);
8384
align-items: center;

packages/components/src/styles/mixins/_button.scss

+18-18
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,46 @@ $hds-button-focus-border-width: 3px;
1313
// these values later may come from the design tokens
1414
$hds-button-size-props: (
1515
"small": (
16+
// 13px = 0.8125rem
1617
"font-size": 0.8125rem,
17-
// 13px;
18+
// 14px = 0.875rem; we need to make it even (so we set it slighly larger than the font-size; notice: in Figma is 12px but this would cut some ascendants/descendants)
1819
"line-height": 0.875rem,
19-
// 14px - we need to make it even (so we set it slighly larger than the font-size; notice: in Figma is 12px but this would cut some ascendants/descendants)
20+
// 28px = 1.75rem
2021
"min-height": 1.75rem,
21-
// 28px
22+
// 6px = 0.375rem; here we're taking into account the 1px border
2223
"padding-vertical": 0.375rem,
23-
// 6px - here we're taking into account the 1px border
24+
// 11px = 0.6875rem; here we're taking into account the 1px border
2425
"padding-horizontal": 0.6875rem,
25-
// 11px - here we're taking into account the 1px border
26+
// 12px = 0.75rem
2627
"icon-size": 0.75rem,
27-
// 12px
2828
),
2929
"medium": (
30+
// 14px = 0.875rem
3031
"font-size": 0.875rem,
31-
// 14px
32+
// 16px = 1rem
3233
"line-height": 1rem,
33-
// 16px
34+
// 36px = 2.25rem
3435
"min-height": 2.25rem,
35-
// 36px
36+
// 9px = 0.5625rem; here we're taking into account the 1px border
3637
"padding-vertical": 0.5625rem,
37-
// 9px - here we're taking into account the 1px border
38+
// 15px = 0.9375rem; here we're taking into account the 1px border
3839
"padding-horizontal": 0.9375rem,
39-
// 15px - here we're taking into account the 1px border
40-
"icon-size": 1rem,
4140
// 16px
41+
"icon-size": 1rem,
4242
),
4343
"large": (
44+
// 16px = 1rem
4445
"font-size": 1rem,
45-
// 16px
46+
// 24px = 1.5rem
4647
"line-height": 1.5rem,
47-
// 24px
48+
// 48px = 3rem
4849
"min-height": 3rem,
49-
// 48px
50+
// 11px = 0.6875rem; here we're taking into account the 1px border
5051
"padding-vertical": 0.6875rem,
51-
// 11px - here we're taking into account the 1px border
52+
// 19px = 1.1875rem; here we're taking into account the 1px border
5253
"padding-horizontal": 1.1875rem,
53-
// 19px - here we're taking into account the 1px border
54+
// 24px = 1.5rem
5455
"icon-size": 1.5rem,
55-
// 24px
5656
),
5757
);
5858

0 commit comments

Comments
 (0)