dso-toolkit 84.1.0 → 86.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/dso.css +308 -365
  3. package/dist/dso.css.map +1 -1
  4. package/dist/dso.min.css +1 -1
  5. package/dist/dso.min.css.map +1 -1
  6. package/package.json +8 -8
  7. package/src/components/alert/alert.mixins.scss +5 -16
  8. package/src/components/alert/alert.scss +5 -8
  9. package/src/components/attachments-counter/attachments-counter.scss +2 -5
  10. package/src/components/badge/badge.mixins.scss +2 -6
  11. package/src/components/banner/banner.mixins.scss +4 -12
  12. package/src/components/breadcrumbs/breadcrumbs.mixins.scss +5 -7
  13. package/src/components/button/button.mixins.scss +33 -46
  14. package/src/components/button/button.variables.scss +1 -0
  15. package/src/components/context/context.scss +7 -10
  16. package/src/components/definition-list/definition-list.scss +1 -4
  17. package/src/components/delete/delete.mixins.scss +4 -8
  18. package/src/components/description/description.scss +2 -4
  19. package/src/components/document-header/document-header.scss +7 -15
  20. package/src/components/dropdown-menu/dropdown-menu.mixins.scss +9 -12
  21. package/src/components/dropdown-menu/dropdown-menu.scss +14 -26
  22. package/src/components/footer/footer.scss +5 -8
  23. package/src/components/form/form-group-collection.scss +2 -4
  24. package/src/components/form-control/form-control.mixins.scss +15 -17
  25. package/src/components/form-group/form-group.scss +4 -7
  26. package/src/components/form-group/select/form-group-select.scss +6 -9
  27. package/src/components/grid/grid.scss +3 -10
  28. package/src/components/heading/heading.mixins.scss +2 -6
  29. package/src/components/highlight-box/highlight-box.mixins.scss +3 -9
  30. package/src/components/highlight-box/highlight-box.scss +3 -6
  31. package/src/components/info/info.scss +2 -5
  32. package/src/components/insert/insert.mixins.scss +2 -4
  33. package/src/components/label/label.mixins.scss +4 -12
  34. package/src/components/link/link.mixins.scss +23 -10
  35. package/src/components/link-list/link-list.mixins.scss +1 -4
  36. package/src/components/link-list/link-list.scss +3 -6
  37. package/src/components/modal/modal.mixins.scss +10 -19
  38. package/src/components/modal/modal.scss +4 -7
  39. package/src/components/navbar/navbar.mixins.scss +9 -15
  40. package/src/components/search-bar/search-bar.scss +21 -31
  41. package/src/components/shopping-cart/shopping-cart.scss +15 -25
  42. package/src/components/viewer-grid/viewer-grid.scss +1 -4
  43. package/src/di.scss +6 -10
  44. package/src/global/functions/contrast-color.functions.scss +14 -11
  45. package/src/global/mixins/set-colors.mixin.scss +40 -40
@@ -99,16 +99,29 @@
99
99
  background-position: bottom 0 right 0;
100
100
  }
101
101
 
102
- $icon: if(
103
- map.has-key($link-map, "icon-color"),
104
- map.get($link-map, "icon") + "-" + map.get($link-map, "icon-color"),
105
- map.get($link-map, "icon")
106
- );
107
- $icon-hover: if(
108
- map.has-key($link-map, "icon-hover-color"),
109
- map.get($link-map, "icon") + "-" + map.get($link-map, "icon-hover-color"),
110
- map.get($link-map, "icon")
111
- );
102
+ $icon: map.get($link-map, "icon");
103
+
104
+ @if map.has-key($link-map, "icon-color") {
105
+ $icon: $icon + "-" + map.get($link-map, "icon-color");
106
+ }
107
+
108
+ $icon-hover: map.get($link-map, "icon");
109
+
110
+ @if map.has-key($link-map, "icon-hover-color") {
111
+ $icon-hover: $icon-hover + "-" + map.get($link-map, "icon-hover-color");
112
+ }
113
+
114
+ $icon: map.get($link-map, "icon");
115
+
116
+ @if map.has-key($link-map, "icon-color") {
117
+ $icon: $icon + "-" + map.get($link-map, "icon-color");
118
+ }
119
+
120
+ $icon-hover: map.get($link-map, "icon");
121
+
122
+ @if map.has-key($link-map, "icon-hover-color") {
123
+ $icon-hover: $icon-hover + "-" + map.get($link-map, "icon-hover-color");
124
+ }
112
125
 
