@canonical/styles 0.4.0-experimental.0 → 0.5.0-experimental.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 +2 -2
- package/src/index.css +0 -3
- package/src/intents.css +29 -0
- package/src/tokens.css +46 -0
- package/src/baseline-grid.css +0 -24
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/styles",
|
|
3
3
|
"description": "Canonical's base styles",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0-experimental.0",
|
|
5
5
|
"main": "src/index.css",
|
|
6
6
|
"files": [
|
|
7
7
|
"src"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"normalize.css": "^8.0.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "df330656232a65fd560724458a78ba6bf961d07d"
|
|
36
36
|
}
|
package/src/index.css
CHANGED
package/src/intents.css
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
.positive {
|
|
2
2
|
--intent-color: var(--color-background-positive-default);
|
|
3
|
+
--intent-color-tinted: var(--color-background-positive-tinted-default);
|
|
3
4
|
--intent-color-hover: var(--color-background-positive-hover);
|
|
5
|
+
--intent-color-tinted-hover: var(--color-background-positive-tinted-hover);
|
|
4
6
|
--intent-color-active: var(--color-background-positive-active);
|
|
7
|
+
--intent-color-tinted-active: var(--color-background-positive-tinted-active);
|
|
5
8
|
--intent-color-text: var(--color-background-positive-text);
|
|
9
|
+
--intent-color-text-tinted: var(--color-text-default);
|
|
6
10
|
--intent-color-border: var(--intent-color);
|
|
7
11
|
--intent-color-border-hover: var(--intent-color-hover);
|
|
8
12
|
--intent-color-border-active: var(--intent-color-active);
|
|
@@ -10,14 +14,39 @@
|
|
|
10
14
|
|
|
11
15
|
.negative {
|
|
12
16
|
--intent-color: var(--color-background-negative-default);
|
|
17
|
+
--intent-color-tinted: var(--color-background-negative-tinted-default);
|
|
13
18
|
--intent-color-hover: var(--color-background-negative-hover);
|
|
19
|
+
--intent-color-tinted-hover: var(--color-background-negative-tinted-hover);
|
|
14
20
|
--intent-color-active: var(--color-background-negative-active);
|
|
21
|
+
--intent-color-tinted-active: var(--color-background-negative-tinted-active);
|
|
15
22
|
--intent-color-text: var(--color-background-negative-text);
|
|
16
23
|
--intent-color-border: var(--intent-color);
|
|
17
24
|
--intent-color-border-hover: var(--intent-color-hover);
|
|
18
25
|
--intent-color-border-active: var(--intent-color-active);
|
|
19
26
|
}
|
|
20
27
|
|
|
28
|
+
.information {
|
|
29
|
+
--intent-color: var(--color-background-information-default);
|
|
30
|
+
--intent-color-tinted: var(--color-background-information-tinted-default);
|
|
31
|
+
--intent-color-tinted-hover: var(--color-background-information-tinted-hover);
|
|
32
|
+
--intent-color-tinted-active: var(
|
|
33
|
+
--color-background-information-tinted-active
|
|
34
|
+
);
|
|
35
|
+
--intent-color-border: var(--intent-color);
|
|
36
|
+
--intent-color-border-hover: var(--intent-color-hover);
|
|
37
|
+
--intent-color-border-active: var(--intent-color-active);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.caution {
|
|
41
|
+
--intent-color: var(--color-background-caution-default);
|
|
42
|
+
--intent-color-tinted: var(--color-background-caution-tinted-default);
|
|
43
|
+
--intent-color-tinted-hover: var(--color-background-caution-tinted-hover);
|
|
44
|
+
--intent-color-tinted-active: var(--color-background-caution-tinted-active);
|
|
45
|
+
--intent-color-border: var(--intent-color);
|
|
46
|
+
--intent-color-border-hover: var(--intent-color-hover);
|
|
47
|
+
--intent-color-border-active: var(--intent-color-active);
|
|
48
|
+
}
|
|
49
|
+
|
|
21
50
|
.neutral {
|
|
22
51
|
--intent-color: var(--color-background-default);
|
|
23
52
|
--intent-color-hover: var(--color-background-hover);
|
package/src/tokens.css
CHANGED
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
/* based on: https://docs.google.com/spreadsheets/d/1AY6BLFU-Cnj48ggHUnNVlWRxwWZ6Z-66s7jxJC1HLSU/edit?gid=1738212977#gid=1738212977 */
|
|
7
7
|
--color-palette-white: #fff;
|
|
8
8
|
--color-palette-black: #000;
|
|
9
|
+
--color-palette-blue: #24598f;
|
|
10
|
+
--color-palette-yellow: #cc7900;
|
|
9
11
|
|
|
10
12
|
--color-background-default: var(--color-palette-white);
|
|
11
13
|
--color-text-default: var(--color-palette-black);
|
|
12
14
|
--color-background-hover: rgba(242, 242, 242, 1);
|
|
13
15
|
--color-background-active: rgba(235, 235, 235, 1);
|
|
16
|
+
|
|
17
|
+
--color-background-neutral-default: rgb(242, 242, 242);
|
|
18
|
+
--color-background-neutral-hover: rgb(229, 229, 229);
|
|
19
|
+
--color-background-neutral-active: rgb(222, 222, 222);
|
|
20
|
+
|
|
14
21
|
--color-border-high-contrast: rgba(0, 0, 0, 0.56);
|
|
15
22
|
|
|
16
23
|
--color-background-positive-default: rgba(14, 132, 32, 1);
|
|
@@ -18,15 +25,36 @@
|
|
|
18
25
|
--color-background-positive-active: rgba(10, 95, 23, 1);
|
|
19
26
|
--color-background-positive-text: var(--color-palette-white); /* text on positive background */
|
|
20
27
|
|
|
28
|
+
--color-background-positive-tinted-default: rgba(10, 189, 37, 0.1);
|
|
29
|
+
--color-background-positive-tinted-hover: rgba(0, 199, 30, 0.15);
|
|
30
|
+
--color-background-positive-tinted-active: rgba(0, 199, 30, 0.18);
|
|
31
|
+
|
|
32
|
+
--color-background-negative-tinted-default: rgba(199, 0, 20, 0.1);
|
|
33
|
+
--color-background-negative-tinted-hover: rgba(199, 0, 20, 0.15);
|
|
34
|
+
--color-background-negative-tinted-active: rgba(199, 0, 20, 0.18);
|
|
35
|
+
|
|
21
36
|
--color-background-negative-default: rgba(199, 22, 43, 1);
|
|
22
37
|
--color-background-negative-hover: rgba(176, 19, 38, 1);
|
|
23
38
|
--color-background-negative-active: rgba(162, 18, 35, 1);
|
|
24
39
|
--color-background-negative-text: var(--color-palette-white); /* text on positive background */
|
|
25
40
|
|
|
41
|
+
--color-background-information-default: var(--color-palette-blue);
|
|
42
|
+
--color-background-information-tinted-default: rgba(0, 99, 199, 0.1);
|
|
43
|
+
--color-background-information-tinted-hover: rgba(0, 99, 199, 0.15);
|
|
44
|
+
--color-background-information-tinted-active: rgba(0, 99, 199, 0.18);
|
|
45
|
+
|
|
46
|
+
--color-background-caution-default: var(--color-palette-yellow);
|
|
47
|
+
--color-background-caution-tinted-default: rgba(199, 90, 0, 0.1);
|
|
48
|
+
--color-background-caution-tinted-hover: rgba(199, 90, 0, 0.15);
|
|
49
|
+
--color-background-caution-tinted-active: rgba(199, 90, 0, 0.18);
|
|
50
|
+
|
|
26
51
|
/* spacing tokens */
|
|
52
|
+
--spacing-horizontal-xsmall: 0.25rem;
|
|
27
53
|
--spacing-horizontal-small: 0.5rem;
|
|
54
|
+
--spacing-horizontal-medium: 1.25rem;
|
|
28
55
|
--spacing-horizontal-large: 1.5rem;
|
|
29
56
|
|
|
57
|
+
--spacing-vertical-xsmall: 0.25rem;
|
|
30
58
|
--spacing-vertical-small: 0.5rem;
|
|
31
59
|
|
|
32
60
|
--spacing-input-margin-bottom: 0.5rem; /* TODO: needs baseline alignment https://github.com/canonical/vanilla-framework/blob/main/scss/_settings_spacing.scss#L122 */
|
|
@@ -36,8 +64,10 @@
|
|
|
36
64
|
|
|
37
65
|
/* font tokens */
|
|
38
66
|
--font-size-default: 1rem;
|
|
67
|
+
--font-size-small: 0.875rem;
|
|
39
68
|
--font-weight-default: 400;
|
|
40
69
|
--line-height-default: 1.5rem;
|
|
70
|
+
--line-height-small: 1.25rem;
|
|
41
71
|
}
|
|
42
72
|
|
|
43
73
|
/* component semantic tokens */
|
|
@@ -58,4 +88,20 @@
|
|
|
58
88
|
--button-font-size: var(--font-size-default);
|
|
59
89
|
--button-font-weight: var(--font-weight-default);
|
|
60
90
|
--button-line-height: var(--line-height-default);
|
|
91
|
+
|
|
92
|
+
--chip-color-background: var(--color-background-neutral-default);
|
|
93
|
+
--chip-color-background-hover: var(--color-background-neutral-hover);
|
|
94
|
+
--chip-color-background-active: var(--color-background-neutral-active);
|
|
95
|
+
--chip-color-border: var(--color-border-high-contrast);
|
|
96
|
+
--chip-color-text: var(--color-text-default);
|
|
97
|
+
|
|
98
|
+
--chip-border-radius: 1rem;
|
|
99
|
+
--chip-font-size: var(--font-size-small);
|
|
100
|
+
--chip-font-weight: var(--font-weight-default);
|
|
101
|
+
--chip-line-height: var(--line-height-small);
|
|
102
|
+
--chip-border-width: var(--spacing-border-width);
|
|
103
|
+
--chip-padding-vertical: var(--spacing-vertical-xsmall);
|
|
104
|
+
--chip-padding-horizontal: var(--spacing-horizontal-small);
|
|
105
|
+
--chip-margin-bottom: var(--spacing-vertical-small);
|
|
106
|
+
--chip-margin-left: var(--spacing-horizontal-medium);
|
|
61
107
|
}
|
package/src/baseline-grid.css
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.show-baseline-grid {
|
|
2
|
-
--color-baseline-grid: rgba(255, 0, 0, 0.2);
|
|
3
|
-
position: relative;
|
|
4
|
-
|
|
5
|
-
&::after {
|
|
6
|
-
background: linear-gradient(
|
|
7
|
-
to top,
|
|
8
|
-
var(--color-baseline-grid),
|
|
9
|
-
var(--color-baseline-grid) 1px,
|
|
10
|
-
transparent 1px,
|
|
11
|
-
transparent
|
|
12
|
-
);
|
|
13
|
-
background-size: 100% var(--sp-unit);
|
|
14
|
-
bottom: 0;
|
|
15
|
-
content: "";
|
|
16
|
-
display: block;
|
|
17
|
-
left: 0;
|
|
18
|
-
pointer-events: none;
|
|
19
|
-
position: absolute;
|
|
20
|
-
right: 0;
|
|
21
|
-
top: 0;
|
|
22
|
-
z-index: 200;
|
|
23
|
-
}
|
|
24
|
-
}
|