dso-toolkit 62.10.0 → 62.12.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 (59) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/assets/fonts/Asap/Asap-Italic-VariableFont_wdth,wght.ttf +0 -0
  3. package/assets/fonts/Asap/Asap-VariableFont_wdth,wght.ttf +0 -0
  4. package/dist/dso-icons.svg +315 -259
  5. package/dist/dso.css +799 -331
  6. package/dist/dso.css.map +1 -1
  7. package/dist/dso.min.css +1 -1
  8. package/dist/dso.min.css.map +1 -1
  9. package/package.json +1 -1
  10. package/src/components/action-list/action-list.scss +6 -0
  11. package/src/components/alert/alert.mixins.scss +20 -33
  12. package/src/components/alert/alert.scss +0 -28
  13. package/src/components/alert/alert.variables.scss +0 -4
  14. package/src/components/anchor/anchor.mixins.scss +43 -36
  15. package/src/components/anchor/anchor.scss +2 -17
  16. package/src/components/anchor/anchor.variables.scss +30 -0
  17. package/src/components/badge/badge.mixins.scss +14 -27
  18. package/src/components/banner/banner.mixins.scss +5 -14
  19. package/src/components/banner/banner.scss +0 -10
  20. package/src/components/banner/banner.variables.scss +0 -4
  21. package/src/components/delete/delete.mixins.scss +3 -6
  22. package/src/components/document-header/document-header.scss +3 -6
  23. package/src/components/footer/footer.scss +4 -19
  24. package/src/components/form/form-buttons/form-buttons.scss +43 -15
  25. package/src/components/form/form-explanation.scss +25 -0
  26. package/src/components/form/form-groups/files/form-group-files.scss +88 -22
  27. package/src/components/form/form.mixins.scss +1 -3
  28. package/src/components/form/form.scss +1 -0
  29. package/src/components/grid/grid.scss +28 -7
  30. package/src/components/highlight-box/highlight-box.mixins.scss +27 -22
  31. package/src/components/highlight-box/highlight-box.scss +29 -3
  32. package/src/components/info/info.mixins.scss +3 -2
  33. package/src/components/insert/insert.mixins.scss +3 -6
  34. package/src/components/label/label.mixins.scss +13 -18
  35. package/src/components/list-button/list-button.mixins.scss +5 -0
  36. package/src/components/modal/modal.mixins.scss +2 -2
  37. package/src/components/shopping-cart/shopping-cart.scss +6 -3
  38. package/src/components/step-counter/step-counter.mixins.scss +8 -14
  39. package/src/components/whitebox/whitebox.mixins.scss +9 -0
  40. package/src/global/font-faces.scss +8 -77
  41. package/src/global/functions/contrast-color.functions.scss +48 -0
  42. package/src/global/mixins/set-colors.mixin.scss +73 -0
  43. package/src/variables/colors.scss +3 -0
  44. package/assets/fonts/Asap/Asap-Bold.woff +0 -0
  45. package/assets/fonts/Asap/Asap-Bold.woff2 +0 -0
  46. package/assets/fonts/Asap/Asap-BoldItalic.woff +0 -0
  47. package/assets/fonts/Asap/Asap-BoldItalic.woff2 +0 -0
  48. package/assets/fonts/Asap/Asap-Italic.woff +0 -0
  49. package/assets/fonts/Asap/Asap-Italic.woff2 +0 -0
  50. package/assets/fonts/Asap/Asap-Medium.woff +0 -0
  51. package/assets/fonts/Asap/Asap-Medium.woff2 +0 -0
  52. package/assets/fonts/Asap/Asap-MediumItalic.woff +0 -0
  53. package/assets/fonts/Asap/Asap-MediumItalic.woff2 +0 -0
  54. package/assets/fonts/Asap/Asap-Regular.woff +0 -0
  55. package/assets/fonts/Asap/Asap-Regular.woff2 +0 -0
  56. package/assets/fonts/Asap/Asap-SemiBold.woff +0 -0
  57. package/assets/fonts/Asap/Asap-SemiBold.woff2 +0 -0
  58. package/assets/fonts/Asap/Asap-SemiBoldItalic.woff +0 -0
  59. package/assets/fonts/Asap/Asap-SemiBoldItalic.woff2 +0 -0
@@ -2,88 +2,19 @@
2
2
 
