@kth/style 1.4.5 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kth/style",
3
- "version": "1.4.5",
3
+ "version": "1.5.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "exports": {
@@ -0,0 +1,89 @@
1
+ @use "../tokens/spacing.scss";
2
+ @use "../tokens/icons.scss";
3
+ @use "../tokens/typography.scss";
4
+
5
+ @layer kth-style {
6
+ .kth-input {
7
+ &.error {
8
+ padding-left: spacing.$space-16;
9
+ border-left: spacing.$space-4 solid var(--color-error);
10
+ }
11
+
12
+ fieldset {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: none;
16
+ }
17
+
18
+ &__label {
19
+ @include typography.font-heading-xs;
20
+ color: var(--color-text);
21
+ padding: 0;
22
+ }
23
+
24
+ &__description {
25
+ @include typography.font-default;
26
+ color: var(--color-text);
27
+ margin-top: spacing.$space-4;
28
+ }
29
+
30
+ &__requirement {
31
+ @include typography.font-default;
32
+ color: var(--color-text-muted);
33
+ font-style: italic;
34
+ margin-top: spacing.$space-4;
35
+ }
36
+
37
+ &__error-text {
38
+ @include typography.font-default;
39
+ color: var(--color-error);
40
+ display: flex;
41
+ align-items: center;
42
+ gap: spacing.$space-8;
43
+ margin-top: spacing.$space-16;
44
+
45
+ &::before {
46
+ @include icons.icon-warning-500;
47
+ background-color: var(--color-error);
48
+ }
49
+ }
50
+
51
+ &__option {
52
+ display: flex;
53
+ align-items: start;
54
+ gap: spacing.$space-12;
55
+ margin-top: spacing.$space-16;
56
+
57
+ .kth-checkbox {
58
+ appearance: none;
59
+ margin: 0;
60
+ height: spacing.$space-24;
61
+ width: spacing.$space-24;
62
+ min-width: spacing.$space-24;
63
+ border: 1px solid var(--color-secondary);
64
+ border-radius: spacing.$space-4;
65
+ background-color: var(--color-on-primary);
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+
70
+ &:checked {
71
+ background-color: var(--color-primary);
72
+ border-color: var(--color-primary);
73
+
74
+ &::before {
75
+ @include icons.icon-input-checkbox;
76
+ background-color: var(--color-on-primary);
77
+ height: spacing.$space-24;
78
+ width: spacing.$space-24;
79
+ min-width: spacing.$space-24;
80
+ }
81
+ }
82
+ }
83
+
84
+ label {
85
+ @include typography.font-default;
86
+ }
87
+ }
88
+ }
89
+ }
@@ -7,7 +7,8 @@ $color-gray-lightest: #f2f2f2;
7
7
  $color-gray-lighter: #ededed;
8
8
  $color-gray-light: #e6e6e6;
9
9
  $color-gray-medium: #a5a5a5;
10
- $color-gray-dark: #323232;
10
+ $color-gray-dark: #646464;
11
+ $color-gray-darkest: #323232;
11
12
 
12
13
  // Colors defined by "Varumärkesgruppen"
13
14
  $color-sand: #ebe5e0;
@@ -32,6 +33,7 @@ $color-green-darker: #264f30;
32
33
 
