Skip to content

Commit c1ba9db

Browse files
fix(documentation, styles): replace broken css variables with hex values (#4446)
Co-authored-by: Oliver Schürch <[email protected]>
1 parent c1a7c55 commit c1ba9db

File tree

25 files changed

+64
-54
lines changed

25 files changed

+64
-54
lines changed

.changeset/cyan-days-kiss.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@swisspost/design-system-styles-primeng': patch
3+
'@swisspost/design-system-documentation': patch
4+
'@swisspost/design-system-components': patch
5+
'@swisspost/design-system-styles': patch
6+
---
7+
8+
Replaced previously deleted CSS variables with SASS variables.

packages/components/src/components/post-card-control/post-card-control.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ tokens.$default-map: utilities.$post-spacing;
6464

6565
&:hover:not([disabled]),
6666
&:hover:not([disabled]) ~ label.form-check-label {
67-
color: var(--post-contrast-color);
67+
color: post.$black;
6868
background-color: transparent;
6969
}
7070

packages/documentation/.storybook/styles/manager.scss

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '@swisspost/design-system-styles/core' as post;
12
@use '@swisspost/design-system-styles/mixins/utilities';
23
@use './components';
34
@use '../addons/addons';
@@ -57,7 +58,7 @@
5758

5859
&:hover,
5960
&:focus-visible {
60-
background-color: var(--post-gray-10);
61+
background-color: post.$gray-10;
6162
}
6263
}
6364

@@ -77,7 +78,7 @@
7778
}
7879

7980
&[data-nodetype='group'] svg {
80-
color: var(--post-gray-60);
81+
color: post.$gray-60;
8182
}
8283
&[data-nodetype='component'] svg {
8384
color: #0076a8;
@@ -90,8 +91,8 @@
9091
}
9192

9293
&[data-selected='true'] {
93-
background-color: rgba(var(--post-yellow-rgb), 0.4);
94-
color: var(--post-contrast-color);
94+
background-color: rgba(post.$yellow, 0.4);
95+
color: post.$black;
9596
}
9697
}
9798

@@ -137,7 +138,7 @@
137138

138139
.search-result-item--label {
139140
span {
140-
color: var(--post-gray-60);
141+
color: post.$gray-60;
141142
}
142143

143144
mark {
@@ -147,7 +148,7 @@
147148

148149
&:hover,
149150
&:focus-visible {
150-
background-color: var(--post-gray-10);
151+
background-color: post.$gray-10;
151152
}
152153
}
153154
}

packages/documentation/.storybook/styles/preview.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ $monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier
124124
display: block;
125125
margin-top: 0.25rem;
126126
padding: 1rem;
127-
background-color: var(--post-contrast-color);
128-
color: var(--post-contrast-color-inverted);
127+
background-color: post.$black;
128+
color: post.$white;
129129
}
130130
}
131131

packages/documentation/src/stories/foundations/icons/search/search-icons.styles.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ tokens.$default-map: utilities.$post-spacing;
5757
.icon {
5858
display: flex;
5959
flex-direction: column;
60-
border: post.$border-width solid var(--post-gray-20);
60+
border: post.$border-width solid post.$gray-20;
6161
border-radius: post.$border-radius;
6262

6363
.icon--tile {
@@ -68,7 +68,7 @@ tokens.$default-map: utilities.$post-spacing;
6868
padding: tokens.get('utility-gap-4') tokens.get('utility-gap-16');
6969
width: 100%;
7070
height: 80px;
71-
background-color: var(--post-contrast-color-inverted);
71+
background-color: post.$white;
7272
border-top-left-radius: post.$border-radius;
7373
border-top-right-radius: post.$border-radius;
7474

@@ -85,8 +85,8 @@ tokens.$default-map: utilities.$post-spacing;
8585
flex-direction: column;
8686
justify-content: center;
8787
padding: tokens.get('utility-gap-4') tokens.get('utility-gap-16');
88-
background-color: var(--post-gray-10);
89-
border-top: post.$border-width solid var(--post-gray-20);
88+
background-color: post.$gray-10;
89+
border-top: post.$border-width solid post.$gray-20;
9090
border-bottom-left-radius: post.$border-radius;
9191
border-bottom-right-radius: post.$border-radius;
9292
font-size: post.$font-size-tiny;
@@ -98,7 +98,7 @@ tokens.$default-map: utilities.$post-spacing;
9898

9999
.info--keywords {
100100
font-size: post.$font-size-tiny;
101-
color: var(--post-gray-60);
101+
color: post.$gray-60;
102102
hyphens: auto;
103103
}
104104
}

packages/documentation/src/stories/foundations/typography/typography.styles.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tokens.$default-map: utilities.$post-spacing;
2121

2222
.sb-fontface__typo {
2323
font-size: post.$font-size-huge;
24-
color: var(--post-gray-60);
24+
color: post.$gray-60;
2525
line-height: 1;
2626
}
2727

@@ -38,10 +38,10 @@ tokens.$default-map: utilities.$post-spacing;
3838
.settings__weight,
3939
.settings__style {
4040
font-size: post.$font-size-tiny;
41-
color: var(--post-gray-80);
41+
color: post.$gray-80;
4242

4343
> span {
44-
color: var(--post-gray-60);
44+
color: post.$gray-60;
4545
}
4646
}
4747
}

