ds-one 0.2.5-alpha.2 → 0.2.5-alpha.4

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/DS1/0-face/device.ts +10 -6
  2. package/DS1/0-face/i18n.ts +3 -1
  3. package/DS1/1-root/one.css +52 -67
  4. package/DS1/2-core/ds-banner.ts +3 -0
  5. package/DS1/2-core/ds-cycle.ts +14 -1
  6. package/DS1/2-core/ds-icon.ts +4 -4
  7. package/DS1/2-core/ds-text.ts +10 -4
  8. package/DS1/2-core/ds-tooltip.ts +3 -3
  9. package/DS1/3-unit/ds-list.ts +7 -0
  10. package/DS1/3-unit/{singlenav-v1.ts → ds-portfolio-singlenav.ts} +8 -8
  11. package/DS1/3-unit/ds-row.ts +4 -5
  12. package/DS1/4-page/ds-grid.ts +9 -59
  13. package/DS1/4-page/ds-layout.ts +122 -17
  14. package/README.md +3 -3
  15. package/dist/0-face/device.d.ts.map +1 -1
  16. package/dist/0-face/device.js +7 -3
  17. package/dist/0-face/i18n.d.ts.map +1 -1
  18. package/dist/0-face/i18n.js +1 -1
  19. package/dist/2-core/ds-banner.d.ts +1 -0
  20. package/dist/2-core/ds-banner.d.ts.map +1 -0
  21. package/dist/2-core/ds-banner.js +2 -0
  22. package/dist/2-core/ds-cycle.d.ts +1 -0
  23. package/dist/2-core/ds-cycle.d.ts.map +1 -1
  24. package/dist/2-core/ds-cycle.js +14 -1
  25. package/dist/2-core/ds-icon.js +4 -4
  26. package/dist/2-core/ds-text.d.ts.map +1 -1
  27. package/dist/2-core/ds-text.js +10 -4
  28. package/dist/2-core/ds-tooltip.js +3 -3
  29. package/dist/3-unit/ds-list.d.ts.map +1 -1
  30. package/dist/3-unit/ds-list.js +3 -0
  31. package/dist/3-unit/ds-portfolio-singlenav.js +3 -3
  32. package/dist/3-unit/ds-row.js +4 -4
  33. package/dist/4-page/ds-grid.d.ts +0 -7
  34. package/dist/4-page/ds-grid.d.ts.map +1 -1
  35. package/dist/4-page/ds-grid.js +9 -54
  36. package/dist/4-page/ds-layout.d.ts +1 -1
  37. package/dist/4-page/ds-layout.d.ts.map +1 -1
  38. package/dist/4-page/ds-layout.js +125 -16
  39. package/dist/ds-one.bundle.js +232 -147
  40. package/dist/ds-one.bundle.js.map +4 -4
  41. package/dist/ds-one.bundle.min.js +171 -63
  42. package/dist/ds-one.bundle.min.js.map +4 -4
  43. package/package.json +7 -6
  44. package/DS1/3-unit/doublenav-v1.ts +0 -105
  45. package/DS1/3-unit/ds-portfolio-doublenav.ts +0 -105
  46. package/DS1/3-unit/ds-portfolio-panel.ts +0 -25
  47. package/DS1/3-unit/list-v1.ts +0 -24
  48. package/DS1/3-unit/panel-v1.ts +0 -26
  49. package/DS1/3-unit/row-v1.ts +0 -52
  50. /package/DS1/x-icon/{row..svg → row.svg} +0 -0