33
34
  @mixin theme-default {
34
35
  --color-text: #{$color-black};
36
+ --color-text-muted: #{$color-gray-dark};
35
37
  --color-background: #{$color-white};
36
38
  --color-background-alt: #{$color-gray-lighter};
37
39
  --color-header: #{$color-white};
@@ -51,6 +53,7 @@ $color-green-darker: #264f30;
51
53
 
52
54
  @mixin theme-student-web {
53
55
  --color-text: #{$color-black};
56
+ --color-text-muted: #{$color-gray-dark};
54
57
  --color-background: #{$color-blue-light};
55
58
  --color-background-alt: #{$color-gray-lighter};
56
59
  --color-header: #{$color-blue-light};
@@ -70,6 +73,7 @@ $color-green-darker: #264f30;
70
73
 
71
74
  @mixin theme-intranet {
72
75
  --color-text: #{$color-black};
76
+ --color-text-muted: #{$color-gray-dark};
73
77
  --color-background: #{$color-sand};
74
78
  --color-background-alt: #{$color-gray-lightest};
75
79
  --color-header: #{$color-sand};
@@ -89,6 +93,7 @@ $color-green-darker: #264f30;
89
93
 
90
94
  @mixin theme-inverse {
91
95
  --color-text: #{$color-white};
96
+ --color-text-muted: #{$color-gray-lightest};
92
97
  --color-background: #{$color-blue-kth};
93
98
  --color-background-alt: #{$color-blue-marine};
94
99
  --color-header: #{$color-blue-marine};
@@ -13,6 +13,7 @@ $icon-fullscreen-off: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fw
13
13
  $icon-fullscreen: 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%22M3.417%2016.583V11H4.5v3.734L14.734%204.5H11V3.417h5.583V9H15.5V5.266L5.266%2015.5H9v1.083H3.417Z%22%2F%3E%3C%2Fsvg%3E");
14
14
  $icon-info-500: 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%22M11%207c-1%200-3.5%202-4%202.5l.5.5c.5-.5%201-1%202-1s-1%204-1%207.5c0%201.5%201%201.5%202%201s2.5-1.5%203-2L13%2015c-1%20.5-1.5%201.5-2%201s1-7%201-8%200-1-1-1ZM12.5%204a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200Z%22%2F%3E%3C%2Fsvg%3E");
15
15
  $icon-info: 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%22M9.25%2014h1.5V9h-1.5v5Zm.746-6.5c.21%200%20.39-.071.535-.214a.714.714%200%200%200%20.219-.532.736.736%200%200%200-.214-.535.714.714%200%200%200-.532-.219.736.736%200%200%200-.535.214.714.714%200%200%200-.219.532c0%20.21.071.39.214.535.143.146.32.219.532.219Zm.01%2010.5a7.81%207.81%200%200%201-3.11-.625%208.064%208.064%200%200%201-2.552-1.719%208.065%208.065%200%200%201-1.719-2.551A7.818%207.818%200%200%201%202%209.99c0-1.104.208-2.14.625-3.105a8.066%208.066%200%200%201%204.27-4.26A7.818%207.818%200%200%201%2010.009%202a7.75%207.75%200%200%201%203.106.625%208.082%208.082%200%200%201%204.26%204.265A7.77%207.77%200%200%201%2018%209.994a7.81%207.81%200%200%201-.625%203.11%208.063%208.063%200%200%201-1.719%202.552%208.08%208.08%200%200%201-2.546%201.719%207.77%207.77%200%200%201-3.104.625Z%22%2F%3E%3C%2Fsvg%3E");
16
+ $icon-input-checkbox: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23212121%22%20d%3D%22m9.55%2018-5.7-5.7%201.425-1.425L9.55%2015.15l9.175-9.175L20.15%207.4%209.55%2018Z%22%2F%3E%3C%2Fsvg%3E");
16
17
  $icon-language: 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%2017.583a7.398%207.398%200%200%201-2.948-.593%207.64%207.64%200%200%201-2.416-1.626%207.64%207.64%200%200%201-1.626-2.416A7.397%207.397%200%200%201%202.417%2010c0-1.052.197-2.037.593-2.954a7.66%207.66%200%200%201%201.626-2.41A7.64%207.64%200%200%201%207.052%203.01%207.397%207.397%200%200%201%2010%202.417c1.052%200%202.037.197%202.954.593a7.66%207.66%200%200%201%202.41%201.626%207.66%207.66%200%200%201%201.626%202.41c.396.917.593%201.902.593%202.954a7.397%207.397%200%200%201-.593%202.948%207.64%207.64%200%200%201-1.626%202.416%207.66%207.66%200%200%201-2.41%201.626%207.384%207.384%200%200%201-2.954.593Zm0-1.121c.3-.3.582-.79.845-1.468.262-.678.464-1.433.605-2.267h-2.9c.151.855.356%201.621.614%202.3.257.677.536%201.156.836%201.435Zm-1.343-.105c-.264-.416-.502-.94-.715-1.573a12.306%2012.306%200%200%201-.488-2.057H4.106a6.426%206.426%200%200%200%201.864%202.4%206.026%206.026%200%200%200%202.687%201.23Zm2.686%200a6.027%206.027%200%200%200%202.687-1.23%206.426%206.426%200%200%200%201.864-2.4h-3.348c-.14.744-.316%201.432-.528%202.065-.213.632-.438%201.154-.675%201.565Zm-7.615-4.713h3.618a9.153%209.153%200%200%201-.072-.87%2024.147%2024.147%200%200%201%200-1.611c.01-.27.034-.54.072-.807H3.728c-.08.269-.138.542-.174.82a6.441%206.441%200%200%200%200%201.648c.036.277.094.551.174.82Zm4.722%200h3.1c.038-.31.062-.597.072-.861a21.579%2021.579%200%200%200%200-1.576%209.133%209.133%200%200%200-.072-.851h-3.1c-.038.296-.062.58-.072.85a22.424%2022.424%200%200%200%200%201.587c.01.272.034.555.072.851Zm4.204%200h3.619c.08-.269.138-.543.173-.82a6.44%206.44%200%200%200%200-1.658%204.633%204.633%200%200%200-.174-.81h-3.618c.038.296.062.585.072.87a24.172%2024.172%200%200%201%200%201.611c-.01.27-.034.539-.072.807Zm-.107-4.372h3.347c-.445-.973-1.063-1.773-1.852-2.4a6.203%206.203%200%200%200-2.699-1.237c.264.443.5.977.707%201.601.207.625.373%201.303.496%202.036Zm-3.997%200h2.9c-.151-.849-.36-1.62-.625-2.31-.266-.692-.54-1.166-.825-1.424-.284.258-.559.732-.824%201.423a12.65%2012.65%200%200%200-.626%202.311Zm-4.444%200h3.348c.124-.733.29-1.411.496-2.036a8.174%208.174%200%200%201%20.707-1.601%206.154%206.154%200%200%200-2.703%201.242%206.486%206.486%200%200%200-1.848%202.395Z%22%2F%3E%3C%2Fsvg%3E");
17
18
  $icon-list-view: 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.756%2014.792v-1.084h8.827v1.084H7.756Zm0-4.25V9.458h8.827v1.084H7.756Zm0-4.25V5.208h8.827v1.084H7.756ZM4.632%2015.47c-.337%200-.623-.12-.86-.36a1.186%201.186%200%200%201-.355-.864c0-.337.12-.624.36-.86.239-.237.527-.356.864-.356.336%200%20.623.12.86.36.236.24.355.528.355.864%200%20.337-.12.624-.36.86-.24.237-.528.356-.864.356Zm0-4.25c-.337%200-.623-.12-.86-.36a1.186%201.186%200%200%201-.355-.864c0-.337.12-.624.36-.86.239-.237.527-.356.864-.356.336%200%20.623.12.86.36.236.24.355.528.355.864%200%20.337-.12.624-.36.86-.24.237-.528.356-.864.356Zm0-4.25c-.337%200-.623-.12-.86-.36a1.186%201.186%200%200%201-.355-.864c0-.337.12-.624.36-.86.239-.237.527-.356.864-.356.336%200%20.623.12.86.36.236.24.355.528.355.864%200%20.337-.12.624-.36.86-.24.237-.528.356-.864.356Z%22%2F%3E%3C%2Fsvg%3E");
18
19
  $icon-menu: 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%22M3.417%2014.195v-1.083h13.166v1.083H3.417Zm0-3.653V9.458h13.166v1.084H3.417Zm0-3.654V5.804h13.166v1.084H3.417Z%22%2F%3E%3C%2Fsvg%3E");
@@ -21,6 +21,10 @@
21
21
  -webkit-mask-size: cover;
22
22
  }
23
23
 
24
+ @mixin icon-input-checkbox {
25
+ @include with-icon(raw.$icon-input-checkbox, 1.5rem);
26
+ }
27
+
24
28
  @mixin icon-language {
25
29
  @include with-icon(raw.$icon-language);
26
30
  }