packages/documentation/src/stories/misc/migration-guide/shared.component.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ migration-setup {
9393
.migration-options {
9494
margin: 1rem 0;
9595
padding: 1.5rem 0;
96-
border-top: 1px solid var(--post-gray-10);
97-
border-bottom: 1px solid var(--post-gray-10);
96+
border-top: 1px solid post.$gray-10;
97+
border-bottom: 1px solid post.$gray-10;
9898

9999
> .row {
100100
--bs-gutter-y: 1.5rem;

packages/styles-primeng-workspace/projects/styles-primeng/src/lib/primeng-theme/_variables.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $shade500: post.$error !default; //unused
2424
$shade600: post.$text-muted !default; //text secondary color
2525
$shade700: post.$black !default; //input text color
2626
$shade800: post.$error !default; //unused
27-
$shade900: var(--post-contrast-color) !default; //text color
27+
$shade900: post.$black !default; //text color
2828

2929
//global
3030
$borderRadius: post.$border-radius !default;

packages/styles/src/components/button.scss

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ tokens.$default-map: components.$post-button;
3737
border-radius: tokens.get('button-border-radius-round');
3838
background-color: transparent;
3939
box-shadow: none;
40-
color: var(--post-gray-80);
4140
font-family: inherit;
4241
font-weight: tokens.get('button-label-font-weight');
4342
text-decoration: none;

packages/styles/src/components/card-control.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fieldset {
5757
@include utilities-mx.focus-style-none();
5858

5959
&:hover:not([disabled]) ~ label {
60-
color: var(--post-contrast-color);
60+
color: color.$black;
6161
background-color: transparent !important;
6262
}
6363

packages/styles/src/components/datepicker.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
ngb-datepicker {
1515
// Conversion for compatibility
16-
--bs-light: var(--post-light);
16+
--bs-light: color.$light;
1717
}
1818

1919
ngb-datepicker.dropdown-menu {
@@ -75,7 +75,7 @@ span.ngb-dp-navigation-chevron {
7575
}
7676

7777
.ngb-dp-weekday {
78-
color: rgba(var(--post-contrast-color-rgb), 0.6) !important;
78+
color: color.$black-alpha-60 !important;
7979
font-size: 1rem;
8080
font-style: normal !important;
8181
line-height: type.$line-height-copy !important;

packages/styles/src/components/dialog.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dialog {
2121
overflow: auto;
2222
margin: revert;
2323
overscroll-behavior: contain;
24-
border: 2px solid var(--post-contrast-color); // Ensures good contrast when bg is dark against dark backdrop
24+
border: 2px solid color.$black; // Ensures good contrast when bg is dark against dark backdrop
2525

2626
&::backdrop {
2727
background-color: rgba(0, 0, 0, 0.8);

packages/styles/src/components/tabs/_tab-title.scss

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,27 @@ tokens.$default-map: utilities.$post-spacing;
2222
border-left: 1px solid transparent;
2323
outline-color: currentColor;
2424
opacity: 0.7;
25-
color: var(--post-contrast-color);
25+
color: color.$black;
2626
text-decoration: none;
2727
background-color: transparent;
2828

2929
&:focus {
3030
background-color: unset;
31-
color: var(--post-contrast-color);
31+
color: color.$black;
3232
}
3333

3434
&:hover {
3535
opacity: 1;
36-
background-color: rgba(var(--post-contrast-color-rgb), 0.6);
37-
color: var(--post-contrast-color-inverted);
36+
background-color: color.$black-alpha-60;
37+
color: color.$white;
3838
}
3939

4040
// same styles as focus, can't use placeholder here because focus-visible can't be described outside of the support condition
4141
&:focus-visible {
4242
outline: transparent;
4343
opacity: 1;
44-
background-color: rgba(var(--post-contrast-color-rgb), 0.6);
45-
color: var(--post-contrast-color-inverted);
44+
background-color: color.$black-alpha-60;
45+
color: color.$white;
4646
box-shadow: none;
4747

4848
&::after {
@@ -62,8 +62,8 @@ tokens.$default-map: utilities.$post-spacing;
6262
border-right-color: nav.$nav-tabs-border-color;
6363
border-left-color: nav.$nav-tabs-border-color;
6464
opacity: 1;
65-
background-color: var(--post-contrast-color-inverted);
66-
color: var(--post-contrast-color);
65+
background-color: color.$white;
66+
color: color.$black;
6767
font-weight: 700;
6868

6969
// Create a line that does not suffer from border corner mitering

packages/styles/src/components/tabs/_tabs-wrapper.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
padding-top: spacing.$spacer;
1111
border: 0;
1212
background-color: rgba(
13-
var(--post-contrast-color-rgb),
13+
color.$black,
1414
0.02
1515
); // 0.02 gets as close as possible to color.$light on white background
1616

packages/styles/src/components/tag.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
}
6464

6565
&.tag-white {
66-
border-color: var(--post-contrast-color);
66+
border-color: color.$black;
6767
}
6868

6969
// Can be removed completely as soon as Firefox ESR v128 is released and rolled out

packages/styles/src/mixins/_form-checks.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
border-color: $color;
77

88
~ .form-check-label {
9-
color: var(--post-contrast-color);
9+
color: color.$black;
1010
}
1111
}
1212

packages/styles/src/mixins/_forms.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@use './../functions/icons';
55
@use './../functions/forms' as forms-fx;
66
@use './../functions/utilities' as utilities-fx;
7+
@use './../variables/color';
78

89
// Placeholder in input fields
910
@mixin placeholder() {
@@ -26,7 +27,7 @@
2627

2728
/* Compatibility with button-group */
2829
&:is(:focus-visible, :focus-within, .pretend-focus) {
29-
outline: forms.$input-focus-outline-thickness solid var(--post-contrast-color);
30+
outline: forms.$input-focus-outline-thickness solid color.$black;
3031
@content;
3132
}
3233
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
@use './../mixins/utilities';
22
@use './../mixins/color' as color-mx;
3+
@use './../variables/color';
34
@use './../variables/components/button';
45

56
%btn-transparent-background {
67
@include utilities.not-disabled-focus-hover() {
7-
color: var(--post-contrast-color);
8+
color: color.$black;
89
}
910

1011
// Invert icon on dark backgrounds
1112
@include color-mx.on-dark-background() {
12-
color: var(--post-contrast-color);
13+
color: color.$black;
1314
}
1415
}

packages/styles/src/variables/components/_close.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $close-size: tokens.get('utility-gap-24') !default;
1111
$close-border-radius: button.$btn-border-radius !default;
1212
$close-color: color.$black !default;
1313
$close-hover-color: color.$black !default;
14-
$close-disabled-color: var(--post-gray-40) !default;
14+
$close-disabled-color: color.$gray-40 !default;
1515
$close-transition: button.$btn-transition !default;
1616

1717
// DEPRECATED

packages/styles/src/variables/components/_dropdowns.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $dropdown-bg: color.$white !default;
1212
$dropdown-border-color: rgba(color.$black, 0.15) !default;
1313
$dropdown-border-radius: commons.$border-radius !default;
1414
$dropdown-border-width: commons.$border-width !default;
15-
$dropdown-divider-bg: rgba(var(--post-contrast-color-inverted-rgb), 0.6) !default;
15+
$dropdown-divider-bg: color.$white-alpha-60 !default;
1616
$dropdown-box-shadow: 0 0.5rem 1rem rgba(color.$black, 0.175) !default;
1717

1818
$dropdown-link-color: color.$gray-60 !default;

packages/styles/src/variables/components/_forms.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $input-line-height-rg: type.$line-height-copy !default;
2929
$input-padding-y-lg: sizing.px-to-rem(button.$input-btn-padding-y-lg) !default;
3030
$input-line-height-lg: type.$line-height-copy !default;
3131

32-
$input-disabled-border-color: var(--post-gray-40); // Design System only
32+
$input-disabled-border-color: color.$gray-40; // Design System only
3333

3434
$input-border-color: color.$gray-80 !default;
3535
$input-border-width: button.$input-btn-border-width !default;

packages/styles/src/variables/components/_nav.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ $nav-tabs-focus-box-shadow:
4141
0 0 0 2px color.$gray-80 !default;
4242
$nav-tabs-focus-box-shadow-width: 2px !default;
4343

44-
$nav-tabs-i-border-color: rgba(var(--post-contrast-color-inverted-rgb), 0.4) !default;
45-
$nav-tabs-i-link-hover-bg: rgba(var(--post-contrast-color-rgb), 0.1) !default;
46-
$nav-tabs-i-link-hover-border-color: rgba(var(--post-contrast-color-inverted-rgb), 0.8) !default;
44+
$nav-tabs-i-border-color: color.$white-alpha-40 !default;
45+
$nav-tabs-i-link-hover-bg: color.$black-alpha-10 !default;
46+
$nav-tabs-i-link-hover-border-color: color.$white-alpha-80 !default;
4747
$nav-tabs-i-link-text-color: color.$white !default;
4848
$nav-tabs-i-link-active-color: color.$white !default;
4949

packages/styles/src/variables/components/_stepper.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ $stepper-indicator-transition:
2525
color animation.$transition-base-timing,
2626
background-color animation.$transition-base-timing;
2727

28-
$stepper-indicator-hover-color: var(--post-contrast-color-inverted);
29-
$stepper-indicator-hover-bg: var(--post-contrast-color);
28+
$stepper-indicator-hover-color: color.$white;
29+
$stepper-indicator-hover-bg: color.$black;
3030

3131
$stepper-indicator-future-bg: color.$gray-60;
3232
$stepper-indicator-future-color: color.$white;
@@ -36,7 +36,7 @@ $stepper-indicator-check-icon-size: $stepper-indicator-check-size;
3636
$stepper-link-line-height: type.$line-height-sm;
3737
$stepper-link-gap: tokens.get('utility-gap-8');
3838
$stepper-link-spacing: tokens.get('utility-gap-16');
39-
$stepper-link-color: var(--post-gray-60);
39+
$stepper-link-color: color.$gray-60;
4040

41-
$stepper-link-current-color: var(--post-gray-80);
41+
$stepper-link-current-color: color.$gray-80;
4242
$stepper-link-current-font-weight: type.$font-weight-bold;

packages/styles/src/variables/components/_subnavigation.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ $subnavigation-height-xs: sizing.px-to-rem(56);
2121
$subnavigation-height-lg: sizing.px-to-rem(64);
2222
$subnavigation-height-xl: sizing.px-to-rem(72);
2323

24-
$subnavigation-link-color: rgba(var(--post-contrast-color-rgb), 0.6);
25-
$subnavigation-link-color-hover: var(--post-contrast-color);
24+
$subnavigation-link-color: color.$black-alpha-60;
25+
$subnavigation-link-color-hover: color.$black;
2626

2727
$subnavigation-link-underscore-height: tokens.get('utility-gap-4');
2828
$subnavigation-link-underscore-color-active: color.$yellow;
29-
$subnavigation-link-underscore-color-hover: rgba(var(--post-contrast-color-rgb), 0.4);
29+
$subnavigation-link-underscore-color-hover: color.$black-alpha-40;
3030

3131
$subnavigation-link-padding-xs: tokens.get('utility-gap-16') tokens.get('utility-gap-12');
3232
$subnavigation-link-padding-lg: tokens.get('utility-gap-20') tokens.get('utility-gap-16');

0 commit comments

Comments
 (0)