@kth/style 0.2.2 → 0.3.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/README.md +1 -1
- package/assets/figtree-italic[wght].woff2 +0 -0
- package/assets/figtree[wght].woff2 +0 -0
- package/assets/fonts.css +13 -0
- package/assets/kth-logotype-blue.png +0 -0
- package/assets/kth-logotype-blue.webp +0 -0
- package/assets/kth-logotype-blue@2x.png +0 -0
- package/assets/kth-logotype-blue@2x.webp +0 -0
- package/assets/kth-logotype-blue@3x.png +0 -0
- package/assets/kth-logotype-blue@3x.webp +0 -0
- package/assets/kth-logotype-blue@4x.png +0 -0
- package/assets/kth-logotype-blue@4x.webp +0 -0
- package/assets/kth-logotype-white.png +0 -0
- package/assets/kth-logotype-white.webp +0 -0
- package/assets/kth-logotype-white@2x.png +0 -0
- package/assets/kth-logotype-white@2x.webp +0 -0
- package/assets/kth-logotype-white@3x.png +0 -0
- package/assets/kth-logotype-white@3x.webp +0 -0
- package/assets/kth-logotype-white@4x.png +0 -0
- package/assets/kth-logotype-white@4x.webp +0 -0
- package/package.json +4 -3
- package/scss/components/button.scss +2 -1
- package/scss/components/details.scss +51 -0
- package/scss/components/header.scss +9 -0
- package/scss/tokens/colors.scss +25 -12
- package/scss/utils/prose.scss +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Styles and components used across KTH.
|
|
4
4
|
|
|
5
|
-
Documentation available in the [KTH Style website](https://
|
|
5
|
+
Documentation available in the [KTH Style website](https://kthstyledemoprod.z6.web.core.windows.net/style)
|
|
6
6
|
|
|
7
7
|
## Structure
|
|
8
8
|
|
|
Binary file
|
|
Binary file
|
package/assets/fonts.css
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: Figtree;
|
|
3
|
+
src: url("figtree[wght].woff2") format("woff2-variations");
|
|
4
|
+
font-weight: 100 900;
|
|
5
|
+
font-style: normal;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@font-face {
|
|
9
|
+
font-family: Figtree;
|
|
10
|
+
src: url("figtree-italic[wght].woff2") format("woff2-variations");
|
|
11
|
+
font-weight: 100 900;
|
|
12
|
+
font-style: italic;
|
|
13
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kth/style",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"scss",
|
|
26
|
-
"dist"
|
|
26
|
+
"dist",
|
|
27
|
+
"assets"
|
|
27
28
|
],
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@rollup/plugin-commonjs": "^24.1.0",
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"peerDependencies": {
|
|
48
49
|
"react": "*"
|
|
49
50
|
},
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "22910d9bc7994e3704105c0f2ab3ca45a422d960"
|
|
51
52
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use "../tokens/spacing.scss";
|
|
2
|
+
@use "../tokens/icons.scss";
|
|
3
|
+
|
|
4
|
+
/// When true, the file generates CSS code for the entire document
|
|
5
|
+
///
|
|
6
|
+
/// Set to `false` when importing if you want to use the mixin but don't want
|
|
7
|
+
/// to have the "kth-details" class
|
|
8
|
+
$generate-css: true !default;
|
|
9
|
+
$border-width: spacing.$space-4;
|
|
10
|
+
|
|
11
|
+
@mixin details {
|
|
12
|
+
summary {
|
|
13
|
+
color: var(--color-tertiary);
|
|
14
|
+
padding-block: var(--space-inner-block);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
// padding-inline-start: spacing.$space-20;
|
|
17
|
+
list-style: none;
|
|
18
|
+
font: inherit;
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: 1.5rem auto;
|
|
21
|
+
|
|
22
|
+
&::before {
|
|
23
|
+
@include icons.icon-caret-right;
|
|
24
|
+
background-color: var(--color-tertiary);
|
|
25
|
+
margin-block: spacing.$space-2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
text-decoration: underline;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[open] summary::before {
|
|
34
|
+
rotate: 0deg;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
> div {
|
|
38
|
+
border-inline-start: $border-width solid var(--color-tertiary);
|
|
39
|
+
padding-inline-start: spacing.$space-16;
|
|
40
|
+
padding-block: spacing.$space-8;
|
|
41
|
+
margin-inline-start: spacing.$space-8;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@if $generate-css {
|
|
46
|
+
@layer kth-style {
|
|
47
|
+
.kth-details {
|
|
48
|
+
@include details;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -5,12 +5,21 @@
|
|
|
5
5
|
@layer kth-style {
|
|
6
6
|
.kth-header.intranet {
|
|
7
7
|
@include colors.theme-intranet;
|
|
8
|
+
.kth-logotype img.white {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
12
|
.kth-header.external {
|
|
10
13
|
@include colors.theme-inverse;
|
|
14
|
+
.kth-logotype img.blue {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
18
|
.kth-header.student-web {
|
|
13
19
|
@include colors.theme-student-web;
|
|
20
|
+
.kth-logotype img.white {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
.kth-header {
|
package/scss/tokens/colors.scss
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Gray-scale
|
|
2
2
|
$color-white: #fcfcfc;
|
|
3
3
|
$color-black: #212121;
|
|
4
|
+
$color-gray-lightest: #f2f2f2;
|
|
5
|
+
$color-gray-lighter: #ededed;
|
|
4
6
|
$color-gray-light: #e6e6e6;
|
|
5
7
|
$color-gray-medium: #a5a5a5;
|
|
6
8
|
$color-gray-dark: #323232;
|
|
@@ -10,51 +12,62 @@ $color-sand: #e6e1dd;
|
|
|
10
12
|
$color-blue-kth: #004791;
|
|
11
13
|
$color-blue-light: #e0edfc;
|
|
12
14
|
$color-blue-sky: #6298d2;
|
|
15
|
+
$color-blue-lake: #036eb8; // This is defined by us for links
|
|
13
16
|
$color-blue-marine: #08004f;
|
|
14
17
|
$color-blue-digital: #221dd9;
|
|
15
18
|
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
$color-
|
|
19
|
+
// Other colors, defined by us to meet various needs
|
|
20
|
+
$color-red-light: #fad6d6;
|
|
21
|
+
$color-red: #c7321d;
|
|
22
|
+
$color-red-dark: #bf2c17;
|
|
23
|
+
$color-green-light: #d8ffe7;
|
|
24
|
+
$color-green: #3d784a;
|
|
25
|
+
$color-green-dark: #366f43;
|
|
21
26
|
|
|
22
27
|
@mixin theme-default {
|
|
23
28
|
--color-text: #{$color-black};
|
|
24
29
|
--color-background: #{$color-white};
|
|
30
|
+
--color-background-alt: #{$color-gray-lighter};
|
|
25
31
|
--color-primary: #{$color-blue-kth};
|
|
26
32
|
--color-on-primary: #{$color-white};
|
|
27
33
|
--color-secondary: #{$color-black};
|
|
28
|
-
--color-tertiary: #{$color-blue-
|
|
29
|
-
|
|
34
|
+
--color-tertiary: #{$color-blue-lake};
|
|
35
|
+
--color-error: #{$color-red};
|
|
36
|
+
--color-success: #{$color-green};
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
@mixin theme-student-web {
|
|
33
40
|
--color-text: #{$color-black};
|
|
34
41
|
--color-background: #{$color-blue-light};
|
|
42
|
+
--color-background-alt: #{$color-gray-lighter};
|
|
35
43
|
--color-primary: #{$color-blue-kth};
|
|
36
44
|
--color-on-primary: #{$color-white};
|
|
37
45
|
--color-secondary: #{$color-black};
|
|
38
|
-
--color-tertiary: #{$color-blue-
|
|
39
|
-
|
|
46
|
+
--color-tertiary: #{$color-blue-lake};
|
|
47
|
+
--color-error: #{$color-red-dark};
|
|
48
|
+
--color-success: #{$color-green-dark};
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
@mixin theme-intranet {
|
|
43
52
|
--color-text: #{$color-black};
|
|
44
53
|
--color-background: #{$color-sand};
|
|
54
|
+
--color-background-alt: #{$color-gray-lightest};
|
|
45
55
|
--color-primary: #{$color-blue-kth};
|
|
46
56
|
--color-on-primary: #{$color-white};
|
|
47
57
|
--color-secondary: #{$color-black};
|
|
48
|
-
--color-tertiary: #{$color-blue-
|
|
49
|
-
|
|
58
|
+
--color-tertiary: #{$color-blue-kth};
|
|
59
|
+
--color-error: #{$color-red-dark};
|
|
60
|
+
--color-success: #{$color-green-dark};
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
@mixin theme-inverse {
|
|
53
64
|
--color-text: #{$color-white};
|
|
54
65
|
--color-background: #{$color-blue-kth};
|
|
66
|
+
--color-background-alt: #{$color-blue-marine};
|
|
55
67
|
--color-primary: #{$color-white};
|
|
56
68
|
--color-on-primary: #{$color-blue-kth};
|
|
57
69
|
--color-secondary: #{$color-white};
|
|
58
70
|
--color-tertiary: #{$color-white};
|
|
59
|
-
|
|
71
|
+
--color-error: #{$color-red-light};
|
|
72
|
+
--color-success: #{$color-green-light};
|
|
60
73
|
}
|