dso-toolkit 98.0.0 → 99.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 (34) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +2 -2
  3. package/dist/dso.css +219 -1186
  4. package/dist/dso.css.map +1 -1
  5. package/dist/dso.min.css +1 -1
  6. package/dist/dso.min.css.map +1 -1
  7. package/package.json +11 -13
  8. package/src/components/button/button.mixins.scss +1 -2
  9. package/src/components/button/button.scss +26 -33
  10. package/src/components/context/context.scss +1 -1
  11. package/src/components/document-header/document-header.scss +1 -1
  12. package/src/components/form-group/select/form-group-select.scss +1 -1
  13. package/src/components/grid/grid.scss +7 -7
  14. package/src/components/link/link.mixins.scss +24 -31
  15. package/src/components/link-list/link-list.mixins.scss +2 -0
  16. package/src/components/link-list/link-list.scss +3 -3
  17. package/src/components/rich-content/rich-content.mixins.scss +1 -2
  18. package/src/di-inline.scss +89 -0
  19. package/src/di.scss +1 -1
  20. package/src/dso.scss +3 -3
  21. package/src/global/custom-properties.scss +3 -3
  22. package/src/global/mixins/set-colors.mixin.scss +19 -25
  23. package/src/global/spacing.scss +2 -5
  24. package/src/{components/icon/icon.variables.scss → variables/icon.scss} +1 -1
  25. package/src/components/dropdown-menu/_index.scss +0 -2
  26. package/src/components/dropdown-menu/dropdown-menu.mixins.scss +0 -135
  27. package/src/components/dropdown-menu/dropdown-menu.scss +0 -150
  28. package/src/components/dropdown-menu/dropdown-menu.variables.scss +0 -6
  29. package/src/components/highlight-box/_index.scss +0 -2
  30. package/src/components/highlight-box/highlight-box.mixins.scss +0 -132
  31. package/src/components/highlight-box/highlight-box.scss +0 -108
  32. package/src/components/highlight-box/highlight-box.variables.scss +0 -4
  33. package/src/components/highlight-box/readme.md +0 -1
  34. package/src/components/icon/_index.scss +0 -1
@@ -1,11 +1,12 @@
1
1
  @use "sass:map";
2
2
 
3
- @use "../../di";
3
+ @use "../../di-inline";
4
4
  @use "../../variables/units";
5
5
  @use "link.variables" as link-variables;
6
6
 
7
7
  @mixin hideIcons() {
8
- --_dso-di-background-image: none;
8
+ --_dso-link-icon-visibility: none;
9
+
9
10
  --_dso-link-icon-padding-inline-start: 0;
10
11
  --_dso-link-icon-padding-inline-end: 0;
11
12
  }
