jb-core 0.6.0 → 0.7.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 +1 -1
- package/theme/colors.ts +37 -19
- package/theme/utils.ts +9 -0
package/package.json
CHANGED
package/theme/colors.ts
CHANGED
|
@@ -1,48 +1,60 @@
|
|
|
1
|
+
import { setCssProperty } from "./utils";
|
|
2
|
+
|
|
3
|
+
const colors = {
|
|
4
|
+
single:{
|
|
5
|
+
black:"oklch(0.14 0 0)",
|
|
6
|
+
white:"oklch(1 0 0)",
|
|
7
|
+
}
|
|
8
|
+
}
|
|
1
9
|
export function defineColors() {
|
|
2
|
-
|
|
10
|
+
defineColorCodes();
|
|
11
|
+
defineTextColors();
|
|
12
|
+
}
|
|
13
|
+
function defineColorCodes(){
|
|
14
|
+
setCssProperty({
|
|
3
15
|
name: "--jb-primary",
|
|
4
16
|
syntax: "<color>",
|
|
5
17
|
inherits: true,
|
|
6
18
|
initialValue: "oklch(0.6 0.26 256)",
|
|
7
19
|
});
|
|
8
|
-
|
|
20
|
+
setCssProperty({
|
|
9
21
|
name: "--jb-neutral",
|
|
10
22
|
syntax: "<color>",
|
|
11
23
|
inherits: true,
|
|
12
24
|
initialValue: "oklch(0.18 0.014 258.36)",
|
|
13
25
|
});
|
|
14
|
-
|
|
26
|
+
setCssProperty({
|
|
15
27
|
name: "--jb-black",
|
|
16
28
|
syntax: "<color>",
|
|
17
29
|
inherits: true,
|
|
18
|
-
initialValue:
|
|
30
|
+
initialValue: colors.single.black,
|
|
19
31
|
});
|
|
20
|
-
|
|
32
|
+
setCssProperty({
|
|
21
33
|
name: "--jb-white",
|
|
22
34
|
syntax: "<color>",
|
|
23
35
|
inherits: true,
|
|
24
|
-
initialValue:
|
|
36
|
+
initialValue: colors.single.white ,
|
|
25
37
|
});
|
|
26
|
-
|
|
38
|
+
setCssProperty({
|
|
27
39
|
name: "--jb-green",
|
|
28
40
|
syntax: "<color>",
|
|
29
41
|
inherits: true,
|
|
30
42
|
initialValue: "oklch(0.68 0.1484 162.1)",
|
|
31
43
|
});
|
|
32
|
-
|
|
44
|
+
setCssProperty({
|
|
33
45
|
name: "--jb-red",
|
|
34
46
|
syntax: "<color>",
|
|
35
47
|
inherits: true,
|
|
36
|
-
initialValue: "oklch(0.
|
|
48
|
+
initialValue: "oklch(0.6 0.22 23.21)",
|
|
37
49
|
});
|
|
38
|
-
|
|
50
|
+
setCssProperty({
|
|
39
51
|
name: `--jb-neutral`,
|
|
40
52
|
syntax: "<color>",
|
|
41
53
|
inherits: true,
|
|
42
54
|
initialValue: getNeutralColor(0),
|
|
43
55
|
});
|
|
44
56
|
for(let i=1;i<=10;i++){
|
|
45
|
-
|
|
57
|
+
setCssProperty({
|
|
46
58
|
name: `--jb-neutral-${i}`,
|
|
47
59
|
syntax: "<color>",
|
|
48
60
|
inherits: true,
|
|
@@ -50,15 +62,21 @@ export function defineColors() {
|
|
|
50
62
|
});
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
function defineTextColors() {
|
|
66
|
+
setCssProperty({
|
|
67
|
+
name: "--jb-text-primary",
|
|
68
|
+
syntax: "<color>",
|
|
69
|
+
inherits: true,
|
|
70
|
+
initialValue: colors.single.black,
|
|
71
|
+
});
|
|
72
|
+
setCssProperty({
|
|
73
|
+
name: "--jb-text-secondary",
|
|
74
|
+
syntax: "<color>",
|
|
75
|
+
inherits: true,
|
|
76
|
+
initialValue: getNeutralColor(7),
|
|
77
|
+
});
|
|
61
78
|
}
|
|
79
|
+
|
|
62
80
|
//
|
|
63
81
|
export function getNeutralColor(index: number) {
|
|
64
82
|
return `oklch(${(6 * (3+index*1.3))*0.01} ${(14+(index*0.09))*0.001} 258.36)`;
|