@appscode/design-system 1.0.43-alpha.10 → 1.0.43-alpha.15
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/base/utilities/_default.scss +1 -1
- package/base/utilities/_initial-variables.scss +1 -1
- package/components/_ac-multi-select.scss +1 -1
- package/components/_ac-table.scss +5 -2
- package/components/_ac-tags.scss +1 -1
- package/components/_buttons.scss +1 -1
- package/components/_wizard.scss +1 -1
- package/components/bbum/_information-center.scss +2 -2
- package/components/bbum/_user-profile.scss +1 -1
- package/package.json +1 -1
- package/plugins/theme.js +138 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +1 -1
|
@@ -686,7 +686,7 @@ $border_color_4: transparent transparent #585d6e transparent;
|
|
|
686
686
|
height: 10px;
|
|
687
687
|
width: 10px;
|
|
688
688
|
border-radius: 50%;
|
|
689
|
-
background: $ac-
|
|
689
|
+
background: $ac-gray-lightest;
|
|
690
690
|
border: 2px solid $ac-white;
|
|
691
691
|
display: inline-flex;
|
|
692
692
|
|
|
@@ -49,13 +49,16 @@
|
|
|
49
49
|
td {
|
|
50
50
|
border: none;
|
|
51
51
|
font-size: $font-size-small;
|
|
52
|
-
color:
|
|
52
|
+
color: hsl(
|
|
53
|
+
var(--font-hsl-hue),
|
|
54
|
+
var(--font-hsl-saturation),
|
|
55
|
+
calc(var(--font-hsl-lightness) + 25%)
|
|
56
|
+
);
|
|
53
57
|
font-weight: 400;
|
|
54
58
|
padding: 3px 0px;
|
|
55
59
|
min-width: 230px;
|
|
56
60
|
|
|
57
61
|
&:first-child {
|
|
58
|
-
color: $ac-black;
|
|
59
62
|
font-weight: 400;
|
|
60
63
|
padding-right: 10px;
|
|
61
64
|
color: $ac-color-heading;
|
package/components/_ac-tags.scss
CHANGED
package/components/_buttons.scss
CHANGED
package/components/_wizard.scss
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
height: 160px;
|
|
73
73
|
background-size: cover;
|
|
74
74
|
background-position: center;
|
|
75
|
-
background-color: $ac-
|
|
75
|
+
background-color: $ac-gray-lightest;
|
|
76
76
|
position: relative;
|
|
77
77
|
z-index: 1;
|
|
78
78
|
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
transition: 0.3s;
|
|
127
127
|
|
|
128
128
|
&:hover {
|
|
129
|
-
color: $ac-
|
|
129
|
+
color: $ac-gray-lightest;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
package/package.json
CHANGED
package/plugins/theme.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export function HSLToHex(h, s, l) {
|
|
2
|
+
s /= 100;
|
|
3
|
+
l /= 100;
|
|
4
|
+
|
|
5
|
+
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
6
|
+
x = c * (1 - Math.abs(((h / 60) % 2) - 1)),
|
|
7
|
+
m = l - c / 2;
|
|
8
|
+
|
|
9
|
+
let r = 0,
|
|
10
|
+
g = 0,
|
|
11
|
+
b = 0;
|
|
12
|
+
|
|
13
|
+
if (0 <= h && h < 60) {
|
|
14
|
+
r = c;
|
|
15
|
+
g = x;
|
|
16
|
+
b = 0;
|
|
17
|
+
} else if (60 <= h && h < 120) {
|
|
18
|
+
r = x;
|
|
19
|
+
g = c;
|
|
20
|
+
b = 0;
|
|
21
|
+
} else if (120 <= h && h < 180) {
|
|
22
|
+
r = 0;
|
|
23
|
+
g = c;
|
|
24
|
+
b = x;
|
|
25
|
+
} else if (180 <= h && h < 240) {
|
|
26
|
+
r = 0;
|
|
27
|
+
g = x;
|
|
28
|
+
b = c;
|
|
29
|
+
} else if (240 <= h && h < 300) {
|
|
30
|
+
r = x;
|
|
31
|
+
g = 0;
|
|
32
|
+
b = c;
|
|
33
|
+
} else if (300 <= h && h < 360) {
|
|
34
|
+
r = c;
|
|
35
|
+
g = 0;
|
|
36
|
+
b = x;
|
|
37
|
+
}
|
|
38
|
+
// Having obtained RGB, convert channels to hex
|
|
39
|
+
r = Math.round((r + m) * 255).toString(16);
|
|
40
|
+
g = Math.round((g + m) * 255).toString(16);
|
|
41
|
+
b = Math.round((b + m) * 255).toString(16);
|
|
42
|
+
|
|
43
|
+
// Prepend 0s, if necessary
|
|
44
|
+
if (r.length == 1) r = "0" + r;
|
|
45
|
+
if (g.length == 1) g = "0" + g;
|
|
46
|
+
if (b.length == 1) b = "0" + b;
|
|
47
|
+
|
|
48
|
+
return "#" + r + g + b;
|
|
49
|
+
}
|
|
50
|
+
export function HexToHSL(H) {
|
|
51
|
+
// Convert hex to RGB first
|
|
52
|
+
let r = 0,
|
|
53
|
+
g = 0,
|
|
54
|
+
b = 0;
|
|
55
|
+
if (H.length == 4) {
|
|
56
|
+
r = parseInt("0x" + H[1] + H[1]);
|
|
57
|
+
g = parseInt("0x" + H[2] + H[2]);
|
|
58
|
+
b = parseInt("0x" + H[3] + H[3]);
|
|
59
|
+
} else if (H.length == 7) {
|
|
60
|
+
r = parseInt("0x" + H[1] + H[2]);
|
|
61
|
+
g = parseInt("0x" + H[3] + H[4]);
|
|
62
|
+
b = parseInt("0x" + H[5] + H[6]);
|
|
63
|
+
}
|
|
64
|
+
// Then to HSL
|
|
65
|
+
r /= 255;
|
|
66
|
+
g /= 255;
|
|
67
|
+
b /= 255;
|
|
68
|
+
const cmin = Math.min(r, g, b),
|
|
69
|
+
cmax = Math.max(r, g, b),
|
|
70
|
+
delta = cmax - cmin;
|
|
71
|
+
let h = 0,
|
|
72
|
+
s = 0,
|
|
73
|
+
l = 0;
|
|
74
|
+
|
|
75
|
+
if (delta == 0) h = 0;
|
|
76
|
+
else if (cmax == r) h = ((g - b) / delta) % 6;
|
|
77
|
+
else if (cmax == g) h = (b - r) / delta + 2;
|
|
78
|
+
else h = (r - g) / delta + 4;
|
|
79
|
+
|
|
80
|
+
h = Math.round(h * 60);
|
|
81
|
+
|
|
82
|
+
if (h < 0) h += 360;
|
|
83
|
+
|
|
84
|
+
l = (cmax + cmin) / 2;
|
|
85
|
+
s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
|
|
86
|
+
s = +(s * 100).toFixed(1);
|
|
87
|
+
l = +(l * 100).toFixed(1);
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
hue: `${h}`,
|
|
91
|
+
saturation: `${s}%`,
|
|
92
|
+
lightness: `${l}%`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export function getThemeHSL() {
|
|
96
|
+
const hue = getComputedStyle(document.documentElement).getPropertyValue(
|
|
97
|
+
"--hsl-hue"
|
|
98
|
+
);
|
|
99
|
+
const saturation = getComputedStyle(
|
|
100
|
+
document.documentElement
|
|
101
|
+
).getPropertyValue("--hsl-saturation");
|
|
102
|
+
const lightness = getComputedStyle(
|
|
103
|
+
document.documentElement
|
|
104
|
+
).getPropertyValue("--hsl-lightness");
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
hue,
|
|
108
|
+
saturation,
|
|
109
|
+
lightness,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export function setThemeHSL(h, s, l) {
|
|
113
|
+
document.documentElement.style.setProperty("--hsl-hue", h);
|
|
114
|
+
document.documentElement.style.setProperty("--hsl-saturation", s);
|
|
115
|
+
document.documentElement.style.setProperty("--hsl-lightness", l);
|
|
116
|
+
}
|
|
117
|
+
export function setFontHSL(h, s, l) {
|
|
118
|
+
document.documentElement.style.setProperty("--font-hsl-hue", h);
|
|
119
|
+
document.documentElement.style.setProperty("--font-hsl-saturation", s);
|
|
120
|
+
document.documentElement.style.setProperty("--font-hsl-lightness", l);
|
|
121
|
+
}
|
|
122
|
+
export function getFontHSL() {
|
|
123
|
+
const hue = getComputedStyle(document.documentElement).getPropertyValue(
|
|
124
|
+
"--font-hsl-hue"
|
|
125
|
+
);
|
|
126
|
+
const saturation = getComputedStyle(
|
|
127
|
+
document.documentElement
|
|
128
|
+
).getPropertyValue("--font-hsl-saturation");
|
|
129
|
+
const lightness = getComputedStyle(
|
|
130
|
+
document.documentElement
|
|
131
|
+
).getPropertyValue("--font-hsl-lightness");
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
hue,
|
|
135
|
+
saturation,
|
|
136
|
+
lightness,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
@@ -57,9 +57,9 @@ export default defineComponent({
|
|
|
57
57
|
|
|
58
58
|
// attach click event listener on window, and close the dropdown
|
|
59
59
|
function deactivateDropdown(e: Event) {
|
|
60
|
-
e.preventDefault();
|
|
61
60
|
const { target } = e;
|
|
62
61
|
if (
|
|
62
|
+
isDropdownActive.value &&
|
|
63
63
|
dropdown.value &&
|
|
64
64
|
dropdown.value !== target &&
|
|
65
65
|
!dropdown.value.contains(target as Node)
|