@kth/style 1.10.0 → 1.12.0-alpha.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.
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kth/style",
3
- "version": "1.10.0",
3
+ "version": "1.12.0-alpha.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "exports": {
@@ -19,9 +19,11 @@
19
19
  "clean": "rm -rf dist",
20
20
  "build": "npm run clean && npm run build:components",
21
21
  "build:components": "rollup -c",
22
+ "build:scss": "node --no-warnings=ExperimentalWarning --trace-uncaught ./build-all-scss.mjs",
22
23
  "dev": "rollup -cw",
23
- "test": "npm run test:lint",
24
+ "test": "npm run test:lint && npm run stylelint",
24
25
  "test:lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
26
+ "stylelint": "stylelint scss/**",
25
27
  "lerna:version": "lerna version --no-private --ignore-changes '**' --force-publish @kth/style"
26
28
  },
27
29
  "files": [
@@ -45,6 +47,9 @@
45
47
  "react": "^18.2.0",
46
48
  "react-dom": "^18.2.0",
47
49
  "rollup": "^3.21.4",
50
+ "sass": "^1.83.4",
51
+ "stylelint": "^16.14.1",
52
+ "stylelint-config-standard-scss": "^14.0.0",
48
53
  "svgo": "^3.0.2",
49
54
  "typescript": "^5.0.2",
50
55
  "vite": "^4.3.0"
@@ -15,8 +15,7 @@
15
15
  border-width: calc(1rem / 16);
16
16
  border-color: var(--color-text);
17
17
  border-style: solid;
18
-
19
- box-shadow: 0 2px 4px 0 rgb(33, 33, 33, 0.4);
18
+ box-shadow: 0 2px 4px 0 rgb(33 33 33 / 40%);
20
19
 
21
20
  // Visually hidden by default
22
21
  z-index: -1;
@@ -1,5 +1,5 @@
1
- @use "../tokens/spacing.scss";
2
- @use "../tokens/icons.scss";
1
+ @use "../tokens/spacing";
2
+ @use "../tokens/icons";
3
3
 
4
4
  @layer kth-style {
5
5
  .kth-accordion {
@@ -14,13 +14,16 @@
14
14
 
15
15
  &::before {
16
16
  @include icons.icon-caret-down;
17
+
17
18
  background-color: var(--color-tertiary);
18
19
  margin-block: spacing.$space-2;
19
20
  }
21
+
20
22
  &:hover {
21
23
  text-decoration: underline;
22
24
  }
23
25
  }
26
+
24
27
  // Safari requires extra code to hide the default ">" marker
25
28
  summary::-webkit-details-marker {
26
29
  display: none;
@@ -1,6 +1,6 @@
1
- @use "../tokens/spacing.scss";
2
- @use "../tokens/icons.scss";
3
- @use "../tokens/typography.scss";
1
+ @use "../tokens/spacing";
2
+ @use "../tokens/icons";
3
+ @use "../tokens/typography";
4
4
  @use "../tokens/colors";
5
5
 
6
6
  $border-inline: spacing.$space-2;
@@ -12,16 +12,14 @@ $padding-inline: calc(spacing.$space-12 - $border-inline);
12
12
  gap: spacing.$space-4 spacing.$space-8;
13
13
  grid-template-columns: auto 1fr;
14
14
  padding-inline: $padding-inline;
15
- padding-block-start: spacing.$space-8;
16
- padding-block-end: spacing.$space-16;
17
-
15
+ padding-block: spacing.$space-8 spacing.$space-16;
18
16
  border-block-start-width: spacing.$space-6;
19
17
  border-inline-width: $border-inline;
20
18
  border-block-end-width: $border-inline;
21
19
  border-style: solid;
22
20
  border-color: var(--color-text);
23
21
 
24
- &:before {
22
+ &::before {
25
23
  background-color: var(--color-text);
26
24
  grid-column-start: 1;
27
25
  align-self: center;
@@ -57,6 +55,7 @@ $padding-inline: calc(spacing.$space-12 - $border-inline);
57
55
 
58
56
  > :is(h2, h3, h4) {
59
57
  @include typography.font-default;
58
+
60
59
  font-weight: 600;
61
60
  }
62
61
 
@@ -1,10 +1,12 @@
1
1
  @use "../tokens/spacing";
2
- @use "../tokens/sizing.scss";
3
- @use "../utils/mixins.scss";
2
+ @use "../tokens/sizing";
3
+ @use "../utils/mixins";
4
4
 
5
5
  .kth-breadcrumbs {
6
6
  display: none;
7
+
7
8
  @include mixins.container;
9
+
8
10
  padding-block-start: spacing.$space-16;
9
11
 
10
12
  @media (min-width: sizing.$breakpoint-64) {
@@ -1,7 +1,7 @@
1
1
  @use "../tokens/spacing";
2
2
  @use "../tokens/icons";
3
3
  @use "../tokens/typography";
4
- @use "../tokens/colors.scss";
4
+ @use "../tokens/colors";
5
5
 
6
6
  @layer kth-style {
7
7
  .kth-button {
@@ -12,7 +12,9 @@
12
12
  border: unset;
13
13
  border-radius: spacing.$space-20;
14
14
  background: none;
15
+
15
16
  @include typography.font-heading-xs;
17
+
16
18
  text-decoration: none;
17
19
 
18
20
  &:hover {
@@ -34,6 +36,10 @@
34
36
  }
35
37
  }
36
38
 
39
+ .kth-button.previous {
40
+ gap: spacing.$space-4;
41
+ }
42
+
37
43
  .kth-button.secondary,
38
44
  .kth-button.previous {
39
45
  border: 1px solid var(--color-secondary);
@@ -45,6 +51,10 @@
45
51
  }
46
52
  }
47
53
 
54
+ .kth-button.next {
55
+ gap: spacing.$space-4;
56
+ }
57
+
48
58
  .kth-button.success,
49
59
  .kth-button.next {
50
60
  background: var(--color-success);
@@ -69,6 +79,7 @@
69
79
  padding: spacing.$space-8 0;
70
80
  gap: spacing.$space-4;
71
81
  color: var(--color-tertiary);
82
+
72
83
  @include typography.font-default;
73
84
 
74
85
  &:hover:not(:disabled) {
@@ -78,29 +89,25 @@
78
89
 
79
90
  .kth-button.menu::before {
80
91
  @include icons.icon-menu;
92
+
81
93
  background-color: var(--color-tertiary);
82
94
  }
83
95
 
84
96
  .kth-button.back::before {
85
97
  @include icons.icon-arrow-back;
86
- background-color: var(--color-tertiary);
87
- }
88
98
 
89
- .kth-button.previous {
90
- gap: spacing.$space-4;
99
+ background-color: var(--color-tertiary);
91
100
  }
92
101
 
93
102
  .kth-button.previous::before {
94
103
  @include icons.icon-arrow-back-500;
95
- background-color: var(--color-text);
96
- }
97
104
 
98
- .kth-button.next {
99
- gap: spacing.$space-4;
105
+ background-color: var(--color-text);
100
106
  }
101
107
 
102
108
  .kth-button.next::after {
103
109
  @include icons.icon-arrow-forward-500;
110
+
104
111
  background-color: var(--color-on-primary);
105
112
  }
106
- }
113
+ }
@@ -1,6 +1,6 @@
1
- @use "../tokens/sizing.scss";
2
- @use "../tokens/spacing.scss";
3
- @use "../utils/mixins.scss";
1
+ @use "../tokens/sizing";
2
+ @use "../tokens/spacing";
3
+ @use "../utils/mixins";
4
4
 
5
5
  @layer kth-style {
6
6
  .kth-content {
@@ -9,6 +9,7 @@
9
9
 
10
10
  .kth-main-content {
11
11
  @include mixins.container;
12
+
12
13
  padding-block: spacing.$space-16;
13
14
  flex: 1;
14
15
 
@@ -18,6 +19,6 @@
18
19
  }
19
20
  }
20
21
 
21
- // TODO: investigate the possibility to expand this `.kth-content` class:
22
+ // TODO: investigate the possibility to expand this `.kth-content`;TODO class:
22
23
  // - is it possible to move the breadcrumbs inside the `kth-content` element?
23
24
  // is it a good idea to do it from
@@ -1,5 +1,5 @@
1
- @use "../tokens/spacing.scss";
2
- @use "../tokens/icons.scss";
1
+ @use "../tokens/spacing";
2
+ @use "../tokens/icons";
3
3
 
4
4
  /// When true, the file generates CSS code for the entire document
5
5
  ///
@@ -20,6 +20,7 @@ $border-width: spacing.$space-4;
20
20
 
21
21
  &::before {
22
22
  @include icons.icon-caret-right;
23
+
23
24
  background-color: var(--color-tertiary);
24
25
  margin-block: spacing.$space-2;
25
26
  }
@@ -38,7 +39,7 @@ $border-width: spacing.$space-4;
38
39
  rotate: 90deg;
39
40
  }
40
41
 
41
- > div {
42
+ >div {
42
43
  border-inline-start: $border-width solid var(--color-tertiary);
43
44
  padding-inline-start: spacing.$space-16;
44
45
  padding-block: spacing.$space-8;
@@ -1,8 +1,8 @@
1
- @use "../tokens/colors.scss";
2
- @use "../tokens/spacing.scss";
3
- @use "../utils/mixins.scss";
1
+ @use "../tokens/colors";
2
+ @use "../tokens/spacing";
3
+ @use "../utils/mixins";
4
4
  @use "../tokens/typography";
5
- @use "../tokens/sizing.scss";
5
+ @use "../tokens/sizing";
6
6
 
7
7
  @layer kth-style {
8
8
  .kth-footer.intranet {
@@ -23,6 +23,7 @@
23
23
 
24
24
  &__content {
25
25
  @include mixins.container;
26
+
26
27
  padding-top: spacing.$space-32;
27
28
  padding-bottom: spacing.$space-32;
28
29
 
@@ -59,6 +60,7 @@
59
60
 
60
61
  h2 {
61
62
  @include typography.font-heading-s;
63
+
62
64
  margin: 0 0 spacing.$space-8;
63
65
  }
64
66
 
@@ -1,15 +1,17 @@
1
- @use "../tokens/colors.scss";
2
- @use "../tokens/spacing.scss";
3
- @use "../tokens/sizing.scss";
4
- @use "../utils/mixins.scss";
1
+ @use "../tokens/colors";
2
+ @use "../tokens/spacing";
3
+ @use "../tokens/sizing";
4
+ @use "../utils/mixins";
5
5
 
6
6
  @layer kth-style {
7
7
  .kth-header.intranet {
8
8
  @include colors.theme-intranet;
9
9
  }
10
+
10
11
  .kth-header.external {
11
12
  @include colors.theme-inverse;
12
13
  }
14
+
13
15
  .kth-header.student-web {
14
16
  @include colors.theme-student-web;
15
17
  }
@@ -22,12 +24,14 @@
22
24
 
23
25
  &__container {
24
26
  @include mixins.container;
27
+
25
28
  display: flex;
26
29
  align-items: center;
27
30
  }
28
31
 
29
32
  &__tools {
30
- @include mixins.horizontal-list();
33
+ @include mixins.horizontal-list;
34
+
31
35
  flex-wrap: wrap;
32
36
  gap: 0 spacing.$space-16;
33
37
  justify-content: flex-end;
@@ -1,6 +1,6 @@
1
1
  @use "../tokens/spacing";
2
2
  @use "../tokens/icons";
3
- @use "../tokens/colors.scss";
3
+ @use "../tokens/colors";
4
4
 
5
5
  $icon-size: calc(#{spacing.$space-24} + 2 * var(--space-inner-icon));
6
6
 
@@ -21,6 +21,7 @@ $icon-size: calc(#{spacing.$space-24} + 2 * var(--space-inner-icon));
21
21
 
22
22
  .kth-icon-button.close::before {
23
23
  @include icons.icon-close;
24
+
24
25
  width: 100%;
25
26
  height: 100%;
26
27
  background-color: var(--color-tertiary);
@@ -1,6 +1,6 @@
1
- @use "../tokens/spacing.scss";
2
- @use "../tokens/icons.scss";
3
- @use "../tokens/typography.scss";
1
+ @use "../tokens/spacing";
2
+ @use "../tokens/icons";
3
+ @use "../tokens/typography";
4
4
 
5
5
  @layer kth-style {
6
6
  .kth-input {
@@ -17,18 +17,21 @@
17
17
 
18
18
  &__label {
19
19
  @include typography.font-heading-xs;
20
+
20
21
  color: var(--color-text);
21
22
  padding: 0;
22
23
  }
23
24
 
24
25
  &__description {
25
26
  @include typography.font-default;
27
+
26
28
  color: var(--color-text);
27
29
  margin-top: spacing.$space-4;
28
30
  }
29
31
 
30
32
  &__requirement {
31
33
  @include typography.font-default;
34
+
32
35
  color: var(--color-text-muted);
33
36
  font-style: italic;
34
37
  margin-top: spacing.$space-4;
@@ -36,6 +39,7 @@
36
39
 
37
40
  &__error-text {
38
41
  @include typography.font-default;
42
+
39
43
  color: var(--color-error);
40
44
  display: flex;
41
45
  align-items: center;
@@ -44,6 +48,7 @@
44
48
 
45
49
  &::before {
46
50
  @include icons.icon-warning-500;
51
+
47
52
  background-color: var(--color-error);
48
53
  }
49
54
  }
@@ -77,6 +82,7 @@
77
82
 
78
83
  &::before {
79
84
  @include icons.icon-input-checkbox;
85
+
80
86
  background-color: var(--color-on-primary);
81
87
  height: spacing.$space-24;
82
88
  width: spacing.$space-24;
@@ -1,7 +1,7 @@
1
- @use "../utils/mixins.scss";
2
- @use "../tokens/spacing.scss";
3
- @use "../tokens/colors.scss";
4
- @use "../tokens/sizing.scss";
1
+ @use "../utils/mixins";
2
+ @use "../tokens/spacing";
3
+ @use "../tokens/colors";
4
+ @use "../tokens/sizing";
5
5
 
6
6
  // This file contains the minimal CSS needed to avoid layout shifts and other
7
7
  // styling issues related to KPM being rendered before CSS is loaded
@@ -12,6 +12,7 @@
12
12
 
13
13
  &__container {
14
14
  @include mixins.container;
15
+
15
16
  display: flex;
16
17
  }
17
18
 
@@ -22,8 +23,13 @@
22
23
  }
23
24
 
24
25
  .kth-entrances {
26
+ // When logged out, show "mobile" version only in small screens
27
+ // Styling for kpm and entrances when logged in is handled by KPM
28
+ display: none;
29
+
25
30
  > ul {
26
- @include mixins.horizontal-list();
31
+ @include mixins.horizontal-list;
32
+
27
33
  gap: spacing.$space-4;
28
34
  }
29
35
 
@@ -57,12 +63,6 @@
57
63
  }
58
64
  }
59
65
 
60
- // When logged out, show "mobile" version only in small screens
61
- // Styling for kpm and entrances when logged in is handled by KPM
62
- .kth-entrances {
63
- display: none;
64
- }
65
-
66
66
  @media screen and (min-width: sizing.$breakpoint-30) {
67
67
  .kth-entrances {
68
68
  display: block;
@@ -1,8 +1,8 @@
1
- @use "../tokens/colors.scss";
2
- @use "../tokens/spacing.scss";
3
- @use "../utils/mixins.scss";
1
+ @use "../tokens/colors";
2
+ @use "../tokens/spacing";
3
+ @use "../utils/mixins";
4
4
  @use "../tokens/typography";
5
- @use "../tokens/sizing.scss";
5
+ @use "../tokens/sizing";
6
6
  @use "../tokens/icons";
7
7
 
8
8
  @layer kth-style {
@@ -10,8 +10,8 @@
10
10
  .kth-local-navigation--mobile {
11
11
  h2 {
12
12
  @include typography.font-heading-s;
13
- margin-block-start: spacing.$space-12;
14
- margin-block-end: spacing.$space-4;
13
+
14
+ margin-block: spacing.$space-12 spacing.$space-4;
15
15
  }
16
16
 
17
17
  ul {
@@ -43,6 +43,7 @@
43
43
 
44
44
  a.expandable::after {
45
45
  @include icons.icon-caret-right;
46
+
46
47
  background-color: var(--color-tertiary);
47
48
  align-self: center;
48
49
  }
@@ -1,5 +1,5 @@
1
- @use "../tokens/spacing.scss";
2
- @use "../tokens/sizing.scss";
1
+ @use "../tokens/spacing";
2
+ @use "../tokens/sizing";
3
3
 
4
4
  @layer kth-style {
5
5
  a.kth-logotype,
@@ -12,14 +12,14 @@
12
12
  padding: 0;
13
13
  margin-inline-end: spacing.$space-8;
14
14
 
15
- @media (min-width: sizing.$breakpoint-40) {
16
- margin-inline-end: spacing.$space-32;
17
- }
18
-
19
15
  // Defensive measurement:
20
16
  // - We prevent logo from shrinking
21
17
  flex: 0 0 auto;
22
18
 
19
+ @media (min-width: sizing.$breakpoint-40) {
20
+ margin-inline-end: spacing.$space-32;
21
+ }
22
+
23
23
  > figure {
24
24
  block-size: 100%;
25
25
  inline-size: 100%;
@@ -1,11 +1,17 @@
1
- @use "../tokens/spacing.scss";
2
- @use "../utils/mixins.scss";
3
- @use "../tokens/sizing.scss";
1
+ @use "../tokens/spacing";
2
+ @use "../utils/mixins";
3
+ @use "../tokens/sizing";
4
4
 
5
5
  @layer kth-style {
6
6
  nav.kth-mega-menu {
7
+ display: none;
8
+
9
+ @media (min-width: sizing.$breakpoint-64) {
10
+ display: block;
11
+ }
12
+
7
13
  > ul {
8
- @include mixins.horizontal-list();
14
+ @include mixins.horizontal-list;
9
15
 
10
16
  // Defensive measurements:
11
17
  // - `flex-wrap: wrap` makes sure that all menus are displayed decently
@@ -15,14 +21,6 @@
15
21
  }
16
22
  }
17
23
 
18
- nav.kth-mega-menu {
19
- display: none;
20
-
21
- @media (min-width: sizing.$breakpoint-64) {
22
- display: block;
23
- }
24
- }
25
-
26
24
  nav.kth-mega-menu--collapsable {
27
25
  display: block;
28
26
 
@@ -35,18 +35,25 @@
35
35
 
36
36
  &.dropdown::after {
37
37
  @include icons.icon-caret-down;
38
+
38
39
  background-color: var(--color-on-header, colors.$color-blue-marine);
39
40
  }
41
+
40
42
  &.search::before {
41
43
  @include icons.icon-search;
44
+
42
45
  background-color: var(--color-on-header, colors.$color-blue-marine);
43
46
  }
47
+
44
48
  &.language::before {
45
49
  @include icons.icon-language;
50
+
46
51
  background-color: var(--color-on-header, colors.$color-blue-marine);
47
52
  }
53
+
48
54
  &.menu::before {
49
55
  @include icons.icon-menu;
56
+
50
57
  background-color: var(--color-on-header, colors.$color-blue-marine);
51
58
  }
52
59
  }
@@ -34,6 +34,7 @@
34
34
 
35
35
  h2 {
36
36
  @include typography.font-heading-m;
37
+
37
38
  margin-bottom: spacing.$space-4;
38
39
  }
39
40
  }
@@ -51,6 +52,7 @@
51
52
 
52
53
  h3 {
53
54
  @include typography.font-heading-s;
55
+
54
56
  margin: 0 0 spacing.$space-8;
55
57
  }
56
58
 
@@ -37,8 +37,26 @@
37
37
 
38
38
  h2 {
39
39
  @include typography.font-heading-m;
40
+
41
+ margin-bottom: spacing.$space-4;
42
+ }
43
+ }
44
+
45
+ &__cortina-content {
46
+ li:not(:last-child) {
47
+ margin-bottom: spacing.$space-16;
48
+ }
49
+
50
+ h3 {
51
+ @include typography.font-heading-s;
52
+
40
53
  margin-bottom: spacing.$space-4;
41
54
  }
55
+
56
+ .block:not(:first-child),
57
+ .col:not(:first-child) {
58
+ margin-top: spacing.$space-32;
59
+ }
42
60
  }
43
61
 
44
62
  &__content {
@@ -50,6 +68,7 @@
50
68
 
51
69
  .kth-mobile-menu__item {
52
70
  @include typography.font-heading-m;
71
+
53
72
  text-decoration: none;
54
73
  display: flex;
55
74
  align-items: center;
@@ -60,6 +79,7 @@
60
79
 
61
80
  &::after {
62
81
  @include icons.icon-caret-right-big;
82
+
63
83
  background-color: var(--color-on-header, colors.$color-blue-marine);
64
84
  margin-left: 0.75rem;
65
85
  }
@@ -78,22 +98,6 @@
78
98
  }
79
99
  }
80
100
 
81
- &__cortina-content {
82
- li:not(:last-child) {
83
- margin-bottom: spacing.$space-16;
84
- }
85
-
86
- h3 {
87
- @include typography.font-heading-s;
88
- margin-bottom: spacing.$space-4;
89
- }
90
-
91
- .block:not(:first-child),
92
- .col:not(:first-child) {
93
- margin-top: spacing.$space-32;
94
- }
95
- }
96
-
97
101
  .block.columnSplitter.row {
98
102
  display: block;
99
103
  }
@@ -1,7 +1,7 @@
1
1
  @use "sass:math";
2
- @use "../tokens/spacing.scss";
3
- @use "../tokens/icons.scss";
4
- @use "../tokens/typography.scss";
2
+ @use "../tokens/spacing";
3
+ @use "../tokens/icons";
4
+ @use "../tokens/typography";
5
5
 
6
6
  $secondary-border-width: math.div(1rem, 16);
7
7
 
@@ -13,6 +13,7 @@ $secondary-border-width: math.div(1rem, 16);
13
13
 
14
14
  > label {
15
15
  @include typography.font-heading-s;
16
+
16
17
  display: block;
17
18
  margin-block: spacing.$space-4;
18
19
  grid-area: label;
@@ -30,6 +31,7 @@ $secondary-border-width: math.div(1rem, 16);
30
31
  color: var(--color-secondary);
31
32
  grid-area: input;
32
33
  background: transparent;
34
+
33
35
  @include typography.font-default;
34
36
  }
35
37
 
@@ -38,7 +40,6 @@ $secondary-border-width: math.div(1rem, 16);
38
40
  border: none;
39
41
  height: calc(#{spacing.$space-24} + 2 * var(--space-inner-icon));
40
42
  width: calc(#{spacing.$space-24} + 2 * var(--space-inner-icon));
41
-
42
43
  padding-block: var(--space-inner-icon);
43
44
  grid-area: input;
44
45
  place-self: center end;
@@ -56,6 +57,7 @@ $secondary-border-width: math.div(1rem, 16);
56
57
 
57
58
  > button.loading::after {
58
59
  @include icons.icon-spinner;
60
+
59
61
  content: "";
60
62
  display: block;
61
63
  margin: auto;
@@ -0,0 +1,68 @@
1
+ @use "../tokens/spacing" as s;
2
+ @use "../tokens/icons";
3
+
4
+ @layer kth-style {
5
+ .kth-table {
6
+ overflow-x: scroll;
7
+
8
+ table {
9
+ border-collapse: collapse;
10
+ }
11
+
12
+ th,
13
+ td,
14
+ caption {
15
+ text-align: left;
16
+ overflow-wrap: normal;
17
+ padding: s.$space-4 s.$space-16;
18
+ vertical-align: top;
19
+
20
+ &.kth-table__cell--numeric {
21
+ text-align: end;
22
+ font-variant-numeric: tabular-nums;
23
+ }
24
+ }
25
+
26
+ tbody td,
27
+ tbody th,
28
+ tfoot th,
29
+ tfoot td {
30
+ border-block-start: 1px solid var(--color-border);
31
+ }
32
+
33
+ thead,
34
+ tfoot {
35
+ background: var(--color-background-alt);
36
+ }
37
+
38
+ .kth-table__column--sortable {
39
+ padding: 0;
40
+
41
+ button {
42
+ text-align: inherit;
43
+ border: none;
44
+ background: none;
45
+ display: flex;
46
+ align-items: center;
47
+ width: 100%;
48
+ height: 100%;
49
+ padding: s.$space-4 s.$space-16;
50
+ }
51
+
52
+ button::after {
53
+ vertical-align: middle;
54
+ background-color: var(--color-text);
55
+
56
+ @include icons.icon-sort-unsorted;
57
+ }
58
+
59
+ &[aria-sort="ascending"] button::after {
60
+ @include icons.icon-sort-asc;
61
+ }
62
+
63
+ &[aria-sort="descending"] button::after {
64
+ @include icons.icon-sort-desc;
65
+ }
66
+ }
67
+ }
68
+ }
@@ -4,27 +4,29 @@
4
4
  @layer kth-style {
5
5
  .kth-translation {
6
6
  @include colors.theme-default;
7
+
7
8
  left: spacing.$space-16;
8
9
  right: spacing.$space-16;
9
10
  width: auto;
10
11
  background-color: var(--color-background);
11
12
 
12
13
  // TODO: tokenize this shadow
13
- box-shadow: 0 0.125rem 0.5rem 0 rgb(0 0 0 /0.15);
14
+ box-shadow: 0 0.125rem 0.5rem 0 rgb(0 0 0 / 15%);
14
15
  border: none;
15
16
  padding: spacing.$space-16 spacing.$space-16 spacing.$space-32
16
17
  spacing.$space-32;
17
18
 
18
19
  // Let the dialog take up the remaining space
19
- @media (min-width: calc(22.5rem + spacing.$space-16 * 2)) {
20
+ @media (width >= calc(22.5rem + spacing.$space-16 * 2)) {
20
21
  width: 22.5rem;
21
22
  left: auto;
23
+
22
24
  // TODO: this formula should be a token
23
25
  right: clamp(spacing.$space-16, calc(100vw / 30), spacing.$space-32);
24
26
  }
25
27
 
26
28
  // TODO: tokenize the breakpoint
27
- @media (min-width: 82rem) {
29
+ @media (width >= 82rem) {
28
30
  // TODO: tokenize formula
29
31
  // Remaining space to the right from the header's max-width + the heading's padding
30
32
  right: calc((100vw - 82rem) / 2 + spacing.$space-32);
@@ -1,8 +1,7 @@
1
1
  // Gray-scale
2
2
  $color-white: #fcfcfc;
3
3
  $color-black: #212121;
4
- $color-black-opacity10: rgb(33 33 33 / 0.1);
5
-
4
+ $color-black-opacity10: rgb(33 33 33 / 10%);
6
5
  $color-gray-lightest: #f2f2f2;
7
6
  $color-gray-lighter: #ededed;
8
7
  $color-gray-light: #e6e6e6;
@@ -25,7 +24,6 @@ $color-red-light: #fad6d6;
25
24
  $color-red: #c7321d;
26
25
  $color-red-dark: #bf2c17;
27
26
  $color-red-darker: #962312;
28
-
29
27
  $color-green-light: #d8ffe7;
30
28
  $color-green: #3d784a;
31
29
  $color-green-dark: #366f43;
@@ -23,8 +23,9 @@ $icon-new-window: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w
23
23
  $icon-pdf: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%231C1B1F%22%20d%3D%22M7.356%2010.452h.904v-1.5h.596a.875.875%200%200%200%20.644-.26.875.875%200%200%200%20.26-.644v-.596a.875.875%200%200%200-.26-.644.875.875%200%200%200-.644-.26h-1.5v3.904Zm.904-2.404v-.596h.596v.596H8.26Zm2.016%202.404h1.467a.875.875%200%200%200%20.645-.26.875.875%200%200%200%20.26-.644V7.452a.875.875%200%200%200-.26-.644.875.875%200%200%200-.645-.26h-1.467v3.904Zm.903-.904V7.452h.564v2.096h-.564Zm2.064.904h.905v-1.5h1.16v-.904h-1.16v-.596h1.16v-.904h-2.065v3.904Zm-6.695%204.131c-.375%200-.692-.13-.951-.388a1.294%201.294%200%200%201-.389-.952V3.756c0-.375.13-.692.389-.95.259-.26.576-.39.951-.39h9.487c.375%200%20.692.13.951.39.26.258.389.575.389.95v9.487c0%20.376-.13.693-.389.952s-.576.388-.95.388H6.547Zm0-1.083h9.487a.245.245%200%200%200%20.177-.08.245.245%200%200%200%20.08-.177V3.756a.245.245%200%200%200-.08-.176.245.245%200%200%200-.177-.08H6.548a.245.245%200%200%200-.176.08.245.245%200%200%200-.08.176v9.487c0%20.065.026.123.08.177.053.053.112.08.176.08Zm-2.583%203.667c-.375%200-.692-.13-.951-.389a1.294%201.294%200%200%201-.389-.951V5.257h1.083v10.57c0%20.064.027.123.08.176.054.054.113.08.177.08h10.57v1.084H3.965Z%22%2F%3E%3C%2Fsvg%3E");
24
24
  $icon-schedule: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%231C1B1F%22%20d%3D%22m12.936%2013.398.774-.775-3.168-3.168V5H9.458v4.92l3.478%203.478ZM10%2017.582a7.385%207.385%200%200%201-2.945-.592%207.656%207.656%200%200%201-2.417-1.63%207.646%207.646%200%200%201-1.63-2.418%207.408%207.408%200%200%201-.592-2.951%207.522%207.522%200%200%201%202.221-5.363%207.734%207.734%200%200%201%202.419-1.62%207.408%207.408%200%200%201%202.951-.592c1.047%200%202.031.199%202.953.597a7.652%207.652%200%200%201%202.406%201.62%207.657%207.657%200%200%201%201.62%202.408c.397.922.596%201.908.596%202.957a7.386%207.386%200%200%201-.592%202.945%207.745%207.745%200%200%201-1.619%202.417%207.513%207.513%200%200%201-5.37%202.222Zm.009-1.083c1.798%200%203.33-.635%204.594-1.906%201.264-1.271%201.896-2.806%201.896-4.604s-.632-3.33-1.896-4.594C13.339%204.132%2011.808%203.5%2010.01%203.5c-1.798%200-3.333.632-4.604%201.896C4.136%206.661%203.5%208.192%203.5%209.99c0%201.798.635%203.333%201.906%204.604%201.271%201.27%202.806%201.906%204.604%201.906Z%22%2F%3E%3C%2Fsvg%3E");
25
25
  $icon-search: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22m15.89%2016.647-4.964-4.963a4.96%204.96%200%200%201-1.37.735c-.498.174-1.01.26-1.54.26-1.3%200-2.404-.454-3.314-1.364C3.792%2010.405%203.337%209.3%203.337%208S3.792%205.598%204.7%204.687c.91-.911%202.015-1.366%203.314-1.366s2.403.455%203.314%201.365c.911.91%201.366%202.015%201.366%203.315%200%20.545-.089%201.066-.268%201.563a4.993%204.993%200%200%201-.727%201.346l4.963%204.963-.774.774Zm-7.874-5.05c1.004%200%201.855-.35%202.551-1.046.697-.696%201.045-1.547%201.045-2.551%200-1.004-.348-1.855-1.045-2.551-.696-.697-1.547-1.045-2.551-1.045-1.004%200-1.855.348-2.551%201.045C4.768%206.145%204.42%206.996%204.42%208c0%201.004.348%201.855%201.045%202.551.696.697%201.547%201.045%202.551%201.045Z%22%2F%3E%3C%2Fsvg%3E");
26
- $icon-sort-asc: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22M15.833%2014.167h2.5L15%2017.5l-3.333-3.333h2.5V2.5h1.666v11.667Zm-14.166%200H10v1.666H1.667v-1.666ZM5%204.167v1.666H1.667V4.167H5Zm-3.333%205H7.5v1.666H1.667V9.167Z%22%2F%3E%3C%2Fsvg%3E");
27
- $icon-sort-desc: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22M15.833%205.833h2.5L15%202.5l-3.333%203.333h2.5V17.5h1.666V5.833ZM1.667%2014.167H10v1.666H1.667v-1.666ZM5%204.167v1.666H1.667V4.167H5Zm-3.333%205H7.5v1.666H1.667V9.167Z%22%2F%3E%3C%2Fsvg%3E");
26
+ $icon-sort-asc: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22m10.274%208%204.274%204.274H6L10.274%208Z%22%2F%3E%3C%2Fsvg%3E");
27
+ $icon-sort-desc: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22M10.274%2012.274%206%208h8.548l-4.274%204.274Z%22%2F%3E%3C%2Fsvg%3E");
28
+ $icon-sort-unsorted: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22m10.274%204%204.274%204.274H6L10.274%204ZM10.274%2015.274%206%2011h8.548l-4.274%204.274Z%22%2F%3E%3C%2Fsvg%3E");
28
29
  $icon-spinner: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M17%2010a7%207%200%201%200-7%207v-1.75A5.25%205.25%200%201%201%2015.25%2010H17Z%22%2F%3E%3C%2Fsvg%3E");
29
30
  $icon-star-off: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22M7.333%2014.896%2010%2013.312l2.688%201.584-.709-3%202.313-1.98-3.063-.27L10%206.792%208.77%209.646l-3.062.27%202.334%201.98-.709%203ZM5.063%2018l1.312-5.542L2%208.73l5.75-.5L10%203l2.25%205.25%205.75.48-4.375%203.728L14.938%2018%2010%2015.062%205.062%2018Z%22%2F%3E%3C%2Fsvg%3E");
30
31
  $icon-star-on: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22m5.063%2018%201.312-5.542L2%208.73l5.75-.5L10%203l2.25%205.25%205.75.48-4.375%203.728L14.938%2018%2010%2015.062%205.062%2018Z%22%2F%3E%3C%2Fsvg%3E");
@@ -10,15 +10,14 @@
10
10
  @mixin with-icon($icon, $size: 1.25rem) {
11
11
  // We use this variable to avoid sending the same data twice to the users
12
12
  --icon: #{$icon};
13
+
13
14
  content: "";
14
15
  display: inline-block;
15
16
  width: $size;
16
17
  min-width: $size;
17
18
  height: $size;
18
- -webkit-mask-image: var(--icon);
19
19
  mask-image: var(--icon);
20
20
  mask-size: cover;
21
- -webkit-mask-size: cover;
22
21
  }
23
22
 
24
23
  @mixin icon-input-checkbox {
@@ -39,6 +38,7 @@
39
38
 
40
39
  @mixin icon-caret-down {
41
40
  @include with-icon(raw.$icon-caret-right);
41
+
42
42
  rotate: 90deg;
43
43
  }
44
44
 
@@ -56,11 +56,13 @@
56
56
 
57
57
  @mixin icon-arrow-back {
58
58
  @include with-icon(raw.$icon-arrow-forward);
59
+
59
60
  rotate: 180deg;
60
61
  }
61
62
 
62
63
  @mixin icon-arrow-back-500 {
63
64
  @include with-icon(raw.$icon-arrow-forward-500);
65
+
64
66
  rotate: 180deg;
65
67
  }
66
68
 
@@ -94,6 +96,7 @@
94
96
 
95
97
  @mixin icon-spinner {
96
98
  @include with-icon(raw.$icon-spinner);
99
+
97
100
  animation: spin 750ms infinite linear;
98
101
  }
99
102
 
@@ -123,4 +126,16 @@
123
126
 
124
127
  @mixin icon-pdf {
125
128
  @include with-icon(raw.$icon-pdf);
126
- }
129
+ }
130
+
131
+ @mixin icon-sort-unsorted {
132
+ @include with-icon(raw.$icon-sort-unsorted);
133
+ }
134
+
135
+ @mixin icon-sort-asc {
136
+ @include with-icon(raw.$icon-sort-asc);
137
+ }
138
+
139
+ @mixin icon-sort-desc {
140
+ @include with-icon(raw.$icon-sort-desc);
141
+ }
@@ -1,5 +1,6 @@
1
1
  @use "sass:list";
2
2
  @use "sass:map";
3
+
3
4
  /// Design Tokens for spacing
4
5
 
5
6
  $space-0: 0;
@@ -1,6 +1,6 @@
1
1
  @use "sass:list";
2
2
 
3
- $font-figtree: Figtree, sans-serif;
3
+ $font-figtree: Figtree, sans-serif; /* stylelint-disable-line value-keyword-case */
4
4
  $breakpoint-fluid-typography: 48rem;
5
5
  $font-bold: 600;
6
6
 
@@ -15,14 +15,15 @@
15
15
 
16
16
  p {
17
17
  margin-block: s.$space-20;
18
+
18
19
  // TODO: change this to `rem` and tokenize
19
20
  max-width: 60ch;
20
21
  }
21
22
 
22
23
  .lead {
23
24
  @include t.font-lead-fluid;
24
- margin-block-start: s.$space-12;
25
- margin-block-end: s.$space-16;
25
+
26
+ margin-block: s.$space-12 s.$space-16;
26
27
  }
27
28
 
28
29
  h1,
@@ -33,23 +34,19 @@
33
34
  }
34
35
 
35
36
  h1 {
36
- margin-block-start: s.$space-32;
37
- margin-block-end: s.$space-16;
37
+ margin-block: s.$space-32 s.$space-16;
38
38
  }
39
39
 
40
40
  h2 {
41
- margin-block-start: s.$space-32;
42
- margin-block-end: s.$space-16;
41
+ margin-block: s.$space-32 s.$space-16;
43
42
  }
44
43
 
45
44
  h3 {
46
- margin-block-start: s.$space-32;
47
- margin-block-end: s.$space-8;
45
+ margin-block: s.$space-32 s.$space-8;
48
46
  }
49
47
 
50
48
  h4 {
51
- margin-block-start: s.$space-32;
52
- margin-block-end: s.$space-4;
49
+ margin-block: s.$space-32 s.$space-4;
53
50
  }
54
51
 
55
52
  li {
@@ -15,7 +15,6 @@ $kpm-height: 2.5rem !default;
15
15
  *::before,
16
16
  *::after {
17
17
  box-sizing: border-box;
18
- overflow-wrap: anywhere;
19
18
  }
20
19
 
21
20
  h1,
@@ -81,19 +80,19 @@ $kpm-height: 2.5rem !default;
81
80
  @if $generate-css {
82
81
  @layer kth-style {
83
82
  html {
84
- -moz-text-size-adjust: none;
85
- -webkit-text-size-adjust: none;
86
83
  text-size-adjust: none;
87
84
  }
88
85
 
89
86
  :root {
90
87
  @include colors.theme-default;
91
88
  @include spacing.theme-default;
89
+
92
90
  font-family: typography.$font-figtree;
93
91
  }
94
92
 
95
93
  body {
96
94
  @include typography.font-default;
95
+
97
96
  color: var(--color-text);
98
97
  background: var(--color-background);
99
98
  min-height: calc(100vh - $kpm-height);
@@ -101,6 +100,7 @@ $kpm-height: 2.5rem !default;
101
100
  margin-top: $kpm-height;
102
101
  display: flex;
103
102
  flex-direction: column;
103
+ overflow-wrap: anywhere;
104
104
  }
105
105
 
106
106
  @include reset;