@andreyshpigunov/x 0.3.89 → 0.4.1

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 (65) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/README.md +1 -1
  3. package/assets/css/app.css +1 -0
  4. package/assets/img/github-mark-white.png +0 -0
  5. package/assets/img/github-mark.png +0 -0
  6. package/assets/js/app.js +1 -0
  7. package/cheatsheet.html +427 -0
  8. package/dist/x.css +1 -1
  9. package/dist/x.js +1 -3
  10. package/index.html +34 -38
  11. package/package.json +52 -47
  12. package/postcss.config.cjs +0 -2
  13. package/src/components/x/animate.js +39 -45
  14. package/src/components/x/appear.js +19 -26
  15. package/src/components/x/autocomplete.js +22 -10
  16. package/src/components/x/buttons.css +38 -16
  17. package/src/components/x/colors.css +47 -41
  18. package/src/components/x/debug.css +2 -2
  19. package/src/components/x/device.js +39 -33
  20. package/src/components/x/dropdown.css +2 -3
  21. package/src/components/x/dropdown.js +16 -9
  22. package/src/components/x/flex.css +146 -109
  23. package/src/components/x/flow.css +12 -6
  24. package/src/components/x/form.css +3 -3
  25. package/src/components/x/form.js +12 -9
  26. package/src/components/x/grid.css +78 -42
  27. package/src/components/x/helpers.css +601 -438
  28. package/src/components/x/hover.js +20 -9
  29. package/src/components/x/icons.css +12 -12
  30. package/src/components/x/lazyload.js +17 -8
  31. package/src/components/x/lib.js +15 -1
  32. package/src/components/x/links.css +2 -6
  33. package/src/components/x/loadmore.js +17 -5
  34. package/src/components/x/modal.css +4 -22
  35. package/src/components/x/modal.js +14 -5
  36. package/src/components/x/reset.css +1 -15
  37. package/src/components/x/scroll.css +4 -9
  38. package/src/components/x/scroll.js +14 -1
  39. package/src/components/x/sheets.css +0 -3
  40. package/src/components/x/sheets.js +157 -37
  41. package/src/components/x/slider.css +10 -1
  42. package/src/components/x/slider.js +15 -0
  43. package/src/components/x/space.css +22 -2
  44. package/src/components/x/sticky.css +10 -15
  45. package/src/components/x/sticky.js +21 -4
  46. package/src/components/x/typo.css +14 -40
  47. package/src/css/app.css +92 -93
  48. package/src/css/x.css +191 -213
  49. package/src/js/app.js +9 -9
  50. package/src/js/x.js +37 -41
  51. package/assets/github-mark-white.png +0 -0
  52. package/assets/github-mark.png +0 -0
  53. package/assets/logo-inverse.png +0 -0
  54. package/babel.config.cjs +0 -4
  55. package/dist/app.css +0 -1
  56. package/dist/app.js +0 -1
  57. package/dist/index.html +0 -2182
  58. package/dist/logo.png +0 -0
  59. package/jest.config.mjs +0 -7
  60. package/jsdoc.json +0 -11
  61. package/vite.config.js +0 -31
  62. /package/assets/{alpha.png → img/alpha.png} +0 -0
  63. /package/assets/{apple-touch-icon.png → img/apple-touch-icon.png} +0 -0
  64. /package/assets/{logo.png → img/logo.png} +0 -0
  65. /package/assets/{logo.svg → img/logo.svg} +0 -0
@@ -22,25 +22,19 @@
22
22
  * "classRemove": true
23
23
  * }'></div>
24
24
  *
25
- * Next.js: call init() in useEffect(); on route change call destroy() in cleanup and init() after mount.
26
25
  * SSR-safe: init/destroy no-op when window is undefined.
27
26
  *
28
27
  * @example