3
3
  @font-face {
4
4
  font-family: "Asap";
5
- font-style: normal;
6
- font-weight: 400;
7
5
  src:
8
- local("Asap Regular"),
9
- local("Asap-Regular"),
10
- url("#{config.$asap-font-path}Asap-Regular.woff2") format("woff2"),
11
- url("#{config.$asap-font-path}Asap-Regular.woff") format("woff");
6
+ url("#{config.$asap-font-path}Asap-VariableFont_wdth,wght.ttf") format("truetype supports variations"),
7
+ url("#{config.$asap-font-path}Asap-VariableFont_wdth,wght.ttf") format("truetype-variations");
8
+ font-weight: 100 900;
9
+ font-display: swap;
12
10
  }
13
11
 
14
12
  @font-face {
15
13
  font-family: "Asap";
16
14
  font-style: italic;
17
- font-weight: 400;
18
15
  src:
19
- local("Asap Regular italic"),
20
- local("Asap-Regularitalic"),
21
- url("#{config.$asap-font-path}Asap-Italic.woff2") format("woff2"),
22
- url("#{config.$asap-font-path}Asap-Italic.woff") format("woff");
23
- }
24
-
25
- @font-face {
26
- font-family: "Asap";
27
- font-style: normal;
28
- font-weight: 500;
29
- src:
30
- local("Asap Bold"),
31
- local("Asap-Bold"),
32
- url("#{config.$asap-font-path}Asap-Medium.woff2") format("woff2"),
33
- url("#{config.$asap-font-path}Asap-Medium.woff") format("woff");
34
- }
35
-
36
- @font-face {
37
- font-family: "Asap";
38
- font-style: italic;
39
- font-weight: 500;
40
- src:
41
- local("Asap Bold italic"),
42
- local("Asap-Bolditalic"),
43
- url("#{config.$asap-font-path}Asap-MediumItalic.woff2") format("woff2"),
44
- url("#{config.$asap-font-path}Asap-MediumItalic.woff") format("woff");
45
- }
46
-
47
- @font-face {
48
- font-family: "Asap";
49
- font-style: normal;
50
- font-weight: 600;
51
- src:
52
- local("Asap Bold"),
53
- local("Asap-Bold"),
54
- url("#{config.$asap-font-path}Asap-SemiBold.woff2") format("woff2"),
55
- url("#{config.$asap-font-path}Asap-SemiBold.woff") format("woff");
56
- }
57
-
58
- @font-face {
59
- font-family: "Asap";
60
- font-style: italic;
61
- font-weight: 600;
62
- src:
63
- local("Asap Bold italic"),
64
- local("Asap-Bolditalic"),
65
- url("#{config.$asap-font-path}Asap-SemiBoldItalic.woff2") format("woff2"),
66
- url("#{config.$asap-font-path}Asap-SemiBoldItalic.woff") format("woff");
67
- }
68
-
69
- @font-face {
70
- font-family: "Asap";
71
- font-style: normal;
72
- font-weight: 700;
73
- src:
74
- local("Asap Bold"),
75
- local("Asap-Bold"),
76
- url("#{config.$asap-font-path}Asap-Bold.woff2") format("woff2"),
77
- url("#{config.$asap-font-path}Asap-Bold.woff") format("woff");
78
- }
79
-
80
- @font-face {
81
- font-family: "Asap";
82
- font-style: italic;
83
- font-weight: 700;
84
- src:
85
- local("Asap Bold italic"),
86
- local("Asap-Bolditalic"),
87
- url("#{config.$asap-font-path}Asap-BoldItalic.woff2") format("woff2"),
88
- url("#{config.$asap-font-path}Asap-BoldItalic.woff") format("woff");
16
+ url("#{config.$asap-font-path}Asap-Italic-VariableFont_wdth,wght.ttf") format("truetype supports variations"),
17
+ url("#{config.$asap-font-path}Asap-Italic-VariableFont_wdth,wght.ttf") format("truetype-variations");
18
+ font-weight: 100 900;
19
+ font-display: swap;
89
20
  }
