@utrecht/root-css 2.0.0 → 3.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @utrecht/root-css
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - e89c1d2: Use `font-size-adjust: 0.5` as default. Add `utrecht.root.font-size-adjust` design token to make this behavior configurable.
8
+
9
+ ### Minor Changes
10
+
11
+ - 4d4079c: Add default focus indicator to all focusable elements inside the Root component.
12
+
13
+ ## 2.0.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 9b3cb1e: Release with npm provenance.
18
+
3
19
  ## 2.0.0
4
20
 
5
21
  ### Major Changes
@@ -10,6 +10,7 @@
10
10
  block-size: 100%;
11
11
  color: var(--utrecht-root-color);
12
12
  font-family: var(--utrecht-root-font-family);
13
+ font-size-adjust: var(--utrecht-root-font-size-adjust, 0.5);
13
14
  -webkit-hyphens: auto;
14
15
  -moz-hyphens: auto;
15
16
  -ms-hyphens: auto;
@@ -23,4 +24,15 @@
23
24
  -webkit-text-size-adjust: none;
24
25
  text-size-adjust: none;
25
26
  word-break: break-word;
27
+ }
28
+
29
+ :where(:focus-visible) {
30
+ --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0)
31
+ var(--utrecht-focus-inverse-outline-color, transparent);
32
+ box-shadow: var(--_utrecht-focus-ring-box-shadow);
33
+ outline-color: var(--utrecht-focus-outline-color, revert);
34
+ outline-offset: var(--utrecht-focus-outline-offset, revert);
35
+ outline-style: var(--utrecht-focus-outline-style, revert);
36
+ outline-width: var(--utrecht-focus-outline-width, revert);
37
+ z-index: 1;
26
38
  }
@@ -1 +1 @@
1
- :root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}
1
+ :root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);font-size-adjust:var(--utrecht-root-font-size-adjust,.5);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}:where(:focus-visible){--_utrecht-focus-ring-box-shadow:0 0 0 var(--utrecht-focus-outline-width,0) var(--utrecht-focus-inverse-outline-color,transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color,revert);outline-offset:var(--utrecht-focus-outline-offset,revert);outline-style:var(--utrecht-focus-outline-style,revert);outline-width:var(--utrecht-focus-outline-width,revert);z-index:1}
@@ -1 +1 @@
1
- export default ":root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}";
1
+ export default ":root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);font-size-adjust:var(--utrecht-root-font-size-adjust,.5);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}:where(:focus-visible){--_utrecht-focus-ring-box-shadow:0 0 0 var(--utrecht-focus-outline-width,0) var(--utrecht-focus-inverse-outline-color,transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color,revert);outline-offset:var(--utrecht-focus-outline-offset,revert);outline-style:var(--utrecht-focus-outline-style,revert);outline-width:var(--utrecht-focus-outline-width,revert);z-index:1}";
package/dist/index.css CHANGED
@@ -10,6 +10,7 @@
10
10
  block-size: 100%;
11
11
  color: var(--utrecht-root-color);
12
12
  font-family: var(--utrecht-root-font-family);
13
+ font-size-adjust: var(--utrecht-root-font-size-adjust, 0.5);
13
14
  -webkit-hyphens: auto;
14
15
  -moz-hyphens: auto;
15
16
  -ms-hyphens: auto;
@@ -23,4 +24,14 @@
23
24
  -webkit-text-size-adjust: none;
24
25
  text-size-adjust: none;
25
26
  word-break: break-word;
27
+ }
28
+ :where(.utrecht-root) :where(:focus-visible) {
29
+ --_utrecht-focus-ring-box-shadow: 0 0 0 var(--utrecht-focus-outline-width, 0)
30
+ var(--utrecht-focus-inverse-outline-color, transparent);
31
+ box-shadow: var(--_utrecht-focus-ring-box-shadow);
32
+ outline-color: var(--utrecht-focus-outline-color, revert);
33
+ outline-offset: var(--utrecht-focus-outline-offset, revert);
34
+ outline-style: var(--utrecht-focus-outline-style, revert);
35
+ outline-width: var(--utrecht-focus-outline-width, revert);
36
+ z-index: 1;
26
37
  }
@@ -1 +1 @@
1
- .utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}
1
+ .utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);font-size-adjust:var(--utrecht-root-font-size-adjust,.5);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}:where(.utrecht-root) :where(:focus-visible){--_utrecht-focus-ring-box-shadow:0 0 0 var(--utrecht-focus-outline-width,0) var(--utrecht-focus-inverse-outline-color,transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color,revert);outline-offset:var(--utrecht-focus-outline-offset,revert);outline-style:var(--utrecht-focus-outline-style,revert);outline-width:var(--utrecht-focus-outline-width,revert);z-index:1}
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export default ".utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}";
1
+ export default ".utrecht-root{-webkit-font-smoothing:auto!important;-moz-osx-font-smoothing:auto!important;background-color:var(--utrecht-root-background-color);block-size:100%;color:var(--utrecht-root-color);font-family:var(--utrecht-root-font-family);font-size-adjust:var(--utrecht-root-font-size-adjust,.5);-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;inline-size:100%;overflow-block:auto;overflow-inline:auto;position:relative;text-rendering:optimizeLegibility;-moz-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;word-break:break-word}:where(.utrecht-root) :where(:focus-visible){--_utrecht-focus-ring-box-shadow:0 0 0 var(--utrecht-focus-outline-width,0) var(--utrecht-focus-inverse-outline-color,transparent);box-shadow:var(--_utrecht-focus-ring-box-shadow);outline-color:var(--utrecht-focus-outline-color,revert);outline-offset:var(--utrecht-focus-outline-offset,revert);outline-style:var(--utrecht-focus-outline-style,revert);outline-width:var(--utrecht-focus-outline-width,revert);z-index:1}";
package/dist/tokens.mjs CHANGED
@@ -30,6 +30,16 @@ export default {
30
30
  "nl.nldesignsystem.figma.supports-token": false
31
31
  },
