elvish-css 1.0.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +518 -0
  3. package/dist/elvish.css +2194 -0
  4. package/dist/elvish.d.ts +78 -0
  5. package/dist/elvish.esm.js +2185 -0
  6. package/dist/elvish.iife.js +2169 -0
  7. package/dist/elvish.min.css +9 -0
  8. package/dist/elvish.umd.js +2173 -0
  9. package/elvish.css +28 -0
  10. package/elvish.js +81 -0
  11. package/global/global.css +16 -0
  12. package/global/modern.css +305 -0
  13. package/global/reset.css +507 -0
  14. package/global/tokens.css +154 -0
  15. package/global/transitions.css +288 -0
  16. package/global/transitions.js +289 -0
  17. package/global/utilities.css +151 -0
  18. package/package.json +61 -0
  19. package/primitives/adleithian/adleithian.css +16 -0
  20. package/primitives/adleithian/adleithian.js +63 -0
  21. package/primitives/bau/bau.css +86 -0
  22. package/primitives/bau/bau.js +127 -0
  23. package/primitives/enedh/enedh.css +38 -0
  24. package/primitives/enedh/enedh.js +110 -0
  25. package/primitives/esgal/esgal.css +39 -0
  26. package/primitives/esgal/esgal.js +115 -0
  27. package/primitives/fano/fano.css +28 -0
  28. package/primitives/fano/fano.js +108 -0
  29. package/primitives/gant-thala/gant-thala.css +32 -0
  30. package/primitives/gant-thala/gant-thala.js +69 -0
  31. package/primitives/glan-tholl/glan-tholl.css +71 -0
  32. package/primitives/glan-tholl/glan-tholl.js +147 -0
  33. package/primitives/glan-veleg/glan-veleg.css +45 -0
  34. package/primitives/glan-veleg/glan-veleg.js +138 -0
  35. package/primitives/gonath/gonath.css +57 -0
  36. package/primitives/gonath/gonath.js +113 -0
  37. package/primitives/gwistindor/gwistindor.css +52 -0
  38. package/primitives/gwistindor/gwistindor.js +96 -0
  39. package/primitives/hath/hath.css +39 -0
  40. package/primitives/hath/hath.js +107 -0
  41. package/primitives/him/him.css +43 -0
  42. package/primitives/him/him.js +169 -0
  43. package/primitives/miriant/miriant.css +75 -0
  44. package/primitives/miriant/miriant.js +158 -0
  45. package/primitives/thann/thann.css +57 -0
  46. package/primitives/thann/thann.js +96 -0
  47. package/primitives/tiniath/tiniath.css +16 -0
  48. package/primitives/tiniath/tiniath.js +88 -0
  49. package/primitives/vircantie/vircantie.css +24 -0
  50. package/primitives/vircantie/vircantie.js +83 -0
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Vircantie Layout Custom Element
3
+ *
4
+ * Auto-flowing responsive grid with minimum column width.
5
+ *
6
+ * @property {string} min - Minimum column width (default: 250px)
7
+ * @property {string} space - Gap between grid cells (default: var(--s1))
8
+ *
9
+ * @example
10
+ * <i-vircantie min="300px" space="var(--s2)">
11
+ * <div>Card 1</div>
12
+ * <div>Card 2</div>
13
+ * <div>Card 3</div>
14
+ * </i-vircantie>
15
+ */
16
+
17
+ class VircantieLayout extends HTMLElement {
18
+ static get observedAttributes() {
19
+ return ['min', 'space'];
20
+ }
21
+
22
+ constructor() {
23
+ super();
24
+ this.render = this.render.bind(this);
25
+ }
26
+
27
+ connectedCallback() {
28
+ this.render();
29
+ }
30
+
31
+ attributeChangedCallback() {
32
+ this.render();
33
+ }
34
+
35
+ get min() {
36
+ return this.getAttribute('min') || '250px';
37
+ }
38
+
39
+ set min(val) {
40
+ this.setAttribute('min', val);
41
+ }
42
+
43
+ get space() {
44
+ return this.getAttribute('space') || 'var(--s1)';
45
+ }
46
+
47
+ set space(val) {
48
+ this.setAttribute('space', val);
49
+ }
50
+
51
+ render() {
52
+ this.style.setProperty('--vircantie-min', this.min);
53
+ this.style.setProperty('--vircantie-space', this.space);
54
+
55
+ const id = `Vircantie-${this.min}-${this.space}`.replace(/[^\w-]/g, '');
56
+ this.dataset.i = id;
57
+
58
+ if (!document.getElementById(id)) {
59
+ const styleEl = document.createElement('style');
60
+ styleEl.id = id;
61
+
62
+ const selector = `[data-i="${id}"]`;
63
+
64
+ styleEl.textContent = `
65
+ ${selector} {
66
+ gap: ${this.space};
67
+ }
68
+ @supports (width: min(${this.min}, 100%)) {
69
+ ${selector} {
70
+ vircantie-template-columns: repeat(auto-fit, minmax(min(${this.min}, 100%), 1fr));
71
+ }
72
+ }
73
+ `;
74
+ document.head.appendChild(styleEl);
75
+ }
76
+ }
77
+ }
78
+
79
+ if ('customElements' in window) {
80
+ customElements.define('i-vircantie', VircantieLayout);
81
+ }
82
+
83
+ export default VircantieLayout;