@@ -0,0 +1,48 @@
1
+ @use "../../variables/colors.scss" as colors;
2
+ @use "sass:math";
3
+
4
+ // CONTRAST COLOR FUNCTIONS
5
+ // ========================
6
+ // Source: https://epiph.yt/en/blog/2023/fix-your-scss-color-contrast-function/
7
+
8
+ // DE-GAMMA AND RE-GAMMA
9
+ @function de-gamma($n) {
10
+ @if $n <=0.03928 {
11
+ @return math.div($n, 12.92);
12
+ } @else {
13
+ @return math.pow((math.div(($n + 0.055), 1.055)), 2.4);
14
+ }
15
+ }
16
+
17
+ @function re-gamma($n) {
18
+ @if $n <=0.0031308 {
19
+ @return $n * 12.92;
20
+ } @else {
21
+ @return 1.055 * math.pow($n, math.div(1, 2.4)) - 0.055;
22
+ }
23
+ }
24
+
25
+ // sRGB BT-709 BRIGHTNESS
26
+ @function brightness($c) {
27
+ $rlin: de-gamma(math.div(red($c), 255));
28
+ $glin: de-gamma(math.div(green($c), 255));
29
+ $blin: de-gamma(math.div(blue($c), 255));
30
+ @return re-gamma(0.2126 * $rlin + 0.7152 * $glin + 0.0722 * $blin) * 100;
31
+ }
32
+
33
+ // Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty"
34
+ @function apply($color, $dark: colors.$contrast-dark, $light: colors.$contrast-light) {
35
+ @if $color ==null {
36
+ @return null;
37
+ } @else {
38
+ $color-brightness: brightness($color);
39
+ $light-text-brightness: brightness($light);
40
+ $dark-text-brightness: brightness($dark);
41
+
42
+ @return if(
43
+ abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness),
44
+ $light,
45
+ $dark
46
+ );
47
+ }
48
+ }
@@ -0,0 +1,73 @@
1
+ @use "sass:map";
2
+
3
+ @use "../../variables/colors.scss";
4
+ @use "../../components/anchor/anchor.variables" as anchor-variables;
5
+ @use "../../di";
6
+
7
+ @use "../functions/contrast-color.functions" as contrast-color;
8
+
9
+ // SET COLORS
10
+ // ==========
11
+ // USAGE: @include setColors($bgcolor, $bordercolor: transparent, $links: true);
12
+ // $background-color: background color of the element (required)
13
+ // $border-color: border color of the element (optional)
14
+ // $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.
15
+ // $links: boolean to set link colors according to background color (optional). set to false if you don't want to change the link colors.
16
+ // $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.
17
+
18
+ @mixin apply($background-color, $border-color: null, $icons: true, $links: true, $reverse: false) {
19
+ $icon-color: null;
20
+
21
+ // run contrast-color function to determine WCAG-compliant text color
22
+ $contrast-color: contrast-color.apply($background-color);
23
+
24
+ // set link and icon color according to text color
25
+ @if lightness($background-color) < 100% {
26
+ @if $links == true {
27
+ --link-color: currentColor;
28
+ --link-hover-color: currentColor;
29
+ --link-visited-color: currentColor;
30
+ }
31
+
32
+ // set according to contrast color determined by contrast-color function
33
+ @if $contrast-color == colors.$contrast-dark {
34
+ $icon-color: "zwart";
35
+ } @else if $contrast-color == colors.$contrast-light {
36
+ $icon-color: "wit";
37
+ }
38
+
39
+ // if contrast-color function gets it wrong, and therefore $reverse is set to true
40
+ @if $contrast-color == colors.$contrast-dark and $reverse == true {
41
+ $icon-color: "wit";
42
+ $contrast-color: colors.$contrast-light;
43
+ } @else if $contrast-color == colors.$contrast-light and $reverse == true {
44
+ $icon-color: "zwart";
45
+ $contrast-color: colors.$contrast-dark;
46
+ }
47
+ }
48
+
49
+ // set css properties
50
+ background-color: $background-color;
51
+ border-color: if($border-color, $border-color, $background-color);
52
+ color: $contrast-color;
53
+
54
+ // implement icon color according to background color
55
+ @if $icon-color and $icons == true {
56
+ @include _anchorIconColors($icon-color);
57
+ }
58
+ }
59
+
60
+ // ANCHOR ICON COLORS
61
+ // ==================
62
+ @mixin _anchorIconColors($icon-color) {
63
+ // loop through map to set icon mode
64
+ @each $mode, $value in anchor-variables.$anchorIcons {
65
+ $selector: map.get($value, "selector");
66
+ $icon: map.get($value, "icon") + "-" + $icon-color;
67
+
68
+ a:is(#{$selector}, #{$selector}:hover, #{$selector}:focus-visible) {
69
+ // set icon color
70
+ @include di.variant($icon);
71
+ }
72
+ }
73
+ }
@@ -71,3 +71,6 @@ $input-disabled-border-color: $grijs-10;
71
71
  $text-muted: $grijs-60;
72
72
 
73
73
  $focus-outline-color: #008ccc;
74
+
75
+ $contrast-dark: $grijs-90;
76
+ $contrast-light: $wit;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file