@@ -13,7 +14,7 @@
13
14
  @mixin pseudo() {
14
15
  &:hover,
15
16
  &:focus-visible {
16
- color: var(--link-hover-color);
17
+ color: var(--_dso-link-hover-color);
17
18
  text-decoration: underline;
18
19
  }
19
20
 
@@ -25,7 +26,7 @@
25
26
  @mixin root($is-html-a-element: true) {
26
27
  overflow-wrap: anywhere;
27
28
  background-color: transparent;
28
- color: var(--link-color);
29
+ color: var(--_dso-link-color);
29
30
  text-decoration: underline;
30
31
  text-underline-offset: link-variables.$link-underline-offset;
31
32
 
@@ -37,7 +38,7 @@
37
38
 
38
39
  @if ($is-html-a-element) {
39
40
  &:visited {
40
- color: var(--link-visited-color);
41
+ color: var(--_dso-link-visited-color);
41
42
  }
42
43
  } @else {
43
44
  cursor: pointer;
@@ -70,12 +71,12 @@
70
71
  @mixin linkIcons() {
71
72
  @each $mode, $value in link-variables.$linkIcons {
72
73
  &#{map.get($value, "selector")} {
73
- @include _mode-base($value);
74
+ @include _mode-base($value, $mode);
74
75
  }
75
76
  }
76
77
  }
77
78
 
78
- @mixin _mode-base($link-map) {
79
+ @mixin _mode-base($link-map, $mode) {
79
80
  $icon-placement: map.get($link-map, "icon-placement");
80
81
 
81
82
  @if $icon-placement != "after" and $icon-placement != "before" {
@@ -95,52 +96,44 @@
95
96
  background-position: bottom -3px right 0;
96
97
  }
97
98
 
98
- $icon: map.get($link-map, "icon");
99
-
100
- @if map.has-key($link-map, "icon-color") {
101
- $icon: $icon + "-" + map.get($link-map, "icon-color");
102
- }
103
-
104
- $icon-hover: map.get($link-map, "icon");
99
+ $key: map.get($link-map, "icon");
105
100
 
106
- @if map.has-key($link-map, "icon-hover-color") {
107
- $icon-hover: $icon-hover + "-" + map.get($link-map, "icon-hover-color");
108
- }
109
-
110
- $icon: map.get($link-map, "icon");
101
+ $icon-color: "grasgroen";
111
102
 
112
103
  @if map.has-key($link-map, "icon-color") {
113
- $icon: $icon + "-" + map.get($link-map, "icon-color");
104
+ $icon-color: map.get($link-map, "icon-color");
114
105
  }
115
106
 
116
- $icon-hover: map.get($link-map, "icon");
107
+ background-image: var(
108
+ --_dso-link-icon-visibility,
109
+ var(--_dso-link-#{$mode}-icon, var(#{di-inline.custom-property($key, $icon-color)}))
110
+ );
117
111
 
118
112
  @if map.has-key($link-map, "icon-hover-color") {
119
- $icon-hover: $icon-hover + "-" + map.get($link-map, "icon-hover-color");
120
- }
121
-
122
- @include di.variant($icon);
113
+ $icon-hover-color: map.get($link-map, "icon-hover-color");
123
114
 
124
- @if ($icon != $icon-hover) {
125
115
  &:hover,
126
116
  &:focus-visible {
127
- @include di.variant($icon-hover);
117
+ background-image: var(
118
+ --_dso-link-icon-visibility,
119
+ var(--_dso-link-#{$mode}-icon, var(#{di-inline.custom-property($key, $icon-hover-color)}))
120
+ );
128
121
  }
129
122
  }
130
123
  }
131
124
 
132
125
  @mixin mode-download() {
133
- @include _mode-base(map.get(link-variables.$linkIcons, "download"));
126
+ @include _mode-base(map.get(link-variables.$linkIcons, "download"), "download");
134
127
  }
135
128
 
136
129
  @mixin mode-extern() {
137
- @include _mode-base(map.get(link-variables.$linkIcons, "extern"));
130
+ @include _mode-base(map.get(link-variables.$linkIcons, "extern"), "extern");
138
131
  }
139
132
 
140
133
  @mixin mode-phone() {
141
- @include _mode-base(map.get(link-variables.$linkIcons, "phone"));
134
+ @include _mode-base(map.get(link-variables.$linkIcons, "phone"), "phone");
142
135
  }
143
136
 
144
137
  @mixin mode-email() {
145
- @include _mode-base(map.get(link-variables.$linkIcons, "mail"));
138
+ @include _mode-base(map.get(link-variables.$linkIcons, "mail"), "mail");
146
139
  }
@@ -7,6 +7,8 @@
7
7
  @mixin root() {
8
8
  @include list.unstyled();
9
9
 
10
+ margin-block-end: var(--_dso-link-list-margin-block-end, units.$u2);
11
+
10
12
  li {
11
13
  margin-block-end: units.$u2;
12
14
 
@@ -1,14 +1,14 @@
1
1
  @use "../../variables/units";
2
2
  @use "../link-list";
3
3
 
4
- @use "../../di";
4
+ @use "../../di-inline";
5
5
 
6
6
  .dso-link-list {
7
7
  @include link-list.root();
8
8
 
9
9
  a {
10
10
  &::before {
11
- @include di.base("chevron-right");
11
+ @include di-inline.base("chevron-right", "grasgroen", $override-property: --_dso-link-list-chevron-icon);
12
12
 
13
13
  content: "";
14
14
  display: inline-block;
@@ -19,7 +19,7 @@
19
19
  &:focus,
20
20
  &:hover {
21
21
  &::before {
22
- @include di.variant("chevron-right-scampi");
22
+ @include di-inline.variant("chevron-right", "scampi", $override-property: --_dso-link-list-chevron-icon);
23
23
  }
24
24
  }
25
25
  }
@@ -32,8 +32,7 @@
32
32
  padding-inline: typography.$line-height-computed;
33
33
  }
34
34
 
35
- dso-highlight-box,
36
- .dso-highlight-box {
35
+ dso-highlight-box {
37
36
  margin-block-end: typography.$line-height-computed;
38
37
  }
39
38
 
@@ -0,0 +1,89 @@
1
+ @use "sass:map";
2
+ @use "sass:string";
3
+
4
+ @use "variables/colors";
5
+ @use "variables/icon" as icon-variables;
6
+
7
+ @forward "variables/icon";
8
+
9
+ $colors: (
10
+ "grasgroen": colors.$grasgroen,
11
+ "scampi": colors.$scampi,
12
+ "zwart": colors.$zwart,
13
+ "wit": colors.$wit,
14
+ "bosgroen": colors.$bosgroen,
15
+ "grasgroen-40": colors.$grasgroen-40,
16
+ );
17
+
18
+ $icons: (
19
+ "download": (
20
+ "grasgroen",
21
+ "scampi",
22
+ "zwart",
23
+ "wit",
24
+ "bosgroen",
25
+ "grasgroen-40",
26
+ ),
27
+ "external-link": (
28
+ "grasgroen",
29
+ "scampi",
30
+ "zwart",
31
+ "wit",
32
+ "bosgroen",
33
+ "grasgroen-40",
34
+ ),
35
+ "call": (
36
+ "grasgroen",
37
+ "scampi",
38
+ "zwart",
39
+ "wit",
40
+ ),
41
+ "mail-outline": (
42
+ "grasgroen",
43
+ "scampi",
44
+ "zwart",
45
+ "wit",
46
+ ),
47
+ "chevron-right": (
48
+ "grasgroen",
49
+ "scampi",
50
+ "zwart",
51
+ ),
52
+ );
53
+
54
+ @function custom-property($icon, $color) {
55
+ @return string.unquote("--_dso-di-#{$icon}-#{$color}");
56
+ }
57
+
58
+ @mixin variant($icon, $color, $override-property: null) {
59
+ @if $override-property {
60
+ background-image: var(#{$override-property}, var(#{custom-property($icon, $color)}));
61
+ } @else {
62
+ background-image: var(#{custom-property($icon, $color)});
63
+ }
64
+ }
65
+
66
+ @mixin base($icon, $color, $override-property: null) {
67
+ @include variant($icon, $color, $override-property);
68
+
69
+ background-repeat: no-repeat;
70
+ background-position: center;
71
+ background-size: cover;
72
+ block-size: icon-variables.$size;
73
+ inline-size: icon-variables.$size;
74
+ vertical-align: icon-variables.$vertical-align;
75
+ }
76
+
77
+ @mixin inline-icons() {
78
+ :root {
79
+ @each $icon, $color-names in $icons {
80
+ @each $color-name in $color-names {
81
+ @if not map.has-key($colors, $color-name) {
82
+ @error "di-inline: kleur '#{$color-name}' voor icoon '#{$icon}' ontbreekt in $colors.";
83
+ }
84
+
85
+ #{custom-property($icon, $color-name)}: #{inline-icon-DI-ONLY($icon, "#{map.get($colors, $color-name)}")};
86
+ }
87
+ }
88
+ }
89
+ }
package/src/di.scss CHANGED
@@ -1,4 +1,4 @@
1
- @use "components/icon";
1
+ @use "variables/icon";
2
2
 
3
3
  @use "config";
4
4
 
package/src/dso.scss CHANGED
@@ -1,4 +1,5 @@
1
1
  @use "toolkit-version";
2
+ @use "di-inline";
2
3
 
3
4
  // Global
4
5
  @use "global/font-faces";
@@ -24,7 +25,6 @@
24
25
  @use "components/document-component-list/document-component-list";
25
26
  @use "components/document-component/document-component";
26
27
  @use "components/document-header/document-header";
27
- @use "components/dropdown-menu/dropdown-menu";
28
28
  @use "components/field-label/field-label";
29
29
  @use "components/fieldset/fieldset";
30
30
  @use "components/footer/footer";
@@ -35,9 +35,7 @@
35
35
  @use "components/form-group/form-group";
36
36
  @use "components/grid/grid";
37
37
  @use "components/heading/heading";
38
- @use "components/highlight-box/highlight-box";
39
38
  @use "components/horizontal-rule/horizontal-rule";
40
- @use "components/icon";
41
39
  @use "components/image/image";
42
40
  @use "components/info/info";
43
41
  @use "components/input/input";
@@ -71,4 +69,6 @@
71
69
  // Very global and generic styling
72
70
  @use "utilities" as utilities-mixins;
73
71
 
72
+ @include di-inline.inline-icons();
73
+
74
74
  @include utilities-mixins.box-sizing();
@@ -1,7 +1,7 @@
1
1
  @use "../components/link/link.variables.scss" as link-variables;
2
2
 
3
3
  :root {
4
- --link-color: #{link-variables.$link-color};
5
- --link-hover-color: #{link-variables.$link-hover-color};
6
- --link-visited-color: #{link-variables.$link-visited-color};
4
+ --_dso-link-color: #{link-variables.$link-color};
5
+ --_dso-link-hover-color: #{link-variables.$link-hover-color};
6
+ --_dso-link-visited-color: #{link-variables.$link-visited-color};
7
7
  }
@@ -3,9 +3,8 @@
3
3
 
4
4
  @use "../../variables/colors";
5
5
  @use "../../variables/states";
6
+ @use "../../di-inline";
6
7
  @use "../../components/link/link.variables" as link-variables;
7
- @use "../../components/button/button.variables" as button-variables;
8
- @use "../../di";
9
8
 
10
9
  @use "../functions/contrast-color.functions" as contrast-color-functions;
11
10
 
@@ -31,6 +30,12 @@
31
30
  $is-white-bg: contrast-color-functions.is-white($background-color);
32
31
  $is-dark-contrast: $contrast-color == colors.$contrast-dark;
33
32
 
33
+ $icon-color: "wit";
34
+
35
+ @if $is-dark-contrast {
36
+ $icon-color: "zwart";
37
+ }
38
+
34
39
  @if $self != "alert" {
35
40
  @if $is-white-bg {
36
41
  --_dso-alert-success-border-color: initial;
@@ -46,18 +51,17 @@
46
51
  }
47
52
 
48
53
  @if $self != "link" and not $is-white-bg {
49
- --link-color: currentColor;
50
- --link-hover-color: currentColor;
51
- --link-visited-color: currentColor;
54
+ --_dso-link-color: currentColor;
55
+ --_dso-link-hover-color: currentColor;
56
+ --_dso-link-visited-color: currentColor;
52
57
 
53
- // set according to contrast color determined by contrast-color function
54
- $icon-color: "wit";
55
-
56
- @if $contrast-color == colors.$contrast-dark {
57
- $icon-color: "zwart";
58
+ @each $mode, $cfg in link-variables.$linkIcons {
59
+ --_dso-link-#{$mode}-icon: var(#{di-inline.custom-property(map.get($cfg, "icon"), $icon-color)});
58
60
  }
61
+ }
59
62
 
60
- @include _linkIconColors($icon-color);
63
+ @if $self != "link-list" and not $is-white-bg {
64
+ --_dso-link-list-chevron-icon: var(#{di-inline.custom-property("chevron-right", $icon-color)});
61
65
  }
62
66
 
63
67
  @if $self != "icon-button" and not $is-white-bg {
@@ -88,7 +92,10 @@
88
92
  }
89
93
  }
90
94
 
91
- @if self != "button" and not $is-white-bg {
95
+ @if $self != "button" and not $is-white-bg {
96
+ --_dso-button-tertiary-download-icon: var(#{di-inline.custom-property("download", $icon-color)});
97
+ --_dso-button-tertiary-external-link-icon: var(#{di-inline.custom-property("external-link", $icon-color)});
98
+
92
99
  @if $is-dark-contrast {
93
100
  --_dso-button-tertiary-color: #{colors.$grijs-90};
94
101
  --_dso-button-tertiary-hover-color: #{colors.$grijs-70};
@@ -130,16 +137,3 @@
130
137
  background-color: $background-color;
131
138
  color: $contrast-color;
132
139
  }
133
-
134
- @mixin _linkIconColors($icon-color) {
135
- // loop through map to set icon mode
136
- @each $mode, $value in link-variables.$linkIcons {
137
- $selector: map.get($value, "selector");
138
- $icon: map.get($value, "icon") + "-" + $icon-color;
139
-
140
- a:not(#{button-variables.$buttons}):is(#{$selector}, #{$selector}:hover, #{$selector}:focus-visible) {
141
- // set icon color
142
- @include di.variant($icon);
143
- }
144
- }
145
- }
@@ -15,8 +15,7 @@
15
15
  // within dso-highlight-box, create space for dso-button-row when preceded and/or followed by other elements
16
16
  // ---------------------------------------------------------------------------------------------------------
17
17
  // To Do: integrate this with things to come within this file, and remove the wildcard!
18
- :where(dso-highlight-box),
19
- :where(.dso-highlight-box) {
18
+ :where(dso-highlight-box) {
20
19
  :where(.dso-button-row) {
21
20
  margin-block: 0;
22
21
  }
@@ -104,9 +103,7 @@ $spacers: (
104
103
  ),
105
104
  (
106
105
  space: units.$block-spacing-medium,
107
- predecessors: (
108
- ".dso-app-heading",
109
- ),
106
+ predecessors: (".dso-app-heading"),
110
107
  successors: (
111
108
  ".dso-context-wrapper",
112
109
  "dso-tabs",
@@ -1,4 +1,4 @@
1
- @use "../../variables/units";
1
+ @use "units";
2
2
 
3
3
  $size: units.$u3;
4
4
  $vertical-align: top;
@@ -1,2 +0,0 @@
1
- @forward "dropdown-menu.mixins";
2
- @forward "dropdown-menu.variables";
@@ -1,135 +0,0 @@
1
- @use "sass:math";
2
-
3
- @use "../../variables/units";
4
- @use "../../variables/colors";
5
- @use "../../variables/scaffolding";
6
- @use "../../variables/typography";
7
- @use "../../variables/zindex";
8
-
9
- @use "../link";
10
-
11
- @use "dropdown-menu.variables" as dropdown-menu-variables;
12
-
13
- @mixin root() {
14
- display: inline-block;
15
- }
16
-
17
- @mixin children() {
18
- > button:not(.dso-primary):not(.dso-secondary):not(.dso-tertiary),
19
- > .dso-primary,
20
- > .dso-secondary,
21
- > .dso-tertiary {
22
- position: relative;
23
-
24
- &::after {
25
- content: "";
26
- display: inline-block;
27
- }
28
- }
29
-
30
- > .dso-primary,
31
- > .dso-secondary {
32
- &::after {
33
- margin-inline-start: units.$u1;
34
- }
35
- }
36
-
37
- .dso-group-label {
38
- color: colors.$grijs-40;
39
- font-size: (math.div(14, 16) * 1em);
40
- font-weight: 400;
41
- margin: 0;
42
- padding-block: (units.$u1 * 0.5) (units.$u1 * 0.25);
43
- padding-inline: dropdown-menu-variables.$inline-padding;
44
- text-transform: uppercase;
45
- }
46
-
47
- ul {
48
- margin: 0;
49
- padding: 0;
50
-
51
- &:not(:last-child) {
52
- border-block-end: 1px solid colors.$grijs-10;
53
- margin-block-end: 11px;
54
- padding-block-end: 11px;
55
- }
56
- }
57
-
58
- .dso-dropdown-options {
59
- background-clip: padding-box;
60
- background-color: dropdown-menu-variables.$background-color;
61
- border-radius: scaffolding.$border-radius-base;
62
- border: 1px solid dropdown-menu-variables.$border-color;
63
- box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.4);
64
- font-size: typography.$root-font-size-base;
65
- min-inline-size: 160px;
66
- padding-block: 5px;
67
- padding-inline: 0;
68
- z-index: zindex.$dropdown-options;
69
-
70
- li {
71
- list-style: none;
72
-
73
- a {
74
- &:visited {
75
- color: dropdown-menu-variables.$link-color;
76
- }
77
- }
78
-
79
- a,
80
- button {
81
- @include link.reverse();
82
-
83
- clear: both;
84
- color: dropdown-menu-variables.$link-color;
85
- display: block;
86
- font-weight: 400;
87
- line-height: 1.5;
88
- padding-block: 3px;
89
- padding-inline: dropdown-menu-variables.$inline-padding;
90
- text-decoration: none;
91
- white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- We don't want wrapping in Dropdown items
92
-
93
- &:hover,
94
- &:focus {
95
- background-color: colors.$grasgroen;
96
- border-color: colors.$grasgroen;
97
- color: colors.$wit;
98
- text-decoration: none;
99
- }
100
- }
101
-
102
- button {
103
- background-color: transparent;
104
- border: 0;
105
- border-radius: 0;
106
- text-align: inherit;
107
- inline-size: 100%;
108
- }
109
- }
110
- }
111
- }
112
-
113
- @mixin checkable() {
114
- .dso-group-label {
115
- padding-inline-start: units.$u5;
116
- }
117
-
118
- li {
119
- a,
120
- button {
121
- padding-inline-start: units.$u5;
122
- }
123
-
124
- &.dso-checked {
125
- a,
126
- button {
127
- &:not(:focus) {
128
- background-color: colors.$grasgroen;
129
- border-color: colors.$grasgroen;
130
- color: colors.$wit;
131
- }
132
- }
133
- }
134
- }
135
- }