@appscode/design-system 2.0.41-alpha.11 → 2.0.41-alpha.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugins/theme.js +10 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.0.41-alpha.11",
3
+ "version": "2.0.41-alpha.12",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
package/plugins/theme.js CHANGED
@@ -93,15 +93,13 @@ export function HexToHSL(H) {
93
93
  };
94
94
  }
95
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(document.documentElement).getPropertyValue(
103
- "--hsl-lightness"
96
+ const themeElement = document.querySelector(":root");
97
+ const hue = getComputedStyle(themeElement).getPropertyValue("--primary-hue");
98
+ const saturation = getComputedStyle(themeElement).getPropertyValue(
99
+ "--primary-saturation"
104
100
  );
101
+ const lightness =
102
+ getComputedStyle(themeElement).getPropertyValue("--primary-light");
105
103
 
106
104
  return {
107
105
  hue,
@@ -110,32 +108,12 @@ export function getThemeHSL() {
110
108
  };
111
109
  }
112
110
  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);
111
+ const themeElement = document.querySelector(":root");
112
+ themeElement.style.setProperty("--primary-hue", h);
113
+ themeElement.style.setProperty("--primary-saturation", s);
114
+ themeElement.style.setProperty("--primary-light", l);
121
115
  }
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(document.documentElement).getPropertyValue(
130
- "--font-hsl-lightness"
131
- );
132
116
 
133
- return {
134
- hue,
135
- saturation,
136
- lightness,
137
- };
138
- }
139
117
  export const loaderLightThemePrimaryColor = "#f5f7f9";
140
118
  export const loaderDarkThemePrimaryColor = "#2e323c";
141
119
  export const loaderLightThemeSecondaryColor = "#ecebeb";