113
126
  @include di.variant($icon);
114
127
 
@@ -36,10 +36,7 @@
36
36
  a {
37
37
  @include link.reverse();
38
38
 
39
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
40
- & {
41
- color: colors.$zwart;
42
- }
39
+ color: colors.$zwart;
43
40
 
44
41
  &:active {
45
42
  color: colors.$zwart;
@@ -10,12 +10,9 @@
10
10
  &::before {
11
11
  @include di.base("chevron-right");
12
12
 
13
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
14
- & {
15
- content: "";
16
- display: inline-block;
17
- margin-inline-start: units.$u1 * -1;
18
- }
13
+ content: "";
14
+ display: inline-block;
15
+ margin-inline-start: units.$u1 * -1;
19
16
  }
20
17
 
21
18
  &:active,
@@ -83,15 +83,12 @@
83
83
 
84
84
  @include rich-content.children();
85
85
 
86
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
87
- & {
88
- block-size: calc(100% - #{modal-variables.$body-padding * 2 + units.$u4} - 1.5rem);
89
- max-block-size: calc(#{modal-variables.$max-block-size} - #{$dso-body-unavailable-height + units.$u4} - 1.5em);
90
- min-block-size: 1.5rem;
91
- overflow-x: auto;
86
+ block-size: calc(100% - #{modal-variables.$body-padding * 2 + units.$u4} - 1.5rem);
87
+ max-block-size: calc(#{modal-variables.$max-block-size} - #{$dso-body-unavailable-height + units.$u4} - 1.5em);
88
+ min-block-size: 1.5rem;
89
+ overflow-x: auto;
92
90
 
93
- padding: modal-variables.$body-padding;
94
- }
91
+ padding: modal-variables.$body-padding;
95
92
  }
96
93
 
97
94
  > .dso-dialog > dso-scrollable {
@@ -106,10 +103,7 @@
106
103
  .dso-body {
107
104
  @include rich-content.children();
108
105
 
109
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
110
- & {
111
- padding: modal-variables.$body-padding;
112
- }
106
+ padding: modal-variables.$body-padding;
113
107
  }
114
108
  }
115
109
 
@@ -122,15 +116,12 @@
122
116
  .dso-footer {
123
117
  @include modal-wide-buttons();
124
118
 
125
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
126
- & {
127
- min-block-size: modal-variables.$footer-button-block-size + modal-variables.$footer-padding;
119
+ min-block-size: modal-variables.$footer-button-block-size + modal-variables.$footer-padding;
128
120
 
129
- padding-block: calc(modal-variables.$footer-padding / 2);
130
- padding-inline: modal-variables.$footer-padding;
121
+ padding-block: calc(modal-variables.$footer-padding / 2);
122
+ padding-inline: modal-variables.$footer-padding;
131
123
 
132
- text-align: end;
133
- }
124
+ text-align: end;
134
125
  }
135
126
 
136
127
  @media screen and (min-width: media-query-breakpoints.$screen-sm-min) {
@@ -1,6 +1,7 @@
1
1
  @use "../../variables/media-query-breakpoints";
2
2
  @use "../../variables/zindex";
3
3
  @use "../button";
4
+ @use "../icon";
4
5
  @use "../rich-content";
5
6
  @use "../modal";
6
7
 
@@ -21,14 +22,10 @@ body:has(dso-modal.hydrated) {
21
22
 
22
23
  .dso-close {
23
24
  &::before {
24
- @include di.base("times");
25
+ @include di.base("times", icon.$size, middle);
25
26
 
26
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
27
- & {
28
- content: "";
29
- display: inline-block;
30
- vertical-align: middle;
31
- }
27
+ content: "";
28
+ display: inline-block;
32
29
  }
33
30
  }
34
31
 
@@ -80,14 +80,11 @@
80
80
  > button {
81
81
  @include link.reverse();
82
82
 
83
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
84
- & {
85
- font-size: 1.25em;
86
- line-height: 1;
87
- margin-block-start: units.$u1;
88
- padding-block: units.$u1 #{units.$u1 - 1px};
89
- padding-inline: units.$u2;
90
- }
83
+ font-size: 1.25em;
84
+ line-height: 1;
85
+ margin-block-start: units.$u1;
86
+ padding-block: units.$u1 #{units.$u1 - 1px};
87
+ padding-inline: units.$u2;
91
88
  }
92
89
  }
93
90
  }
@@ -100,13 +97,10 @@
100
97
  > button {
101
98
  @include link.reverse();
102
99
 
103
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
104
- & {
105
- font-size: typography.$root-font-size-base;
106
- margin-block-start: (units.$u1 * 0.5);
107
- padding-block: (units.$u1 * 0.5) #{units.$u1 * 0.5 - 1px};
108
- padding-inline: units.$u1;
109
- }
100
+ font-size: typography.$root-font-size-base;
101
+ margin-block-start: (units.$u1 * 0.5);
102
+ padding-block: (units.$u1 * 0.5) #{units.$u1 * 0.5 - 1px};
103
+ padding-inline: units.$u1;
110
104
  }
111
105
  }
112
106
  }
@@ -33,12 +33,9 @@
33
33
  &::before {
34
34
  @include di.base("search");
35
35
 
36
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
37
- & {
38
- content: "";
39
- display: inline-block;
40
- font-size: 1rem;
41
- }
36
+ content: "";
37
+ display: inline-block;
38
+ font-size: 1rem;
42
39
  }
43
40
 
44
41
  + input,
@@ -50,25 +47,21 @@
50
47
  input {
51
48
  @include utilities.placeholder(colors.$input-color-placeholder);
52
49
 
53
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
54
- & {
55
- background-color: colors.$wit;
56
- background-image: none;
57
- border: 1px solid form-control.$focus-border-color;
58
- border-radius: 4px;
59
- border-width: 1px;
60
- box-shadow: none;
61
- display: block;
62
- font-size: typography.$root-font-size-base;
63
- block-size: css-search-bar-variables.$block-size;
64
- line-height: css-search-bar-variables.$block-size;
65
- padding-block: 6px;
66
- padding-inline: units.$u1 css-search-bar-variables.$block-size;
67
- transition:
68
- border-color ease-in-out 0.15s,
69
- box-shadow ease-in-out 0.15s;
70
- inline-size: 100%;
71
- }
50
+ background-color: colors.$wit;
51
+ background-image: none;
52
+ border: 1px solid form-control.$focus-border-color;
53
+ border-radius: 4px;
54
+ box-shadow: none;
55
+ display: block;
56
+ font-size: typography.$root-font-size-base;
57
+ block-size: css-search-bar-variables.$block-size;
58
+ line-height: css-search-bar-variables.$block-size;
59
+ padding-block: 6px;
60
+ padding-inline: units.$u1 css-search-bar-variables.$block-size;
61
+ transition:
62
+ border-color ease-in-out 0.15s,
63
+ box-shadow ease-in-out 0.15s;
64
+ inline-size: 100%;
72
65
 
73
66
  &:focus {
74
67
  border-color: form-control.$focus-border-color;
@@ -98,12 +91,9 @@
98
91
  &::before {
99
92
  @include di.base("times");
100
93
 
101
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
102
- & {
103
- content: "";
104
- display: inline-block;
105
- font-size: typography.$root-font-size-base;
106
- }
94
+ content: "";
95
+ display: inline-block;
96
+ font-size: typography.$root-font-size-base;
107
97
  }
108
98
  }
109
99
 
@@ -12,18 +12,15 @@
12
12
  .dso-status {
13
13
  @include set-colors.apply(colors.$grijs-5, "shopping-cart");
14
14
 
15
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
16
- & {
17
- border: 0;
18
- border-radius: css-shopping-cart-variables.$radius;
19
- box-shadow: none;
20
- display: block;
21
- font-weight: 600;
22
- padding-block: units.$u2;
23
- padding-inline: units.$u6;
24
- position: relative;
25
- text-align: start;
26
- }
15
+ border: 0;
16
+ border-radius: css-shopping-cart-variables.$radius;
17
+ box-shadow: none;
18
+ display: block;
19
+ font-weight: 600;
20
+ padding-block: units.$u2;
21
+ padding-inline: units.$u6;
22
+ position: relative;
23
+ text-align: start;
27
24
 
28
25
  dso-icon {
29
26
  @include utilities.transition(transform);
@@ -58,13 +55,9 @@
58
55
  .dso-contents {
59
56
  @include set-colors.apply(colors.$grijs-5, "shopping-cart");
60
57
 
61
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
62
- & {
63
- border: 0;
64
- border-radius: css-shopping-cart-variables.$radius;
65
- color: colors.$zwart;
66
- position: relative;
67
- }
58
+ border: 0;
59
+ border-radius: css-shopping-cart-variables.$radius;
60
+ position: relative;
68
61
 
69
62
  > .dso-delete {
70
63
  position: absolute;
@@ -87,12 +80,9 @@
87
80
 
88
81
  @include set-colors.apply(colors.$grijs-5, "shopping-cart");
89
82
 
90
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
91
- & {
92
- border-radius: css-shopping-cart-variables.$radius;
93
- margin-block-end: 0;
94
- margin-block-start: 0;
95
- }
83
+ border-radius: css-shopping-cart-variables.$radius;
84
+ margin-block-end: 0;
85
+ margin-block-start: 0;
96
86
 
97
87
  li {
98
88
  border-block-start: 1px solid css-shopping-cart-variables.$border-color;
@@ -25,9 +25,6 @@ dso-viewer-grid {
25
25
  .dso-toggle-main-button {
26
26
  @include button.tertiary($modifiers: false);
27
27
 
28
- // stylelint-disable-next-line no-duplicate-selectors -- needed to fix sass deprecation warnings: #2724
29
- & {
30
- padding-block: units.$u2;
31
- }
28
+ padding-block: units.$u2;
32
29
  }
33
30
  }
package/src/di.scss CHANGED
@@ -3,17 +3,13 @@
3
3
  @use "config";
4
4
 
5
5
  @mixin base($icon, $size: icon.$size, $vertical-align: icon.$vertical-align) {
6
- & {
7
- background: url("#{config.$icons-path}di.svg##{$icon}") no-repeat center;
8
- background-size: cover;
9
- block-size: $size;
10
- vertical-align: $vertical-align;
11
- inline-size: $size;
12
- }
6
+ background: url("#{config.$icons-path}di.svg##{$icon}") no-repeat center;
7
+ background-size: cover;
8
+ block-size: $size;
9
+ vertical-align: $vertical-align;
10
+ inline-size: $size;
13
11
  }
14
12
 
15
13
  @mixin variant($icon) {
16
- & {
17
- background-image: var(--_dso-di-background-image, url("#{config.$icons-path}di.svg##{$icon}"));
18
- }
14
+ background-image: var(--_dso-di-background-image, url("#{config.$icons-path}di.svg##{$icon}"));
19
15
  }
@@ -32,19 +32,22 @@
32
32
  }
33
33
 
34
34
  @function apply($color, $dark: colors.$contrast-dark, $light: colors.$contrast-light) {
35
- @if $color {
36
- $color-brightness: brightness($color);
37
- $light-text-brightness: brightness($light);
38
- $dark-text-brightness: brightness($dark);
39
-
40
- @return if(
41
- math.abs($color-brightness - $light-text-brightness) > math.abs($color-brightness - $dark-text-brightness),
42
- $light,
43
- $dark
44
- );
35
+ @if not $color {
36
+ @return null;
45
37
  }
46
38
 
47
- @return null;
39
+ $color-brightness: brightness($color);
40
+ $light-text-brightness: brightness($light);
41
+ $dark-text-brightness: brightness($dark);
42
+
43
+ $light-diff: math.abs($color-brightness - $light-text-brightness);
44
+ $dark-diff: math.abs($color-brightness - $dark-text-brightness);
45
+
46
+ @if $light-diff > $dark-diff {
47
+ @return $light;
48
+ }
49
+
50
+ @return $dark;
48
51
  }
49
52
 
50
53
  // Returns `true` if the given color is pure white.
@@ -26,54 +26,54 @@
26
26
  // Determines which sections of styles should be skipped to avoid overriding component-specific rules.
27
27
 
28
28
  @mixin apply($background-color, $self) {
29
- & {
30
- // run contrast-color function to determine WCAG-compliant text 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
- }
29
+ // run contrast-color function to determine WCAG-compliant text color
30
+ $contrast-color: contrast-color-functions.apply($background-color);
31
+ $is-white-bg: contrast-color-functions.is-white($background-color);
32
+ $is-dark-contrast: $contrast-color == colors.$contrast-dark;
33
+
34
+ @if $self != "alert" {
35
+ @if $is-white-bg {
36
+ --_dso-alert-success-border-color: initial;
37
+ --_dso-alert-error-border-color: initial;
38
+ --_dso-alert-info-border-color: initial;
39
+ --_dso-alert-warning-border-color: initial;
40
+ } @else {
41
+ --_dso-alert-success-border-color: #{states.$success-compact-accent-color};
42
+ --_dso-alert-error-border-color: #{states.$danger-compact-accent-color};
43
+ --_dso-alert-info-border-color: #{states.$info-compact-accent-color};
44
+ --_dso-alert-warning-border-color: #{states.$warning-compact-accent-color};
45
45
  }
46
+ }
46
47
 
47
- @if $self != "link" {
48
- @if not contrast-color-functions.is-white($background-color) {
49
- --link-color: currentColor;
50
- --link-hover-color: currentColor;
51
- --link-visited-color: currentColor;
48
+ @if $self != "link" and not $is-white-bg {
49
+ --link-color: currentColor;
50
+ --link-hover-color: currentColor;
51
+ --link-visited-color: currentColor;
52
52
 
53
- // set according to contrast color determined by contrast-color function
54
- $icon-color: if($contrast-color == colors.$contrast-dark, "zwart", "wit");
53
+ // set according to contrast color determined by contrast-color function
54
+ $icon-color: "wit";
55
55
 
56
- @include _linkIconColors($icon-color);
57
- }
56
+ @if $contrast-color == colors.$contrast-dark {
57
+ $icon-color: "zwart";
58
58
  }
59
59
 
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
- }
70
- }
71
- }
60
+ @include _linkIconColors($icon-color);
61
+ }
72
62
 
73
- // set css properties
74
- background-color: $background-color;
75
- color: $contrast-color;
63
+ @if $self != "icon-button" and not $is-white-bg {
64
+ @if $is-dark-contrast {
65
+ --_dso-icon-button-tertiary-color: #{colors.$grijs-90};
66
+ --_dso-icon-button-tertiary-hover-color: #{colors.$grijs-70};
67
+ --_dso-icon-button-tertiary-active-color: #{colors.$bosgroen-140};
68
+ --_dso-icon-button-tertiary-disabled-color: #{colors.$grijs-40};
69
+ } @else if $contrast-color == colors.$contrast-light {
70
+ --_dso-icon-button-tertiary-color: #{colors.$wit};
71
+ }
76
72
  }
73
+
74
+ // set css properties
75
+ background-color: $background-color;
76
+ color: $contrast-color;
77
77
  }
78
78
 
79
79
  @mixin _linkIconColors($icon-color) {