dso-toolkit 79.0.1 → 80.0.0
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/CHANGELOG.md +29 -0
- package/dist/dso-icons.svg +14 -12
- package/dist/dso.css +917 -317
- package/dist/dso.css.map +1 -1
- package/dist/dso.min.css +1 -1
- package/dist/dso.min.css.map +1 -1
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/src/components/alert/alert.mixins.scss +73 -32
- package/src/components/alert/alert.scss +19 -78
- package/src/components/alert/alert.variables.scss +1 -0
- package/src/components/badge/badge.mixins.scss +18 -9
- package/src/components/banner/banner.mixins.scss +20 -4
- package/src/components/button/button.mixins.scss +8 -0
- package/src/components/button/button.variables.scss +1 -0
- package/src/components/delete/delete.mixins.scss +1 -1
- package/src/components/document-header/document-header.scss +3 -3
- package/src/components/footer/footer.scss +1 -1
- package/src/components/highlight-box/highlight-box.mixins.scss +9 -5
- package/src/components/info/info.mixins.scss +2 -11
- package/src/components/info/info.scss +9 -0
- package/src/components/insert/insert.mixins.scss +1 -1
- package/src/components/label/label.mixins.scss +9 -32
- package/src/components/label/label.scss +27 -0
- package/src/components/shopping-cart/shopping-cart.scss +3 -3
- package/src/components/table/table.scss +6 -1
- package/src/dso.scss +0 -1
- package/src/global/functions/contrast-color.functions.scss +9 -1
- package/src/global/mixins/set-colors.mixin.scss +51 -37
- package/src/components/legend-item/legend-item.scss +0 -15
- package/src/components/legend-item/legend-item.variables.scss +0 -7
|
@@ -2,67 +2,81 @@
|
|
|
2
2
|
@use "sass:color";
|
|
3
3
|
|
|
4
4
|
@use "../../variables/colors";
|
|
5
|
+
@use "../../variables/states";
|
|
5
6
|
@use "../../components/link/link.variables" as link-variables;
|
|
6
7
|
@use "../../components/button/button.variables" as button-variables;
|
|
7
8
|
@use "../../di";
|
|
8
9
|
|
|
9
|
-
@use "../functions/contrast-color.functions" as contrast-color;
|
|
10
|
+
@use "../functions/contrast-color.functions" as contrast-color-functions;
|
|
10
11
|
|
|
11
|
-
//
|
|
12
|
-
// ==========
|
|
13
|
-
// USAGE: @include setColors($bgcolor, $bordercolor: transparent, $links: true);
|
|
14
|
-
// $background-color: background color of the element (required)
|
|
15
|
-
// $border-color: border color of the element (optional)
|
|
16
|
-
// $icons: boolean to set link icon colors according to background color (optional). set to false if you don't want to change the link icon colors.
|
|
17
|
-
// $links: boolean to set link colors according to background color (optional). set to false if you don't want to change the link colors.
|
|
18
|
-
// $reverse: in case the combination chosen by this mixin & contrast-color function still does not meet WCAG requirements, set $reverse to true. If this combination does not comply either, find another background-color.
|
|
12
|
+
// Automatically applies accessible (WCAG-compliant) text and UI colors based on a given background color.
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
// This mixin determines an appropriate contrast color for text (`light` or `dark`)
|
|
15
|
+
// and dynamically adjusts related colors for links, icons, alerts, and buttons
|
|
16
|
+
// to ensure consistent readability and sufficient contrast across different backgrounds.
|
|
17
|
+
// Automatically applies accessible (WCAG-compliant) text and UI colors
|
|
18
|
+
// based on a provided background color. Adjusts related UI elements via custom css props to ensure consistent
|
|
19
|
+
// readability.
|
|
20
|
+
|
|
21
|
+
// @param {Color} $background-color
|
|
22
|
+
// The background color used to compute contrast colors.
|
|
23
|
+
|
|
24
|
+
// @param {String} $self
|
|
25
|
+
// The context of the component using this mixin (e.g., "alert", "link", "button").
|
|
26
|
+
// Determines which sections of styles should be skipped to avoid overriding component-specific rules.
|
|
27
|
+
|
|
28
|
+
@mixin apply($background-color, $self) {
|
|
22
29
|
& {
|
|
23
30
|
// run contrast-color function to determine WCAG-compliant text color
|
|
24
|
-
$contrast-color: contrast-color.apply($background-color);
|
|
31
|
+
$contrast-color: contrast-color-functions.apply($background-color);
|
|
32
|
+
|
|
33
|
+
@if $self != "alert" {
|
|
34
|
+
@if contrast-color-functions.is-white($background-color) {
|
|
35
|
+
--_dso-alert-success-border-color: initial;
|
|
36
|
+
--_dso-alert-error-border-color: initial;
|
|
37
|
+
--_dso-alert-info-border-color: initial;
|
|
38
|
+
--_dso-alert-warning-border-color: initial;
|
|
39
|
+
} @else {
|
|
40
|
+
--_dso-alert-success-border-color: #{states.$success-compact-accent-color};
|
|
41
|
+
--_dso-alert-error-border-color: #{states.$danger-compact-accent-color};
|
|
42
|
+
--_dso-alert-info-border-color: #{states.$info-compact-accent-color};
|
|
43
|
+
--_dso-alert-warning-border-color: #{states.$warning-compact-accent-color};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
25
46
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@if $links == true {
|
|
47
|
+
@if $self != "link" {
|
|
48
|
+
@if not contrast-color-functions.is-white($background-color) {
|
|
29
49
|
--link-color: currentColor;
|
|
30
50
|
--link-hover-color: currentColor;
|
|
31
51
|
--link-visited-color: currentColor;
|
|
32
|
-
}
|
|
33
52
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
$icon-color: "wit";
|
|
53
|
+
// set according to contrast color determined by contrast-color function
|
|
54
|
+
$icon-color: if($contrast-color == colors.$contrast-dark, "zwart", "wit");
|
|
55
|
+
|
|
56
|
+
@include _linkIconColors($icon-color);
|
|
39
57
|
}
|
|
58
|
+
}
|
|
40
59
|
|
|
41
|
-
|
|
42
|
-
@if
|
|
43
|
-
$
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
@if $self != "icon-button" {
|
|
61
|
+
@if not contrast-color-functions.is-white($background-color) {
|
|
62
|
+
@if $contrast-color == colors.$contrast-dark {
|
|
63
|
+
--_dso-icon-button-tertiary-color: #{colors.$grijs-90};
|
|
64
|
+
--_dso-icon-button-tertiary-hover-color: #{colors.$grijs-70};
|
|
65
|
+
--_dso-icon-button-tertiary-active-color: #{colors.$bosgroen-140};
|
|
66
|
+
--_dso-icon-button-tertiary-disabled-color: #{colors.$grijs-40};
|
|
67
|
+
} @else if $contrast-color == colors.$contrast-light {
|
|
68
|
+
--_dso-icon-button-tertiary-color: #{colors.$wit};
|
|
69
|
+
}
|
|
48
70
|
}
|
|
49
71
|
}
|
|
50
72
|
|
|
51
73
|
// set css properties
|
|
52
74
|
background-color: $background-color;
|
|
53
|
-
border-color: if($border-color, $border-color, $background-color);
|
|
54
75
|
color: $contrast-color;
|
|
55
|
-
|
|
56
|
-
// implement icon color according to background color
|
|
57
|
-
@if $icon-color and $icons == true {
|
|
58
|
-
@include _anchorIconColors($icon-color);
|
|
59
|
-
}
|
|
60
76
|
}
|
|
61
77
|
}
|
|
62
78
|
|
|
63
|
-
|
|
64
|
-
// ==================
|
|
65
|
-
@mixin _anchorIconColors($icon-color) {
|
|
79
|
+
@mixin _linkIconColors($icon-color) {
|
|
66
80
|
// loop through map to set icon mode
|
|
67
81
|
@each $mode, $value in link-variables.$linkIcons {
|
|
68
82
|
$selector: map.get($value, "selector");
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
@use "legend-item.variables" as legend-item-variables;
|
|
2
|
-
@use "../../global/mixins/symbol.mixins" as symbol-mixins;
|
|
3
|
-
|
|
4
|
-
dso-legend-item {
|
|
5
|
-
span[slot="symbol"] {
|
|
6
|
-
@include symbol-mixins.symbolContainer(
|
|
7
|
-
legend-item-variables.$symbol-block-size,
|
|
8
|
-
legend-item-variables.$symbol-inline-size
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
> span {
|
|
12
|
-
@include symbol-mixins.symbol();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|