29
- * // Next.js_app.tsx or layout
30
- * import { useEffect } from 'react';
31
- * import { usePathname } from 'next/navigation';
32
- * import { animate } from '@andreyshpigunov/x/animate';
33
- *
34
- * export default function App({ Component, pageProps }) {
35
- * const pathname = usePathname();
36
- *
37
- * useEffect(() => {
38
- * animate.init();
39
- * return () => animate.destroy();
40
- * }, [pathname]);
41
- *
42
- * return <Component {...pageProps} />;
43
- * }
28
+ * // Vanilla JS plain HTML
29
+ * // index.html:
30
+ * // <script type="module">
31
+ * // import { animate } from './src/components/x/animate.js';
32
+ * // window.coverOut = (item) => {
33
+ * // // item.progress is 0..1 (string with 4 decimals)
34
+ * // item.element.style.setProperty('--progress', item.progress);
35
+ * // };
36
+ * // window.addEventListener('DOMContentLoaded', () => animate.init());
37
+ * // </script>
44
38
  *
45
39
  * @author Andrey Shpigunov
46
40
  * @version 0.4
@@ -53,7 +47,7 @@ import { lib } from './lib';
53
47
  * Scroll-based animation controller.
54
48
  */
55
49
  class Animate {
56
-
50
+
57
51
  constructor() {
58
52
  /**
59
53
  * Prevents multiple `requestAnimationFrame` calls.
@@ -61,42 +55,42 @@ class Animate {
61
55
  * @private
62
56
  */
63
57
  this._ticking = false;
64
-
58
+
65
59
  /**
66
60
  * Array of animation items parsed from `[x-animate]` elements.
67
61
  * @type {Object[]}
68
62
  * @private
69
63
  */
70
64
  this._animations = [];
71
-
65
+
72
66
  /**
73
67
  * Bound scroll handler for `requestAnimationFrame`.
74
68
  * @type {Function}
75
69
  * @private
76
70
  */
77
71
  this._scroll = this._scroll.bind(this);
78
-
72
+
79
73
  /**
80
74
  * Bound raw scroll/resize handler.
81
75
  * @type {Function}
82
76
  * @private
83
77
  */
84
78
  this._scrollHandler = this._scrollHandler.bind(this);
85
-
79
+
86
80
  /**
87
81
  * Indicates whether `init()` was called.
88
82
  * @type {boolean}
89
83
  * @private
90
84
  */
91
85
  this._initialized = false;
92
-
86
+
93
87
  /**
94
88
  * Set of parent elements being listened to for scroll.
95
89
  * @type {Set<HTMLElement|Window>}
96
90
  * @private
97
91
  */
98
92
  this._parents = new Set();
99
-
93
+
100
94
  /**
101
95
  * NodeList of elements with `[x-animate]`.
102
96
  * @type {NodeListOf<HTMLElement>|null}
@@ -104,25 +98,25 @@ class Animate {
104
98
  */
105
99
  this._elements = null;
106
100
  }
107
-
101
+
108
102
  /**
109
103
  * Initializes or reinitializes animation tracking for `[x-animate]` elements.
110
104
  */
111
105
  init() {
112
106
  if (typeof window === 'undefined') return;
113
-
107
+
114
108
  this._cleanup();
115
-
109
+
116
110
  this._elements = lib.qsa('[x-animate]');
117
111
  if (!this._elements?.length) return;
118
-
112
+
119
113
  this._parseElementsAnimations();
120
114
  if (!this._animations.length) return;
121
-
115
+
122
116
  this._setupListeners();
123
117
  this._initialized = true;
124
118
  }
125
-
119
+
126
120
  /**
127
121
  * Removes all listeners and resets internal state.
128
122
  *
@@ -131,27 +125,27 @@ class Animate {
131
125
  _cleanup() {
132
126
  if (!this._initialized) return;
133
127
  if (typeof window === 'undefined') return;
134
-
128
+
135
129
  this._parents.forEach(parent => {
136
130
  parent.removeEventListener('scroll', this._scrollHandler);
137
131
  });
138
132
  window.removeEventListener('resize', this._scrollHandler);
139
-
133
+
140
134
  this._ticking = false;
141
135
  this._animations = [];
142
136
  this._parents = new Set();
143
137
  this._elements = null;
144
138
  this._initialized = false;
145
139
  }
146
-
140
+
147
141
  /**
148
- * Stops observing and resets state. Use when unmounting (e.g. Next.js route change).
142
+ * Stops observing and resets state. Use when unmounting (page change / removing DOM).
149
143
  */
150
144
  destroy() {
151
145
  if (typeof window === 'undefined') return;
152
146
  this._cleanup();
153
147
  }
154
-
148
+
155
149
  /**
156
150
  * Parses `[x-animate]` attributes and creates animation configuration for each element.
157
151
  *
@@ -181,7 +175,7 @@ class Animate {
181
175
  }
182
176
  }
183
177
  }
184
-
178
+
185
179
  /**
186
180
  * Sets up scroll and resize event listeners for unique parent containers.
187
181
  *
@@ -195,7 +189,7 @@ class Animate {
195
189
  }
196
190
  }
197
191
  window.addEventListener('resize', this._scrollHandler);
198
-
192
+
199
193
  const runScroll = () => requestAnimationFrame(() => this._scroll());
200
194
  if (document.readyState === 'complete') {
201
195
  runScroll();
@@ -203,7 +197,7 @@ class Animate {
203
197
  window.addEventListener('load', runScroll, { once: true });
204
198
  }
205
199
  }
206
-
200
+
207
201
  /**
208
202
  * Raw scroll/resize event handler with throttling via `requestAnimationFrame`.
209
203
  *
@@ -218,7 +212,7 @@ class Animate {
218
212
  });
219
213
  }
220
214
  }
221
-
215
+
222
216
  /**
223
217
  * Main animation logic executed on scroll or resize.
224
218
  *
@@ -242,9 +236,9 @@ class Animate {
242
236
  const hasStart = !isNaN(start);
243
237
  const hasEnd = !isNaN(end);
244
238
  const fn = item.fn;
245
-
239
+
246
240
  if (item.log) console.log(top, start, end, item);
247
-
241
+
248
242
  if (hasStart && hasEnd) {
249
243
  item.duration = start - end;
250
244
  const inRange = top <= start && top >= end;
@@ -291,7 +285,7 @@ class Animate {
291
285
  }
292
286
  }
293
287
  }
294
-
288
+
295
289
  /**
296
290
  * Converts a value like '120vh', '50%' or '300' into pixels.
297
291
  *
@@ -305,9 +299,9 @@ class Animate {
305
299
  if (typeof value !== 'string') return NaN;
306
300
  const num = parseFloat(value);
307
301
  if (!/[%vh]/.test(value)) return num;
308
- const height = value.includes('vh')
309
- ? document.documentElement.clientHeight
310
- : (parent === window ? document.documentElement.clientHeight : parent.clientHeight);
302
+ const height = value.includes('vh') ?
303
+ document.documentElement.clientHeight :
304
+ (parent === window ? document.documentElement.clientHeight : parent.clientHeight);
311
305
  return (height * num) / 100;
312
306
  }
313
307
  }
@@ -316,4 +310,4 @@ class Animate {
316
310
  * Singleton export of the Animate controller.
317
311
  * @type {Animate}
318
312
  */
319
- export const animate = new Animate();
313
+ export const animate = new Animate();
@@ -31,25 +31,18 @@
31
31
  * - `visible` – Dispatched when the element becomes visible.
32
32
  * - `invisible` – Dispatched when the element leaves the viewport.
33
33
  *
34
- * Next.js: call init() in useEffect(); on route change call destroy() in cleanup and init() after mount.
35
34
  * SSR-safe: init/destroy no-op when window is undefined.
36
35
  *
37
36
  * @example
38
- * // Next.js_app.tsx or layout
39
- * import { useEffect } from 'react';
40
- * import { usePathname } from 'next/navigation';
41
- * import { appear } from '@andreyshpigunov/x/appear';
42
- *
43
- * export default function App({ Component, pageProps }) {
44
- * const pathname = usePathname();
45
- *
46
- * useEffect(() => {
47
- * appear.init(); // or appear.init({ once: true, rootMargin: '50px' })
48
- * return () => appear.destroy();
49
- * }, [pathname]);
50
- *
51
- * return <Component {...pageProps} />;
52
- * }
37
+ * // Vanilla JS plain HTML
38
+ * // index.html:
39
+ * // <div x-appear>Hello!</div>
40
+ * // <script type="module">
41
+ * // import { appear } from './src/components/x/appear.js';
42
+ * // window.addEventListener('DOMContentLoaded', () => {
43
+ * // appear.init({ once: false, rootMargin: '0px', threshold: 0 });
44
+ * // });
45
+ * // </script>
53
46
  *
54
47
  * @author Andrey Shpigunov
55
48
  * @version 0.4
@@ -64,7 +57,7 @@ import { lib } from './lib';
64
57
  * Uses IntersectionObserver to track elements with [x-appear] attribute and manage classes.
65
58
  */
66
59
  class Appear {
67
-
60
+
68
61
  constructor() {
69
62
  this._targets = [];
70
63
  this._observer = null;
@@ -78,7 +71,7 @@ class Appear {
78
71
  };
79
72
  this._observerCallback = this._observerCallback.bind(this);
80
73
  }
81
-
74
+
82
75
  /**
83
76
  * Initializes or reinitializes the observer and starts observing elements.
84
77
  *
@@ -93,24 +86,24 @@ class Appear {
93
86
  init(config = {}) {
94
87
  if (typeof window === 'undefined') return;
95
88
  if (!('IntersectionObserver' in window)) return;
96
-
89
+
97
90
  this._options = { ...this._options, ...config };
98
-
91
+
99
92
  if (this._observer) {
100
93
  this._observer.disconnect();
101
94
  this._observer = null;
102
95
  }
103
-
96
+
104
97
  this._targets = lib.qsa('[x-appear]');
105
98
  if (!this._targets.length) return;
106
-
99
+
107
100
  const { root, rootMargin, threshold } = this._options;
108
101
  this._observer = new IntersectionObserver(this._observerCallback, { root: root || null, rootMargin, threshold });
109
102
  for (let i = 0; i < this._targets.length; i++) {
110
103
  this._observer.observe(this._targets[i]);
111
104
  }
112
105
  }
113
-
106
+
114
107
  /**
115
108
  * Stops observing all elements and resets state. Use when unmounting (e.g. SPA).
116
109
  */
@@ -122,7 +115,7 @@ class Appear {
122
115
  }
123
116
  this._targets = [];
124
117
  }
125
-
118
+
126
119
  /**
127
120
  * IntersectionObserver callback. Handles visibility changes for tracked elements.
128
121
  *
@@ -132,7 +125,7 @@ class Appear {
132
125
  _observerCallback(entries) {
133
126
  const { appearedClass, visibleClass, once } = this._options;
134
127
  const observer = this._observer;
135
-
128
+
136
129
  for (let i = 0; i < entries.length; i++) {
137
130
  const entry = entries[i];
138
131
  const target = entry.target;
@@ -159,4 +152,4 @@ class Appear {
159
152
  * Singleton export of the Appear observer.
160
153
  * @type {Appear}
161
154
  */
162
- export const appear = new Appear();
155
+ export const appear = new Appear();
@@ -13,19 +13,31 @@
13
13
  * - `autocomplete.init(dropdownId, options)` – Binds to dropdown by id; options: loadData, mapData, renderItem, onSelect, resetFunc, emptyStateHtml, defaultStateHtml, loadingStateHtml.
14
14
  * - `autocomplete.destroy()` – Removes listeners and resets state.
15
15
  *
16
- * Next.js: call init() in useEffect after mount; call destroy() in cleanup on route change.
17
16
  * SSR-safe: init/destroy no-op when window is undefined.
18
17
  *
19
18
  * @example
20
- * // Next.jsin a component with a dropdown by id="searchDropdown"
21
- * useEffect(() => {
22
- * autocomplete.init('searchDropdown', {
23
- * loadData: async () => fetch('/api/search').then(r => r.json()),
24
- * renderItem: (item) => `<li data-item='${JSON.stringify(item)}'>${item.name}</li>`,
25
- * onSelect: (item) => { setValue(item.name); }
26
- * });
27
- * return () => autocomplete.destroy();
28
- * }, []);
19
+ * // Vanilla JS plain HTML
20
+ * // index.html:
21
+ * // <div id="searchDropdown">
22
+ * // <input x-dropdown-open type="text" placeholder="Search…" />
23
+ * // <ul x-dropdown></ul>
24
+ * // </div>
25
+ * //
26
+ * // <script type="module">
27
+ * // import { autocomplete } from './src/components/x/autocomplete.js';
28
+ * // // dropdown.js must be loaded too (for open/close behavior)
29
+ * // window.addEventListener('DOMContentLoaded', () => {
30
+ * // autocomplete.init('searchDropdown', {
31
+ * // loadData: async (ctx) => {
32
+ * // const q = ctx.field.value.trim();
33
+ * // const r = await fetch(`/api/search?q=${encodeURIComponent(q)}`);
34
+ * // return r.json();
35
+ * // },
36
+ * // renderItem: (item) => `<li data-item='${JSON.stringify(item)}'>${item.name}</li>`,
37
+ * // onSelect: (item) => { console.log('selected', item); }
38
+ * // });
39
+ * // });
40
+ * // </script>
29
41
  *
30
42
  * @author Andrey Shpigunov
31
43
  * @version 0.4
@@ -6,7 +6,6 @@ Created by Andrey Shpigunov at 20.03.2025
6
6
  All right reserved.
7
7
  ----------------------------------------*/
8
8
 
9
-
10
9
  /*
11
10
  .button
12
11
  .button--label
@@ -17,9 +16,10 @@ All right reserved.
17
16
  .button--white
18
17
  .button--black
19
18
  .button--clear
19
+ .button--dropdown
20
+ .buttons-group
20
21
  */
21
22
 
22
-
23
23
  :root {
24
24
  /*
25
25
  External variables:
@@ -51,12 +51,11 @@ All right reserved.
51
51
  --button-box-shadow-hover: 0 .1rem .1rem #00000022;
52
52
  --button-box-shadow-active: inset 0 0 .1rem #00000011;
53
53
  --button-disabled-opacity: .5;
54
+ --button-border-radius: calc(var(--button-font-size) * 0.6);
54
55
 
55
56
  /* Strength of hover (lighten) / active (darken). Override on :root or .button--* to tune. */
56
57
  --button-hover-lighten: 10%;
57
58
  --button-active-darken: 5%;
58
-
59
- --button-border-radius: calc(var(--button-font-size) * 0.6);
60
59
 
61
60
  /*
62
61
  Additional variables and their default values:
@@ -68,11 +67,18 @@ All right reserved.
68
67
  */
69
68
  }
70
69
 
71
-
72
70
  .button, [type=submit] {
73
71
  /* Computed on the element so var(--button-color) respects .button--primary etc. */
74
- --button-color-hover: color-mix(in oklab, var(--button-color) calc(100% - var(--button-hover-lighten)), white var(--button-hover-lighten));
75
- --button-color-active: color-mix(in oklab, var(--button-color) calc(100% - var(--button-active-darken)), black var(--button-active-darken));
72
+ --button-color-hover: color-mix(
73
+ in oklab,
74
+ var(--button-color) calc(100% - var(--button-hover-lighten)),
75
+ white var(--button-hover-lighten)
76
+ );
77
+ --button-color-active: color-mix(
78
+ in oklab,
79
+ var(--button-color) calc(100% - var(--button-active-darken)),
80
+ black var(--button-active-darken)
81
+ );
76
82
  --button-font-color-hover: var(--button-font-color);
77
83
  --button-font-color-active: var(--button-font-color);
78
84
 
@@ -153,7 +159,14 @@ All right reserved.
153
159
  }
154
160
 
155
161
 
156
- /* Predefined styles */
162
+ /* Predefined styles & colors */
163
+
164
+ .button--spacy {
165
+ padding-top: calc(var(--button-font-size) * var(--button-side-padding-coeff) * 0.75);
166
+ padding-bottom: calc(var(--button-font-size) * var(--button-side-padding-coeff) * 0.75);
167
+ padding-left: calc(var(--button-font-size) * var(--button-side-padding-coeff) * 1.25);
168
+ padding-right: calc(var(--button-font-size) * var(--button-side-padding-coeff) * 1.25);
169
+ }
157
170
 
158
171
  .button--label {
159
172
  --button-height: calc(var(--line-height) * 1em);
@@ -194,7 +207,10 @@ All right reserved.
194
207
  --button-box-shadow-active: none;
195
208
  }
196
209
 
197
- .button--tabs {
210
+
211
+ /* Group */
212
+
213
+ .buttons-group {
198
214
  display: flex;
199
215
  gap: calc(var(--space-1) / 2);
200
216
 
@@ -213,15 +229,21 @@ All right reserved.
213
229
  }
214
230
  }
215
231
 
216
- .button.button--dropdown {
217
- --button-padding-calculated: calc(var(--button-font-size) * var(--button-side-padding-coeff));
218
- padding-right: calc(var(--button-side-padding, var(--button-padding-calculated)) * 1.8);
232
+
233
+ /* Dropdown button */
234
+
235
+ .button--dropdown {
236
+ --var: calc(var(--button-font-size) * var(--button-side-padding-coeff));
237
+ padding-right: calc(var(--button-side-padding, --var) * 1.8);
219
238
 
220
239
  &::after {
221
240
  content: '';
222
241
  display: block;
223
242
  position: absolute;
224
- right: var(--button-side-padding, calc(var(--button-font-size) * var(--button-side-padding-coeff)));
243
+ right: var(
244
+ --button-side-padding,
245
+ calc(var(--button-font-size) * var(--button-side-padding-coeff)
246
+ ));
225
247
  width: .5em;
226
248
  height: .5em;
227
249
  margin-top: -.05em;
@@ -234,12 +256,12 @@ All right reserved.
234
256
  transition: opacity .1s ease-out;
235
257
  }
236
258
  }
237
- .dropdown--bottom .button.button--dropdown::after {
259
+ .dropdown--bottom .button--dropdown::after {
238
260
  transform: rotate(225deg);
239
- margin-top: .3em;
261
+ margin-top: .35em;
240
262
  }
241
263
 
242
- .button.button--dropdown.active {
264
+ .button--dropdown.active {
243
265
  &::after {
244
266
  opacity: 1;
245
267
  }
@@ -1,32 +1,27 @@
1
1
  /*----------------------------------------
2
2
  colors.css / x
3
- Colors from https://147colors.com
3
+ Colors
4
4
 
5
5
  Created by Andrey Shpigunov at 20.03.2025
6
6
  All right reserved.
7
7
  ----------------------------------------*/
8
8
 
9
-
10
9
  /*
11
- .colorPrimary
12
- .colorSuccess
13
- .colorWarning
14
- .colorDanger
15
- .colorError
16
- .colorGrey
17
-
18
- .bgPrimary
19
- .bgSuccess
20
- .bgWarning
21
- .bgDanger
22
- .bgError
23
- .bgGrey
10
+ .color-primary
11
+ .color-success
12
+ .color-warning
13
+ .color-danger
14
+ .color-error
15
+ .color-grey
24
16
 
25
- .color[ColorName] - color (d)
26
- .bg[ColorName] - background color (d)
17
+ .bg-primary
18
+ .bg-success
19
+ .bg-warning
20
+ .bg-danger
21
+ .bg-error
22
+ .bg-grey
27
23
  */
28
24
 
29
-
30
25
  :root {
31
26
  --color-primary: #0088ee;
32
27
  --color-success: #33c433;
@@ -36,29 +31,40 @@ All right reserved.
36
31
  --color-grey: #f4f5f6;
37
32
  }
38
33
 
39
-
40
- .colorPrimary { color: var(--color-primary) !important }
41
- .colorSuccess { color: var(--color-success) !important }
42
- .colorWarning { color: var(--color-warning) !important }
43
- .colorDanger { color: var(--color-danger) !important }
44
- .colorError { color: var(--color-error) !important }
45
- .bgPrimary { background-color: var(--color-primary) !important }
46
- .bgSuccess { background-color: var(--color-success) !important }
47
- .bgWarning { background-color: var(--color-warning) !important }
48
- .bgDanger { background-color: var(--color-danger) !important }
49
- .bgError { background-color: var(--color-error) !important }
50
- .bgGrey { background-color: var(--color-grey) !important }
51
-
52
-
53
- @each $color in AliceBlue, AntiqueWhite, Aqua, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, Burlywood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenrod, DarkGray, DarkGreen, DarkGrey, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, Goldenrod, Gray, Green, GreenYellow, Grey, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenrodYellow, LightGray, LightGreen, LightGrey, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenrod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen {
54
-
55
- .color$(color) { color: $(color) !important }
56
- .bg$(color) { background-color: $(color) !important }
34
+ .color-primary {
35
+ color: var(--color-primary);
36
+ }
37
+ .color-success {
38
+ color: var(--color-success);
39
+ }
40
+ .color-warning {
41
+ color: var(--color-warning);
42
+ }
43
+ .color-danger {
44
+ color: var(--color-danger);
45
+ }
46
+ .color-error {
47
+ color: var(--color-error);
48
+ }
49
+ .color-grey {
50
+ color: var(--color-grey);
57
51
  }
58
52
 
59
- @media (--dark) {
60
- @each $color in AliceBlue, AntiqueWhite, Aqua, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, Burlywood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenrod, DarkGray, DarkGreen, DarkGrey, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, Goldenrod, Gray, Green, GreenYellow, Grey, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenrodYellow, LightGray, LightGreen, LightGrey, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenrod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen {
61
- .d\:color$(color) { color: $(color) !important }
62
- .d\:bg$(color) { background-color: $(color) !important }
63
- }
53
+ .bg-primary {
54
+ background-color: var(--color-primary);
55
+ }
56
+ .bg-success {
57
+ background-color: var(--color-success);
58
+ }
59
+ .bg-warning {
60
+ background-color: var(--color-warning);
61
+ }
62
+ .bg-danger {
63
+ background-color: var(--color-danger);
64
+ }
65
+ .bg-error {
66
+ background-color: var(--color-error);
67
+ }
68
+ .bg-grey {
69
+ background-color: var(--color-grey);
64
70
  }
@@ -37,8 +37,8 @@ All right reserved.
37
37
  list-style-type: decimal;
38
38
 
39
39
  & li {
40
- margin-top: 10px !important;
41
- margin-bottom: 10px !important;
40
+ margin-top: 10px;
41
+ margin-bottom: 10px;
42
42
 
43
43
  & .sql-log-query {
44
44
  word-break: break-all;