32
32
  "type": "fontFamilies"
33
+ },
34
+ "font-size-adjust": {
35
+ "$extensions": {
36
+ "nl.nldesignsystem.css.property": {
37
+ "syntax": "<number>",
38
+ "inherits": true
39
+ },
40
+ "nl.nldesignsystem.figma.supports-token": false
41
+ },
42
+ "type": "other"
33
43
  }
34
44
  }
35
45
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "3.0.0",
3
3
  "author": "Community for NL Design System",
4
4
  "description": "Root component for the Municipality of Utrecht based on the NL Design System architecture",
5
5
  "license": "EUPL-1.2",
@@ -12,7 +12,8 @@
12
12
  ],
13
13
  "main": "dist/index.css",
14
14
  "devDependencies": {
15
- "@utrecht/build-utils-css": "0.0.3"
15
+ "@utrecht/build-utils-css": "0.0.4",
16
+ "@utrecht/focus-ring-css": "3.1.0"
16
17
  },
17
18
  "keywords": [
18
19
  "nl-design-system"
package/src/_mixin.scss CHANGED
@@ -4,6 +4,8 @@
4
4
  * Copyright (c) 2021-2024 Gemeente Utrecht
5
5
  */
6
6
 
7
+ @use "~@utrecht/focus-ring-css/src/mixin" as *;
8
+
7
9
  @mixin reset-font-smoothing {
8
10
  /* reset `font-smoothing: antialiasing`, prefer automatic (`subpixel-antialiasing`) behavior for high-dpi screens */
9
11
  -webkit-font-smoothing: auto !important;
@@ -13,7 +15,7 @@
13
15
  @mixin utrecht-root {
14
16
  /*
15
17
  * Goals:
16
- *
18
+ *
17
19
  * - take up 100% of the space, both horizontally and vertically.
18
20
  * - create a scrollable viewport experience both on `<html>` in the root,
19
21
  * as well as on a `<div>` somewhere in a document.
@@ -29,6 +31,7 @@
29
31
  block-size: 100%;
30
32
  color: var(--utrecht-root-color);
31
33
  font-family: var(--utrecht-root-font-family);
34
+ font-size-adjust: var(--utrecht-root-font-size-adjust, 0.5);
32
35
  -webkit-hyphens: auto;
33
36
  -moz-hyphens: auto;
34
37
  -ms-hyphens: auto;
@@ -43,3 +46,7 @@
43
46
  text-size-adjust: none;
44
47
  word-break: break-word;
45
48
  }
49
+
50
+ @mixin utrecht-root__focus-indicator {
51
+ @include utrecht-focus-ring;
52
+ }
@@ -5,11 +5,14 @@
5
5
  */
6
6
 
7
7
  @use "../mixin" as *;
8
+ @use "~@utrecht/focus-ring-css/src/mixin" as *;
8
9
 
9
10
  @mixin utrecht-html-html {
10
11
  html {
11
12
  @include utrecht-root;
12
13
  }
14
+
15
+ @include utrecht-focus-ring-default;
13
16
  }
14
17
 
15
18
  /**
@@ -20,4 +23,6 @@
20
23
  :root {
21
24
  @include utrecht-root;
22
25
  }
26
+
27
+ @include utrecht-focus-ring-default;
23
28
  }
package/src/index.scss CHANGED
@@ -5,7 +5,9 @@
5
5
  */
6
6
 
7
7
  @use "./mixin" as *;
8
+ @use "~@utrecht/focus-ring-css/src/mixin" as *;
8
9
 
9
10
  .utrecht-root {
10
11
  @include utrecht-root;
12
+ @include utrecht-focus-ring-default-container;
11
13
  }
package/src/tokens.json CHANGED
@@ -30,6 +30,16 @@
30
30
  "nl.nldesignsystem.figma.supports-token": false
31
31
  },
32
32
  "type": "fontFamilies"
33
+ },
34
+ "font-size-adjust": {
35
+ "$extensions": {
36
+ "nl.nldesignsystem.css.property": {
37
+ "syntax": "<number>",
38
+ "inherits": true
39
+ },
40
+ "nl.nldesignsystem.figma.supports-token": false
41
+ },
42
+ "type": "other"
33
43
  }
34
44
  }
35
45
  }