@swisspost/design-system-styles 5.3.2 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/basics.css +1 -1
- package/components/alert.scss +2 -1
- package/components/floating-label.scss +10 -5
- package/components/toast.scss +2 -2
- package/components/utilities.scss +2 -1
- package/functions/_color.scss +0 -20
- package/functions/_contrast.scss +70 -0
- package/functions/_index.scss +1 -0
- package/index.css +5 -3
- package/intranet.css +5 -3
- package/layouts/portal/_type.scss +4 -2
- package/mixins/_button.scss +12 -3
- package/package.json +13 -8
- package/placeholders/_notifications.scss +2 -2
- package/variables/_color.scss +2 -2
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
@use './../../variables/spacing';
|
|
6
6
|
@use './../../variables/type';
|
|
7
|
+
@use './../../variables/components/paragraph';
|
|
8
|
+
@use './../../mixins/type' as type-mx;
|
|
7
9
|
@use './../../placeholders/text';
|
|
8
10
|
|
|
9
11
|
@mixin styles {
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
.lead {
|
|
80
|
-
@
|
|
81
|
-
|
|
82
|
+
@include type-mx.font-curve('bigger-regular');
|
|
83
|
+
margin-bottom: paragraph.$text-bottom-space;
|
|
82
84
|
}
|
|
83
85
|
}
|
package/mixins/_button.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@use './../variables/type';
|
|
5
5
|
@use './../variables/color';
|
|
6
6
|
@use './../placeholders/color' as color-ph;
|
|
7
|
-
@use './../functions/
|
|
7
|
+
@use './../functions/contrast' as contrast-fn;
|
|
8
8
|
@use 'utilities';
|
|
9
9
|
|
|
10
10
|
@mixin reset-button {
|
|
@@ -46,12 +46,21 @@
|
|
|
46
46
|
border-color: transparent;
|
|
47
47
|
background-color: $color;
|
|
48
48
|
|
|
49
|
-
@if (
|
|
49
|
+
@if (contrast-fn.light-or-dark($color) == 'dark') {
|
|
50
50
|
color: color.$white;
|
|
51
|
+
} @else {
|
|
52
|
+
color: color.$black;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
@include utilities.not-disabled-focus-hover() {
|
|
54
|
-
|
|
56
|
+
$darkened-color: darken($color, 10%);
|
|
57
|
+
background-color: $darkened-color;
|
|
58
|
+
|
|
59
|
+
@if (contrast-fn.light-or-dark($darkened-color) == 'dark') {
|
|
60
|
+
color: color.$white;
|
|
61
|
+
} @else {
|
|
62
|
+
color: color.$black;
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-styles",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"description": "Design System Styles for the Swiss Post web platform.",
|
|
5
5
|
"author": "Swiss Post <oss@post.ch>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,9 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@angular/compiler": "14.2.12",
|
|
31
|
-
"@
|
|
31
|
+
"@percy/cli": "1.20.0",
|
|
32
|
+
"@percy/cypress": "3.1.2",
|
|
33
|
+
"@types/node": "18.14.0",
|
|
32
34
|
"autoprefixer": "10.4.13",
|
|
33
35
|
"copyfiles": "2.4.1",
|
|
36
|
+
"cypress": "12.6.0",
|
|
37
|
+
"cypress-storybook": "0.5.1",
|
|
34
38
|
"glob": "8.1.0",
|
|
35
39
|
"gulp": "4.0.2",
|
|
36
40
|
"gulp-postcss": "9.0.1",
|
|
@@ -40,8 +44,8 @@
|
|
|
40
44
|
"postcss": "8.4.21",
|
|
41
45
|
"postcss-scss": "4.0.6",
|
|
42
46
|
"rimraf": "4.1.2",
|
|
43
|
-
"sass": "1.58.
|
|
44
|
-
"stylelint": "15.
|
|
47
|
+
"sass": "1.58.3",
|
|
48
|
+
"stylelint": "15.2.0",
|
|
45
49
|
"stylelint-config-prettier": "9.0.5",
|
|
46
50
|
"stylelint-config-sass-guidelines": "9.0.1",
|
|
47
51
|
"stylelint-prettier": "2.0.0",
|
|
@@ -59,16 +63,17 @@
|
|
|
59
63
|
"migrations": "./schematics/migrations.json"
|
|
60
64
|
},
|
|
61
65
|
"scripts": {
|
|
62
|
-
"clean": "rimraf out-tsc dist/*",
|
|
63
66
|
"start": "npm-run-all --parallel styles:start schematics:start",
|
|
67
|
+
"styles:start": "gulp watch",
|
|
64
68
|
"prebuild": "pnpm clean",
|
|
65
69
|
"build": "npm-run-all --parallel styles:build schematics:build",
|
|
70
|
+
"styles:build": "gulp build",
|
|
71
|
+
"test": "jest --onlyChanged",
|
|
72
|
+
"snapshots": "percy exec -- cypress run --config-file ./cypress.snapshot.config.js",
|
|
73
|
+
"clean": "rimraf out-tsc dist/*",
|
|
66
74
|
"format": "prettier src/**/*.scss --write",
|
|
67
75
|
"lint": "stylelint src/**/*.scss",
|
|
68
76
|
"lint:fix": "stylelint src/**/*.scss --fix",
|
|
69
|
-
"test": "jest --onlyChanged",
|
|
70
|
-
"styles:start": "gulp watch",
|
|
71
|
-
"styles:build": "gulp build",
|
|
72
77
|
"schematics:start": "copyfiles schematics/migrations.json dist && tsc -p tsconfig.schematics.json --watch",
|
|
73
78
|
"schematics:build": "copyfiles schematics/migrations.json dist && tsc -p tsconfig.schematics.json"
|
|
74
79
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
@use './../mixins/utilities';
|
|
11
11
|
@use './../mixins/icons' as icon-mixin;
|
|
12
|
-
@use './../functions/
|
|
12
|
+
@use './../functions/contrast' as contrast-fn;
|
|
13
13
|
@use './../placeholders/color' as color-ph;
|
|
14
14
|
@use './text';
|
|
15
15
|
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
@each $name, $color, $icon in alert.$alert-list {
|
|
96
|
-
$is-light-bg:
|
|
96
|
+
$is-light-bg: contrast-fn.light-or-dark($color) == "dark";
|
|
97
97
|
|
|
98
98
|
%notification-#{$name} {
|
|
99
99
|
@if ($is-light-bg) {
|
package/variables/_color.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use 'sass:list';
|
|
3
|
-
@use './../functions/
|
|
3
|
+
@use './../functions/contrast' as contrast-fn;
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Colors used by the post style guide
|
|
@@ -114,7 +114,7 @@ $background-colors: map.merge($background-colors, $accent-colors);
|
|
|
114
114
|
// Compile a list of dark backgrounds, used in the :is selector mixin at mixins/color
|
|
115
115
|
$dark-backgrounds: () !default;
|
|
116
116
|
@each $colorname, $color in $background-colors {
|
|
117
|
-
@if (
|
|
117
|
+
@if (contrast-fn.light-or-dark($color) == 'dark') {
|
|
118
118
|
$dark-backgrounds: list.append($dark-backgrounds, '.bg-#{$colorname}', $separator: comma);
|
|
119
119
|
}
|
|
120
120
|
}
|