@@ -93,9 +93,14 @@ export function initDeviceDetection(): DeviceInfo {
93
93
  const actualWidth = deviceInfo.screenWidth;
94
94
  const scalingFactor = actualWidth / designWidth;
95
95
 
96
- // Set CSS custom property for scaling
96
+ // Set CSS custom property for scaling on html element
97
97
  document.documentElement.style.setProperty(
98
- "--scaling-factor-mobile",
98
+ "--sf",
99
+ scalingFactor.toFixed(3)
100
+ );
101
+ // Also set --sf for backwards compatibility
102
+ document.documentElement.style.setProperty(
103
+ "--sf",
99
104
  scalingFactor.toFixed(3)
100
105
  );
101
106
 
@@ -105,10 +110,9 @@ export function initDeviceDetection(): DeviceInfo {
105
110
  } else {
106
111
  // Desktop - no scaling
107
112
  if (typeof document !== "undefined") {
108
- document.documentElement.style.setProperty(
109
- "--scaling-factor-mobile",
110
- "1"
111
- );
113
+ document.documentElement.style.setProperty("--sf", "1");
114
+ // Also set --sf for backwards compatibility
115
+ document.documentElement.style.setProperty("--sf", "1");
112
116
  }
113
117
  console.log(
114
118
  `[DS one] Desktop device detected (${deviceInfo.screenWidth}x${deviceInfo.screenHeight})`
@@ -579,7 +579,9 @@ export function translate(key: string): string {
579
579
  return translationData[defaultLanguage][key];
580
580
  }
581
581
 
582
- console.warn(`[translate] No translation found for key "${key}"`);
582
+ console.warn(
583
+ `[DS one (Internationalization)] No translation found for key "${key}"`
584
+ );
583
585
  return key;
584
586
  }
585
587
 
@@ -1,4 +1,4 @@
1
- /* version 0.2.5-alpha.2 */
1
+ /* version 0.2.5-alpha.3 */
2
2
 
3
3
  input {
4
4
  padding: 0;
@@ -20,9 +20,6 @@ input {
20
20
  --orange: #fec20d;
21
21
  --yellow: #ffff00;
22
22
 
23
- /* accent color - defaults to blue but can be changed by user */
24
- --accent-color: var(--light-green);
25
-
26
23
  /* DS1 Documentation Colors */
27
24
  --ds1-docs-header-bg: light-dark(#f5f5f5, #232323);
28
25
  --ds1-docs-header-border: light-dark(#e0e0e0, #000000);
@@ -34,46 +31,61 @@ input {
34
31
  --ds1-docs-search-bg: light-dark(#f0f0f0, #171717);
35
32
  --ds1-docs-divider: light-dark(#e0e0e0, #000000);
36
33
 
34
+ /* 4-page component colors */
35
+
36
+ /* ds-grid color */
37
+ --grid-color: light-dark(var(--grid-color-light), var(--grid-color-dark));
38
+ --grid-color-light: var(--slate);
39
+ --grid-color-dark: var(--white);
40
+
41
+ /* ds-layout colors */
42
+
43
+ --layout-color: light-dark(
44
+ var(--layout-color-light),
45
+ var(--layout-color-dark)
46
+ );
47
+
37
48
  /* typefaces */
38
49
  --typeface: "GT-America-Standard-Regular";
39
50
  --typeface-medium: "GT-America-Standard-Medium";
40
51
  --typeface-compressed: "GT-America-Compressed-Regular";
41
52
  --typeface-japanese: "Noto Sans JP";
42
53
  --typeface-mono: "Iosevka";
43
- --type-size-default: calc(14px * var(--scaling-factor));
44
- --type-size-small: calc(10px * var(--scaling-factor));
54
+
55
+
56
+ --type-size-default: calc(14px * var(--sf));
57
+ --type-size-small: calc(10px * var(--sf));
45
58
  --type-weight-default: 500;
46
- --type-lineheight-default: calc(15px * var(--scaling-factor));
47
- --type-size-heading: calc(15px * var(--scaling-factor));
59
+ --type-lineheight-default: calc(15px * var(--sf));
60
+ --type-size-heading: calc(15px * var(--sf));
48
61
  --type-weight-bold: 500;
49
62
 
50
- --type-size-japanese-default: calc(12px * var(--scaling-factor));
51
- --type-size-japanese-heading: calc(14px * var(--scaling-factor));
52
- --type-lineheight-japanese-default: calc(17px * var(--scaling-factor));
63
+ --type-size-japanese-default: calc(12px * var(--sf));
64
+ --type-size-japanese-heading: calc(14px * var(--sf));
65
+ --type-lineheight-japanese-default: calc(17px * var(--sf));
53
66
  --type-weight-product: var(--type-weight-bold);
54
67
  --type-weight-heading: var(--type-weight-bold);
55
68
  --type-size-book: 9px;
56
69
  --type-weight-book: 400;
57
70
  --type-lineheight-book: 15px;
58
71
 
59
- /* ezo-scaling-factor */
60
- --scaling-factor: var(--scaling-factor-mobile);
61
- --scaling-factor-mobile: 1;
62
-
63
72
  /* size */
64
73
  --outline-stroke: 1px solid light-dark(var(--black), var(--slate-dark));
65
- --outline-stroke-mobile: calc(1px * var(--scaling-factor)) solid
74
+ --outline-stroke-mobile: calc(1px * var(--sf)) solid
66
75
  light-dark(var(--black), var(--slate-dark));
67
- --item-width: calc(79px * var(--scaling-factor));
68
- --item-height: calc(19px * var(--scaling-factor));
69
- --margin-correction: calc(1px * var(--scaling-factor));
76
+ --item-width: calc(79px * var(--sf));
77
+ --item-height: calc(19px * var(--sf));
78
+ --margin-correction: calc(1px * var(--sf));
70
79
 
71
80
  /* sizes */
72
81
 
82
+ --gridrcolor: light-dark(var(--slate), var(--slate-dark));
83
+
73
84
  /* main unit */
74
85
  --1: 20px;
75
86
  /* bigger sizes */
76
87
  --2: calc(var(--1) * 2);
88
+ --3: calc(var(--1) * 3);
77
89
  --4: calc(var(--1) * 4);
78
90
 
79
91
  /* smaller sizes */
@@ -81,7 +93,7 @@ input {
81
93
  --025: calc(var(--1) * 0.25);
82
94
  --08: calc(var(--1) * 0.8);
83
95
 
84
- /* ezo-button */
96
+ /* button */
85
97
  --button-background-color-primary: var(--accent-color);
86
98
  --button-background-color-secondary: light-dark(
87
99
  var(--slate-light),
@@ -93,11 +105,11 @@ input {
93
105
  var(--slate-light)
94
106
  );
95
107
 
96
- /* ezo-text-color */
108
+ /* text-color */
97
109
  --text-color-primary: light-dark(var(--black), var(--white));
98
110
  --text-color-dimmed: light-dark(var(--slate), var(--slate-light));
99
111
 
100
- /* ezo-icon */
112
+ /* icon colors */
101
113
  --icon-background: light-dark(var(--slate-light), var(--slate-dark));
102
114
  --icon-color: light-dark(var(--black), var(--white));
103
115
 
@@ -132,14 +144,6 @@ input {
132
144
  navigation: auto;
133
145
  }
134
146
 
135
- ::-webkit-scrollbar {
136
- display: none;
137
- }
138
-
139
- html {
140
- scrollbar-width: none;
141
- }
142
-
143
147
  @font-face {
144
148
  font-family: GT-America-Standard-Regular;
145
149
  src: url("./fonts/GT-America-Standard-Regular.woff2") format("woff2");
@@ -165,15 +169,15 @@ body {
165
169
 
166
170
  .matrix__board {
167
171
  position: relative;
168
- top: calc(21.5px * var(--scaling-factor));
169
- left: calc(-20px * var(--scaling-factor));
172
+ top: calc(21.5px * var(--sf));
173
+ left: calc(-20px * var(--sf));
174
+ width: calc(240px * var(--sf));
170
175
  display: flex;
171
- width: calc(240px * var(--scaling-factor));
172
176
  }
173
177
 
174
178
  .matrix__board--vertical {
175
179
  position: relative;
176
- left: calc(20.5px * var(--scaling-factor));
180
+ left: calc(20.5px * var(--sf));
177
181
  display: flex;
178
182
  flex-direction: row;
179
183
  align-items: start;
@@ -181,8 +185,8 @@ body {
181
185
 
182
186
  .matrix__board--horizontal {
183
187
  position: relative;
184
- top: calc(19.5px * var(--scaling-factor));
185
- left: calc(-239.5px * var(--scaling-factor));
188
+ top: calc(19.5px * var(--sf));
189
+ left: calc(-239.5px * var(--sf));
186
190
  display: flex;
187
191
  flex-direction: column;
188
192
  align-items: start;
@@ -212,11 +216,11 @@ body {
212
216
 
213
217
  .matrix__row-header {
214
218
  position: relative;
215
- top: calc(0.5px * var(--scaling-factor));
219
+ top: calc(0.5px * var(--sf));
216
220
  display: flex;
217
221
  align-items: center;
218
222
  justify-content: center;
219
- width: calc(19px * var(--scaling-factor));
223
+ width: calc(19px * var(--sf));
220
224
  height: var(--item-height);
221
225
  margin-right: var(--margin-correction);
222
226
  margin-bottom: var(--margin-correction);
@@ -268,13 +272,13 @@ body {
268
272
 
269
273
  .board__container {
270
274
  position: relative;
271
- top: calc(0.5px * var(--scaling-factor));
275
+ top: calc(0.5px * var(--sf));
272
276
  }
273
277
 
274
278
  .board {
275
279
  position: relative;
276
- top: calc(0.5px * var(--scaling-factor));
277
- left: calc(0.5px * var(--scaling-factor));
280
+ top: calc(0.5px * var(--sf));
281
+ left: calc(0.5px * var(--sf));
278
282
  display: flex;
279
283
  flex-direction: row;
280
284
  align-items: flex-start;
@@ -339,14 +343,13 @@ body {
339
343
  .header {
340
344
  display: flex;
341
345
  justify-content: center;
342
- width: calc(var(--item-width) * var(--scaling-factor));
343
- height: calc(var(--item-height) * var(--scaling-factor));
346
+ width: calc(var(--item-width) * var(--sf));
347
+ height: calc(var(--item-height) * var(--sf));
344
348
  }
345
349
 
346
350
  .header.dragging {
347
- outline: calc(var(--outline-stroke) * var(--scaling-factor)) solid
348
- var(--black);
349
- outline-offset: calc(var(--outline-stroke-offset) * var(--scaling-factor));
351
+ outline: calc(var(--outline-stroke) * var(--sf)) solid var(--black);
352
+ outline-offset: calc(var(--outline-stroke-offset) * var(--sf));
350
353
  background-color: var(--white);
351
354
  }
352
355
 
@@ -382,7 +385,7 @@ body {
382
385
  margin-top: 1px;
383
386
  z-index: 99;
384
387
  margin-bottom: 2px;
385
- padding-left: calc(3px * var(--scaling-factor));
388
+ padding-left: calc(3px * var(--sf));
386
389
  color: var(--text-color-primary);
387
390
  outline: var(--outline-stroke);
388
391
  background-color: var(--accent-color);
@@ -398,7 +401,7 @@ body {
398
401
  }
399
402
 
400
403
  .item-container.mobile {
401
- margin-left: calc(0.25px * var(--scaling-factor));
404
+ margin-left: calc(0.25px * var(--sf));
402
405
  }
403
406
 
404
407
  .group-children {
@@ -417,7 +420,7 @@ body {
417
420
  align-items: center;
418
421
  justify-content: start;
419
422
  width: var(--item-width);
420
- padding-left: calc(5px * var(--scaling-factor));
423
+ padding-left: calc(5px * var(--sf));
421
424
  overflow: hidden;
422
425
  text-overflow: ellipsis;
423
426
  white-space: nowrap;
@@ -444,21 +447,3 @@ tr {
444
447
  td {
445
448
  text-align: left;
446
449
  }
447
-
448
- .layout-grid {
449
- margin-top: 0.5px;
450
- margin-left: -0px;
451
- display: grid;
452
- z-index: -10;
453
- grid-template-columns: repeat(19, 79px);
454
- grid-template-rows: repeat(500, 19px);
455
- gap: 1px;
456
- row-rule: 1px solid #00000012;
457
- column-rule: 1px solid #00000012;
458
- outline: 1px solid #100101e7;
459
- position: absolute;
460
- top: 0;
461
- left: 50%;
462
- transform: translateX(-50%);
463
- pointer-events: none;
464
- }
@@ -0,0 +1,3 @@
1
+ // ds-banner.ts
2
+ // Core component
3
+
@@ -12,6 +12,7 @@ import type { ThemeType } from "../0-face/theme";
12
12
  import { savePreferences } from "../0-face/preferences";
13
13
  import "./ds-button";
14
14
  import "./ds-icon";
15
+ import "./ds-text";
15
16
 
16
17
  // Accent color utilities
17
18
  const saveAccentColor = (color: string) => {
@@ -641,7 +642,19 @@ export class Cycle extends LitElement {
641
642
  return html`
642
643
  <div class="cycle-container">
643
644
  ${this.type !== "icon-only"
644
- ? html`<span class="cycle-label">${this.label}</span>`
645
+ ? html`${this.type === "language"
646
+ ? html`<ds-text
647
+ key="language"
648
+ default-value="Language"
649
+ class="cycle-label"
650
+ ></ds-text>`
651
+ : this.type === "theme"
652
+ ? html`<ds-text
653
+ key="theme"
654
+ default-value="Theme"
655
+ class="cycle-label"
656
+ ></ds-text>`
657
+ : html`<span class="cycle-label">${this.label}</span>`}`
645
658
  : ""}
646
659
  <div
647
660
  style="display: flex; align-items: center; ${this.type === "icon-only"
@@ -26,8 +26,8 @@ export class Icon extends LitElement {
26
26
  display: inline-flex;
27
27
  justify-content: center;
28
28
  align-items: center;
29
- width: calc(16px * var(--scaling-factor));
30
- height: calc(16px * var(--scaling-factor));
29
+ width: calc(16px * var(--sf));
30
+ height: calc(16px * var(--sf));
31
31
  }
32
32
 
33
33
  svg {
@@ -44,8 +44,8 @@ export class Icon extends LitElement {
44
44
  display: flex;
45
45
  justify-content: center;
46
46
  align-items: center;
47
- width: calc(16px * var(--scaling-factor));
48
- height: calc(16px * var(--scaling-factor));
47
+ width: calc(16px * var(--sf));
48
+ height: calc(16px * var(--sf));
49
49
  }
50
50
 
51
51
  /* Notes style color variable for future implementation */
@@ -44,10 +44,16 @@ export class Text extends LitElement {
44
44
  static styles = css`
45
45
  :host {
46
46
  display: inline;
47
- }
48
-
49
- .loading {
50
- opacity: 0.6;
47
+ font-family: var(--typeface);
48
+ font-size: calc(var(--type-size-default) * var(--scaling-factor));
49
+ font-weight: var(--type-weight-default);
50
+ line-height: calc(var(--type-lineheight-default) * var(--scaling-factor));
51
+ letter-spacing: calc(
52
+ var(--type-letterspacing-default) * var(--scaling-factor)
53
+ );
54
+ text-align: var(--text-align-default);
55
+ text-transform: var(--text-transform-default);
56
+ text-decoration: var(--text-decoration-default);
51
57
  }
52
58
  `;
53
59
 
@@ -79,10 +79,10 @@ export class Tooltip extends LitElement {
79
79
  position: absolute;
80
80
  left: 50%;
81
81
  bottom: 100%;
82
- transform: translate(-50%, calc(-2px * var(--scaling-factor)));
82
+ transform: translate(-50%, calc(-2px * var(--sf)));
83
83
  z-index: 1000;
84
84
  pointer-events: none;
85
- height: calc(var(--08) * var(--scaling-factor));
85
+ height: calc(var(--08) * var(--sf));
86
86
  opacity: 0;
87
87
  transition:
88
88
  opacity 120ms ease,
@@ -91,7 +91,7 @@ export class Tooltip extends LitElement {
91
91
  color: light-dark(var(--white), var(--black));
92
92
  border-radius: 0;
93
93
  font-size: var(--type-size-default);
94
- padding: 0px calc(1px * var(--scaling-factor));
94
+ padding: 0px calc(1px * var(--sf));
95
95
  font-family: var(
96
96
  --typeface,
97
97
  -apple-system,
@@ -1,3 +1,10 @@
1
+ // ds-banner.ts
2
+ // Unit component that
3
+ // can be used to show a list of items consiting of compoentnts from core
4
+
5
+
6
+
7
+
1
8
  import { LitElement, html, css } from "lit";
2
9
 
3
10
  export class List extends LitElement {
@@ -3,11 +3,11 @@ import { LitElement, html, css } from "lit";
3
3
  /**
4
4
  * A component for single navigation links
5
5
  *
6
- * @element singlenav-v1
6
+ * @element portfolio-singlenav
7
7
  * @prop {string} type - Type of navigation: "projects" or "work"
8
8
  * @prop {string} to - Optional custom destination URL
9
9
  */
10
- export class SingleNav extends LitElement {
10
+ export class PortfolioSingleNav extends LitElement {
11
11
  static get properties() {
12
12
  return {
13
13
  type: { type: String, reflect: true },
@@ -27,15 +27,15 @@ export class SingleNav extends LitElement {
27
27
  :host {
28
28
  display: flex;
29
29
  justify-content: end;
30
- gap: calc(5px * var(--scaling-factor));
31
- padding: calc(2px * var(--scaling-factor));
30
+ gap: calc(5px * var(--sf));
31
+ padding: calc(2px * var(--sf));
32
32
  align-items: center;
33
33
  }
34
34
 
35
35
  a {
36
36
  display: inline-flex;
37
37
  align-items: center;
38
- gap: calc(5px * var(--scaling-factor));
38
+ gap: calc(5px * var(--sf));
39
39
  text-decoration: none;
40
40
  color: inherit;
41
41
  }
@@ -48,7 +48,7 @@ export class SingleNav extends LitElement {
48
48
  return html`
49
49
  <a href="${href}">
50
50
  <ds-text key="${navConfig.key}"></ds-text>
51
- <icon-v1 type="right"></icon-v1>
51
+ <ds-icon type="right"></ds-icon>
52
52
  </a>
53
53
  `;
54
54
  }
@@ -69,10 +69,10 @@ export class SingleNav extends LitElement {
69
69
  }
70
70
  }
71
71
 
72
- customElements.define("singlenav-v1", SingleNav);
72
+ customElements.define("portfolio-singlenav", PortfolioSingleNav);
73
73
 
74
74
  declare global {
75
75
  interface HTMLElementTagNameMap {
76
- "singlenav-v1": SingleNav;
76
+ "portfolio-singlenav": PortfolioSingleNav;
77
77
  }
78
78
  }
@@ -23,18 +23,18 @@ export class Row extends LitElement {
23
23
  :host {
24
24
  display: flex;
25
25
  align-items: end;
26
- width: calc(240px * var(--scaling-factor));
26
+ width: calc(240px * var(--sf));
27
27
  }
28
28
 
29
29
  :host([type="fill"]) {
30
30
  justify-content: space-between;
31
- height: calc(var(--1) * var(--scaling-factor));
31
+ height: calc(var(--1) * var(--sf));
32
32
  }
33
33
 
34
34
  :host([type="centered"]) {
35
35
  justify-content: center;
36
- height: calc(var(--1) * var(--scaling-factor));
37
- gap: calc(var(--025) * var(--scaling-factor));
36
+ height: calc(var(--1) * var(--sf));
37
+ gap: calc(var(--025) * var(--sf));
38
38
  }
39
39
  `;
40
40
 
@@ -50,4 +50,3 @@ declare global {
50
50
  "ds-row": Row;
51
51
  }
52
52
  }
53
-
@@ -2,7 +2,6 @@
2
2
  // Simple grid layout component
3
3
 
4
4
  import { LitElement, html, css } from "lit";
5
- import { detectMobileDevice } from "../0-face/device";
6
5
 
7
6
  declare global {
8
7
  interface CustomElementRegistry {
@@ -14,44 +13,9 @@ declare global {
14
13
  export class Grid extends LitElement {
15
14
  static properties = {
16
15
  align: { type: String },
17
- _isMobile: { type: Boolean, state: true },
18
16
  };
19
17
 
20
18
  align?: string;
21
- _isMobile: boolean = false;
22
-
23
- connectedCallback() {
24
- super.connectedCallback();
25
- this._isMobile = detectMobileDevice();
26
- console.log(`[ds-grid] Mobile device: ${this._isMobile}`);
27
-
28
- // Apply mobile class immediately
29
- if (this._isMobile) {
30
- this.classList.add("mobile");
31
- console.log(`[ds-grid] Mobile class added`);
32
- }
33
-
34
- // Calculate mobile grid dimensions to fit screen
35
- if (this._isMobile && typeof window !== "undefined") {
36
- const screenWidth = window.innerWidth;
37
- const columns = 14;
38
- const gap = 0.5;
39
-
40
- // Calculate column size accounting for gaps between columns
41
- // Total width = (columns * columnSize) + ((columns - 1) * gap)
42
- // Therefore: columnSize = (screenWidth - ((columns - 1) * gap)) / columns
43
- const totalGapWidth = (columns - 1) * gap;
44
- const columnSize = (screenWidth - totalGapWidth) / columns;
45
-
46
- console.log(
47
- `[ds-grid] Mobile grid: ${columns} columns × ${columnSize.toFixed(2)}px + ${totalGapWidth}px gaps = ${screenWidth}px`
48
- );
49
-
50
- // Set custom property for this grid instance
51
- this.style.setProperty("--mobile-column-size", `${columnSize}px`);
52
- this.style.setProperty("--mobile-gap", `${gap}px`);
53
- }
54
- }
55
19
 
56
20
  static styles = css`
57
21
  :host {
@@ -59,17 +23,13 @@ export class Grid extends LitElement {
59
23
  margin-left: 0.5px !important;
60
24
  display: grid;
61
25
  width: 1440px;
62
- height: 100%;
26
+ height: 360px;
63
27
  grid-template-columns: repeat(auto-fill, 19px);
64
28
  grid-template-rows: repeat(auto-fill, 19px);
65
29
  gap: 1px;
66
- row-rule: calc(1px * var(--scaling-factor)) solid
67
- light-dark(rgb(147, 147, 147), rgb(147, 147, 147));
68
- column-rule: calc(1px * var(--scaling-factor)) solid
69
- light-dark(rgb(147, 147, 147), rgb(147, 147, 147));
70
- outline:
71
- 1px solid light-dark(rgb(147, 147, 147)),
72
- rgb(147, 147, 147);
30
+ row-rule: calc(1px * var(--sf)) solid var(--grid-color);
31
+ column-rule: calc(1px * var(--sf)) solid var(--grid-color);
32
+ outline: 1px solid black;
73
33
  position: fixed;
74
34
  top: 0;
75
35
  left: 50%;
@@ -80,21 +40,20 @@ export class Grid extends LitElement {
80
40
 
81
41
  /* DO NOT CHANGE THIS GRID CODE FOR MOBILE. ITS PERFECT FOR MOBILE. */
82
42
  :host(.mobile) {
83
- outline: calc(2px * var(--scaling-factor)) solid rgba(251, 255, 0, 0.9);
84
- width: calc(100% - calc(1px * var(--scaling-factor)));
43
+ width: calc(100% - calc(1px * var(--sf)));
85
44
  max-width: 100vw;
86
45
  margin-left: 0 !important;
87
46
  margin-top: 0 !important;
88
47
  box-sizing: border-box;
89
48
  position: fixed;
90
- top: calc(0.5px * var(--scaling-factor));
49
+ top: calc(0.5px * var(--sf));
91
50
  left: 50%;
92
51
  transform: translateX(-50%);
93
52
  pointer-events: none;
94
53
  z-index: 300;
95
- gap: calc(1px * var(--scaling-factor));
96
- grid-template-columns: repeat(14, calc(19px * var(--scaling-factor)));
97
- grid-template-rows: repeat(auto-fill, calc(19px * var(--scaling-factor)));
54
+ gap: calc(1px * var(--sf));
55
+ grid-template-columns: repeat(14, calc(19px * var(--sf)));
56
+ grid-template-rows: repeat(auto-fill, calc(19px * var(--sf)));
98
57
  }
99
58
 
100
59
  :host([align="left"]) {
@@ -114,15 +73,6 @@ export class Grid extends LitElement {
114
73
  }
115
74
  `;
116
75
 
117
- updated() {
118
- // Apply mobile class if detected as mobile device
119
- if (this._isMobile) {
120
- this.classList.add("mobile");
121
- } else {
122
- this.classList.remove("mobile");
123
- }
124
- }
125
-
126
76
  render() {
127
77
  return html``;
128
78
  }