@niche-works/style-layouts 0.2.0 → 0.3.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 (50) hide show
  1. package/README.ja.md +11 -0
  2. package/README.md +11 -0
  3. package/balance/index.cjs +1 -1
  4. package/center/index.cjs +1 -1
  5. package/constants.cjs +2 -2
  6. package/constants.d.cts +2 -2
  7. package/constants.d.mts +2 -2
  8. package/constants.mjs +2 -2
  9. package/core/_constants.cjs +58 -78
  10. package/core/_constants.d.cts +57 -71
  11. package/core/_constants.d.mts +57 -71
  12. package/core/_constants.mjs +58 -72
  13. package/core/balance/balance.cjs +1 -1
  14. package/core/balance/balance.mjs +2 -2
  15. package/core/balance/styles.css +14 -28
  16. package/core/center/center.cjs +1 -1
  17. package/core/center/center.mjs +2 -2
  18. package/core/center/styles.css +55 -42
  19. package/core/constants.cjs +18 -20
  20. package/core/constants.d.cts +17 -19
  21. package/core/constants.d.mts +17 -19
  22. package/core/constants.mjs +17 -19
  23. package/core/flow/flow.cjs +7 -7
  24. package/core/flow/flow.mjs +8 -8
  25. package/core/flow/styles.css +24 -20
  26. package/core/layer/layer.cjs +1 -1
  27. package/core/layer/layer.mjs +2 -2
  28. package/core/layer/styles.css +2 -10
  29. package/core/matrix/matrix.cjs +39 -41
  30. package/core/matrix/matrix.mjs +40 -42
  31. package/core/matrix/styles.css +100 -4
  32. package/core/pack/pack.cjs +1 -1
  33. package/core/pack/pack.mjs +2 -2
  34. package/core/pack/styles.css +17 -8
  35. package/core/pin/styles.css +1 -0
  36. package/core/stack/stack.cjs +19 -19
  37. package/core/stack/stack.mjs +20 -20
  38. package/core/stack/styles.css +26 -24
  39. package/core/styles.css +355 -179
  40. package/core/tile/styles.css +116 -43
  41. package/core/tile/tile.cjs +2 -52
  42. package/core/tile/tile.mjs +4 -54
  43. package/flow/index.cjs +1 -1
  44. package/layer/index.cjs +1 -1
  45. package/matrix/index.cjs +1 -1
  46. package/pack/index.cjs +1 -1
  47. package/package.json +1 -1
  48. package/pin/index.cjs +1 -1
  49. package/stack/index.cjs +1 -1
  50. package/tile/index.cjs +1 -1
@@ -1,20 +1,20 @@
1
1
  .nws-layout-matrix {
2
2
  --nws-layout-gapX: 0px;
3
3
  --nws-layout-gapY: 0px;
4
+ --nws-layout-childSizeX: auto;
5
+ --nws-layout-childSizeY: auto;
4
6
  --nws-layout-childRatio: auto;
7
+ --nws-layout-childCountX: auto-fit;
8
+ --nws-layout-childCountY: auto-fit;
5
9
  --nws-layout-templateX: none;
6
10
  --nws-layout-templateY: none;
7
11
  display: grid;
8
12
  }
9
13
  .nws-layout-matrix.nws-layout-direction-x {
10
14
  grid-auto-flow: row;
11
- grid-template-columns: var(--nws-layout-templateX);
12
- grid-template-rows: var(--nws-layout-templateY);
13
15
  }
14
16
  .nws-layout-matrix.nws-layout-direction-y {
15
17
  grid-auto-flow: column;
16
- grid-template-columns: var(--nws-layout-templateX);
17
- grid-template-rows: var(--nws-layout-templateY);
18
18
  }
19
19
  .nws-layout-matrix.nws-layout-alignX-left {
20
20
  justify-content: flex-start;
@@ -52,6 +52,102 @@
52
52
  .nws-layout-matrix.nws-layout-alignY-spaceEvenly {
53
53
  align-content: space-evenly;
54
54
  }
55
+ .nws-layout-matrix {
56
+ grid-template-columns: repeat(auto-fit, auto);
57
+ }
58
+ .nws-layout-matrix.nws-layout-childSizeX {
59
+ grid-template-columns: repeat(auto-fit, var(--nws-layout-childSizeX));
60
+ }
61
+ .nws-layout-matrix.nws-layout-childSizeX.nws-layout-childCountX {
62
+ grid-template-columns: repeat(var(--nws-layout-childCountX), var(--nws-layout-childSizeX));
63
+ }
64
+ .nws-layout-matrix.nws-layout-childCountX {
65
+ grid-template-columns: repeat(var(--nws-layout-childCountX), auto);
66
+ }
67
+ .nws-layout-matrix.nws-layout-templateX {
68
+ grid-template-columns: var(--nws-layout-templateX);
69
+ }
70
+ .nws-layout-matrix.nws-layout-adjustX-fit {
71
+ grid-template-columns: repeat(auto-fit, 1fr);
72
+ }
73
+ .nws-layout-matrix.nws-layout-adjustX-fit.nws-layout-childSizeX {
74
+ grid-template-columns: repeat(auto-fit, minmax(clamp(0px, 100%, var(--nws-layout-childSizeX)), 1fr));
75
+ }
76
+ .nws-layout-matrix.nws-layout-adjustX-fit.nws-layout-childSizeX.nws-layout-childCountX {
77
+ grid-template-columns: repeat(var(--nws-layout-childCountX), minmax(clamp(0px, (100% - var(--nws-layout-gapX) * (var(--nws-layout-childCountX) - 1)) / var(--nws-layout-childCountX), var(--nws-layout-childSizeX)), 1fr));
78
+ }
79
+ .nws-layout-matrix.nws-layout-adjustX-fit.nws-layout-childCountX {
80
+ grid-template-columns: repeat(var(--nws-layout-childCountX), 1fr);
81
+ }
82
+ .nws-layout-matrix.nws-layout-adjustX-grow {
83
+ grid-template-columns: repeat(auto-fit, 1fr);
84
+ }
85
+ .nws-layout-matrix.nws-layout-adjustX-grow.nws-layout-childSizeX {
86
+ grid-template-columns: repeat(auto-fit, minmax(var(--nws-layout-childSizeX), 1fr));
87
+ }
88
+ .nws-layout-matrix.nws-layout-adjustX-grow.nws-layout-childSizeX.nws-layout-childCountX {
89
+ grid-template-columns: repeat(var(--nws-layout-childCountX), minmax(var(--nws-layout-childSizeX), 1fr));
90
+ }
91
+ .nws-layout-matrix.nws-layout-adjustX-grow.nws-layout-childCountX {
92
+ grid-template-columns: repeat(var(--nws-layout-childCountX), 1fr);
93
+ }
94
+ .nws-layout-matrix.nws-layout-adjustX-shrink.nws-layout-childSizeX {
95
+ grid-template-columns: repeat(auto-fit, minmax(0, var(--nws-layout-childSizeX)));
96
+ }
97
+ .nws-layout-matrix.nws-layout-adjustX-shrink.nws-layout-childSizeX.nws-layout-childCountX {
98
+ grid-template-columns: repeat(var(--nws-layout-childCountX), minmax(0, var(--nws-layout-childSizeX)));
99
+ }
100
+ .nws-layout-matrix.nws-layout-adjustX-shrink.nws-layout-childCountX {
101
+ grid-template-columns: repeat(var(--nws-layout-childCountX), auto);
102
+ }
103
+ .nws-layout-matrix {
104
+ grid-template-rows: repeat(auto-fit, auto);
105
+ }
106
+ .nws-layout-matrix.nws-layout-childSizeY {
107
+ grid-template-rows: repeat(auto-fit, var(--nws-layout-childSizeY));
108
+ }
109
+ .nws-layout-matrix.nws-layout-childSizeY.nws-layout-childCountY {
110
+ grid-template-rows: repeat(var(--nws-layout-childCountY), var(--nws-layout-childSizeY));
111
+ }
112
+ .nws-layout-matrix.nws-layout-childCountY {
113
+ grid-template-rows: repeat(var(--nws-layout-childCountY), auto);
114
+ }
115
+ .nws-layout-matrix.nws-layout-templateY {
116
+ grid-template-rows: var(--nws-layout-templateY);
117
+ }
118
+ .nws-layout-matrix.nws-layout-adjustY-fit {
119
+ grid-template-rows: repeat(auto-fit, 1fr);
120
+ }
121
+ .nws-layout-matrix.nws-layout-adjustY-fit.nws-layout-childSizeY {
122
+ grid-template-rows: repeat(auto-fit, minmax(clamp(0px, 100%, var(--nws-layout-childSizeY)), 1fr));
123
+ }
124
+ .nws-layout-matrix.nws-layout-adjustY-fit.nws-layout-childSizeY.nws-layout-childCountY {
125
+ grid-template-rows: repeat(var(--nws-layout-childCountY), minmax(clamp(0px, (100% - var(--nws-layout-gapY) * (var(--nws-layout-childCountY) - 1)) / var(--nws-layout-childCountY), var(--nws-layout-childSizeY)), 1fr));
126
+ }
127
+ .nws-layout-matrix.nws-layout-adjustY-fit.nws-layout-childCountY {
128
+ grid-template-rows: repeat(var(--nws-layout-childCountY), 1fr);
129
+ }
130
+ .nws-layout-matrix.nws-layout-adjustY-grow {
131
+ grid-template-rows: repeat(auto-fit, 1fr);
132
+ }
133
+ .nws-layout-matrix.nws-layout-adjustY-grow.nws-layout-childSizeY {
134
+ grid-template-rows: repeat(auto-fit, minmax(var(--nws-layout-childSizeY), 1fr));
135
+ }
136
+ .nws-layout-matrix.nws-layout-adjustY-grow.nws-layout-childSizeY.nws-layout-childCountY {
137
+ grid-template-rows: repeat(var(--nws-layout-childCountY), minmax(var(--nws-layout-childSizeY), 1fr));
138
+ }
139
+ .nws-layout-matrix.nws-layout-adjustY-grow.nws-layout-childCountY {
140
+ grid-template-rows: repeat(var(--nws-layout-childCountY), 1fr);
141
+ }
142
+ .nws-layout-matrix.nws-layout-adjustY-shrink.nws-layout-childSizeY {
143
+ grid-template-rows: repeat(auto-fit, minmax(0, var(--nws-layout-childSizeY)));
144
+ }
145
+ .nws-layout-matrix.nws-layout-adjustY-shrink.nws-layout-childSizeY.nws-layout-childCountY {
146
+ grid-template-rows: repeat(var(--nws-layout-childCountY), minmax(0, var(--nws-layout-childSizeY)));
147
+ }
148
+ .nws-layout-matrix.nws-layout-adjustY-shrink.nws-layout-childCountY {
149
+ grid-template-rows: repeat(var(--nws-layout-childCountY), auto);
150
+ }
55
151
  .nws-layout-matrix.nws-layout-childRatio > * {
56
152
  aspect-ratio: var(--nws-layout-childRatio);
57
153
  }
@@ -16,7 +16,7 @@ clsx = require_runtime.__toESM(clsx, 1);
16
16
  const pack = (options = {}) => {
17
17
  const { direction, gap, gapX, gapY } = (0, _niche_works_utils_object_maybeDefault.default)(options, { direction: "x" }, { overwriteNull: true });
18
18
  const result = {
19
- className: (0, clsx.default)(require_core_constants.clsLayoutPack, require_core__constants.clsLayoutDirection[direction]),
19
+ className: (0, clsx.default)(require_core_constants.clsLayoutPack, require_core__constants.clsLayout.direction[direction]),
20
20
  style: {}
21
21
  };
22
22
  require_core__internal_applyGap(result, gap, gapX, gapY);
@@ -1,5 +1,5 @@
1
1
  import { clsLayoutPack } from "../constants.mjs";
2
- import { clsLayoutDirection } from "../_constants.mjs";
2
+ import { clsLayout } from "../_constants.mjs";
3
3
  import applyGap from "../_internal/applyGap.mjs";
4
4
  import maybeDefault from "@niche-works/utils/object/maybeDefault";
5
5
  import clsx from "clsx";
@@ -13,7 +13,7 @@ import clsx from "clsx";
13
13
  const pack = (options = {}) => {
14
14
  const { direction, gap, gapX, gapY } = maybeDefault(options, { direction: "x" }, { overwriteNull: true });
15
15
  const result = {
16
- className: clsx(clsLayoutPack, clsLayoutDirection[direction]),
16
+ className: clsx(clsLayoutPack, clsLayout.direction[direction]),
17
17
  style: {}
18
18
  };
19
19
  applyGap(result, gap, gapX, gapY);
@@ -6,13 +6,15 @@
6
6
  justify-content: flex-start;
7
7
  align-items: stretch;
8
8
  }
9
+ .nws-layout-pack > * {
10
+ flex-basis: 0;
11
+ flex-grow: 1;
12
+ flex-shrink: 1;
13
+ }
9
14
  .nws-layout-pack.nws-layout-direction-x {
10
15
  flex-direction: row;
11
16
  }
12
17
  .nws-layout-pack.nws-layout-direction-x > * {
13
- flex-basis: 0;
14
- flex-grow: 1;
15
- flex-shrink: 1;
16
18
  min-width: 0;
17
19
  min-height: 100%;
18
20
  max-height: 100%;
@@ -21,16 +23,23 @@
21
23
  flex-direction: column;
22
24
  }
23
25
  .nws-layout-pack.nws-layout-direction-y > * {
24
- flex-basis: 0;
25
- flex-grow: 1;
26
- flex-shrink: 1;
27
26
  min-height: 0;
28
27
  min-width: 100%;
29
28
  max-width: 100%;
30
29
  }
31
30
  .nws-layout-pack.nws-layout-gapX {
32
- column-gap: var(--nws-layout-gapX);
31
+ margin-left: calc(var(--nws-layout-gapX) / -2);
32
+ margin-right: calc(var(--nws-layout-gapX) / -2);
33
+ }
34
+ .nws-layout-pack.nws-layout-gapX > * {
35
+ margin-left: calc(var(--nws-layout-gapX) / 2);
36
+ margin-right: calc(var(--nws-layout-gapX) / 2);
33
37
  }
34
38
  .nws-layout-pack.nws-layout-gapY {
35
- row-gap: var(--nws-layout-gapY);
39
+ margin-top: calc(var(--nws-layout-gapY) / -2);
40
+ margin-bottom: calc(var(--nws-layout-gapY) / -2);
41
+ }
42
+ .nws-layout-pack.nws-layout-gapY > * {
43
+ margin-top: calc(var(--nws-layout-gapY) / 2);
44
+ margin-bottom: calc(var(--nws-layout-gapY) / 2);
36
45
  }
@@ -1,6 +1,7 @@
1
1
  .nws-layout-pin {
2
2
  --nws-layout-childSizeX: auto;
3
3
  --nws-layout-childSizeY: auto;
4
+ --nws-layout-childRatio: auto;
4
5
  display: block;
5
6
  position: relative;
6
7
  }
@@ -24,7 +24,7 @@ const stack = (options = {}) => {
24
24
  alignY: "top"
25
25
  }, { overwriteNull: true });
26
26
  const result = {
27
- className: (0, clsx.default)(require_core_constants.clsLayoutStack, require_core__constants.clsLayoutDirection[direction], require_core__constants.clsLayoutAlign.x[alignX], require_core__constants.clsLayoutAlign.y[alignY]),
27
+ className: (0, clsx.default)(require_core_constants.clsLayoutStack, require_core__constants.clsLayout.direction[direction], require_core__constants.clsLayout.align.x[alignX], require_core__constants.clsLayout.align.y[alignY]),
28
28
  style: {}
29
29
  };
30
30
  require_core__internal_applyGap(result, gap, gapX, gapY);
@@ -48,10 +48,10 @@ const stack = (options = {}) => {
48
48
  * @returns スタイル
49
49
  */
50
50
  function _getStackMainAxisStyle(axis, align, adjust, childSize) {
51
- const result = { className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutAdjust[axis][adjust]) };
51
+ const result = { className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]) };
52
52
  if (require_core__internal_hasValue(childSize)) {
53
- result.className = (0, clsx.default)(result.className, require_core__constants.clsLayoutChildSize[axis]);
54
- result.style = { [require_core__constants.varLayoutChildSize[axis]]: require_core__internal_unit(childSize) };
53
+ result.className = (0, clsx.default)(result.className, require_core__constants.clsLayout.childSize[axis]);
54
+ result.style = { [require_core__constants.varLayout.childSize[axis]]: require_core__internal_unit(childSize) };
55
55
  }
56
56
  return result;
57
57
  }
@@ -65,34 +65,34 @@ function _getStackMainAxisStyle(axis, align, adjust, childSize) {
65
65
  */
66
66
  function _getStackClossAxisStyle(axis, align, adjust, childSize) {
67
67
  if (adjust === "fit") return {
68
- className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutAdjust[axis][adjust]),
69
- style: {
70
- [`min-${require_core__constants.cssLayoutAxisSizeProp[axis]}`]: "100%",
71
- [require_core__constants.varLayoutChildSize[axis]]: `min(0, 100%)`
72
- }
68
+ className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
69
+ style: { [require_core__constants.varLayout.childSize[axis]]: `min(0, 100%)` }
73
70
  };
74
71
  else if (adjust === "grow") {
75
72
  const result = {
76
- className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutAdjust[axis][adjust]),
77
- style: { [`min-${require_core__constants.cssLayoutAxisSizeProp[axis]}`]: "100%" }
73
+ className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
74
+ style: {}
78
75
  };
79
76
  if (require_core__internal_hasValue(childSize)) {
80
- result.className = (0, clsx.default)(result.className, require_core__constants.clsLayoutChildSize[axis]);
81
- result.style[require_core__constants.varLayoutChildSize[axis]] = require_core__internal_unit(childSize);
77
+ result.className = (0, clsx.default)(result.className, require_core__constants.clsLayout.childSize[axis]);
78
+ result.style[require_core__constants.varLayout.childSize[axis]] = require_core__internal_unit(childSize);
82
79
  }
83
80
  return result;
84
81
  } else if (adjust === "shrink") {
85
- const result = { className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutAdjust[axis][adjust]) };
82
+ const result = {
83
+ className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.adjust[axis][adjust]),
84
+ style: {}
85
+ };
86
86
  if (require_core__internal_hasValue(childSize)) {
87
- result.className = (0, clsx.default)(result.className, require_core__constants.clsLayoutChildSize[axis]);
88
- result.style = { [require_core__constants.varLayoutChildSize[axis]]: `min(${require_core__internal_unit(childSize)}, 100%)` };
87
+ result.className = (0, clsx.default)(result.className, require_core__constants.clsLayout.childSize[axis]);
88
+ result.style = { [require_core__constants.varLayout.childSize[axis]]: `min(${require_core__internal_unit(childSize)}, 100%)` };
89
89
  }
90
90
  return result;
91
91
  } else if (require_core__internal_hasValue(childSize)) return {
92
- className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align], require_core__constants.clsLayoutChildSize[axis]),
93
- style: { [require_core__constants.varLayoutChildSize[axis]]: require_core__internal_unit(childSize) }
92
+ className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align], require_core__constants.clsLayout.childSize[axis]),
93
+ style: { [require_core__constants.varLayout.childSize[axis]]: require_core__internal_unit(childSize) }
94
94
  };
95
- else return { className: (0, clsx.default)(require_core__constants.clsLayoutAlign[axis][align]) };
95
+ else return { className: (0, clsx.default)(require_core__constants.clsLayout.align[axis][align]) };
96
96
  }
97
97
 
98
98
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { clsLayoutStack } from "../constants.mjs";
2
- import { clsLayoutAdjust, clsLayoutAlign, clsLayoutChildSize, clsLayoutDirection, cssLayoutAxisSizeProp, varLayoutChildSize } from "../_constants.mjs";
2
+ import { clsLayout, varLayout } from "../_constants.mjs";
3
3
  import hasValue from "../_internal/hasValue.mjs";
4
4
  import applyChildRatio from "../_internal/applyChildRatio.mjs";
5
5
  import unit from "../_internal/unit.mjs";
@@ -21,7 +21,7 @@ const stack = (options = {}) => {
21
21
  alignY: "top"
22
22
  }, { overwriteNull: true });
23
23
  const result = {
24
- className: clsx(clsLayoutStack, clsLayoutDirection[direction], clsLayoutAlign.x[alignX], clsLayoutAlign.y[alignY]),
24
+ className: clsx(clsLayoutStack, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY]),
25
25
  style: {}
26
26
  };
27
27
  applyGap(result, gap, gapX, gapY);
@@ -45,10 +45,10 @@ const stack = (options = {}) => {
45
45
  * @returns スタイル
46
46
  */
47
47
  function _getStackMainAxisStyle(axis, align, adjust, childSize) {
48
- const result = { className: clsx(clsLayoutAlign[axis][align], clsLayoutAdjust[axis][adjust]) };
48
+ const result = { className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]) };
49
49
  if (hasValue(childSize)) {
50
- result.className = clsx(result.className, clsLayoutChildSize[axis]);
51
- result.style = { [varLayoutChildSize[axis]]: unit(childSize) };
50
+ result.className = clsx(result.className, clsLayout.childSize[axis]);
51
+ result.style = { [varLayout.childSize[axis]]: unit(childSize) };
52
52
  }
53
53
  return result;
54
54
  }
@@ -62,34 +62,34 @@ function _getStackMainAxisStyle(axis, align, adjust, childSize) {
62
62
  */
63
63
  function _getStackClossAxisStyle(axis, align, adjust, childSize) {
64
64
  if (adjust === "fit") return {
65
- className: clsx(clsLayoutAlign[axis][align], clsLayoutAdjust[axis][adjust]),
66
- style: {
67
- [`min-${cssLayoutAxisSizeProp[axis]}`]: "100%",
68
- [varLayoutChildSize[axis]]: `min(0, 100%)`
69
- }
65
+ className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
66
+ style: { [varLayout.childSize[axis]]: `min(0, 100%)` }
70
67
  };
71
68
  else if (adjust === "grow") {
72
69
  const result = {
73
- className: clsx(clsLayoutAlign[axis][align], clsLayoutAdjust[axis][adjust]),
74
- style: { [`min-${cssLayoutAxisSizeProp[axis]}`]: "100%" }
70
+ className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
71
+ style: {}
75
72
  };
76
73
  if (hasValue(childSize)) {
77
- result.className = clsx(result.className, clsLayoutChildSize[axis]);
78
- result.style[varLayoutChildSize[axis]] = unit(childSize);
74
+ result.className = clsx(result.className, clsLayout.childSize[axis]);
75
+ result.style[varLayout.childSize[axis]] = unit(childSize);
79
76
  }
80
77
  return result;
81
78
  } else if (adjust === "shrink") {
82
- const result = { className: clsx(clsLayoutAlign[axis][align], clsLayoutAdjust[axis][adjust]) };
79
+ const result = {
80
+ className: clsx(clsLayout.align[axis][align], clsLayout.adjust[axis][adjust]),
81
+ style: {}
82
+ };
83
83
  if (hasValue(childSize)) {
84
- result.className = clsx(result.className, clsLayoutChildSize[axis]);
85
- result.style = { [varLayoutChildSize[axis]]: `min(${unit(childSize)}, 100%)` };
84
+ result.className = clsx(result.className, clsLayout.childSize[axis]);
85
+ result.style = { [varLayout.childSize[axis]]: `min(${unit(childSize)}, 100%)` };
86
86
  }
87
87
  return result;
88
88
  } else if (hasValue(childSize)) return {
89
- className: clsx(clsLayoutAlign[axis][align], clsLayoutChildSize[axis]),
90
- style: { [varLayoutChildSize[axis]]: unit(childSize) }
89
+ className: clsx(clsLayout.align[axis][align], clsLayout.childSize[axis]),
90
+ style: { [varLayout.childSize[axis]]: unit(childSize) }
91
91
  };
92
- else return { className: clsx(clsLayoutAlign[axis][align]) };
92
+ else return { className: clsx(clsLayout.align[axis][align]) };
93
93
  }
94
94
 
95
95
  //#endregion
@@ -36,16 +36,14 @@
36
36
  .nws-layout-stack.nws-layout-direction-x.nws-layout-alignY-bottom {
37
37
  align-items: flex-end;
38
38
  }
39
- .nws-layout-stack.nws-layout-direction-x.nws-layout-childSizeX > * {
40
- flex-basis: var(--nws-layout-childSizeX);
41
- }
42
- .nws-layout-stack.nws-layout-direction-x.nws-layout-childSizeY > * {
43
- height: var(--nws-layout-childSizeY);
44
- }
45
39
  .nws-layout-stack.nws-layout-direction-x > * {
46
40
  flex-grow: 0;
47
41
  flex-shrink: 0;
48
42
  min-width: 0;
43
+ min-height: 0;
44
+ }
45
+ .nws-layout-stack.nws-layout-direction-x.nws-layout-childSizeX > * {
46
+ flex-basis: var(--nws-layout-childSizeX);
49
47
  }
50
48
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustX-fit {
51
49
  justify-content: flex-start;
@@ -54,7 +52,6 @@
54
52
  flex-grow: 1;
55
53
  flex-shrink: 1;
56
54
  flex-basis: auto;
57
- min-width: 0;
58
55
  }
59
56
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustX-fit.nws-layout-childSizeX > * {
60
57
  flex-basis: var(--nws-layout-childSizeX);
@@ -65,8 +62,8 @@
65
62
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustX-shrink > * {
66
63
  flex-shrink: 1;
67
64
  }
68
- .nws-layout-stack.nws-layout-direction-x > * {
69
- min-height: 0;
65
+ .nws-layout-stack.nws-layout-direction-x.nws-layout-childSizeY > * {
66
+ height: var(--nws-layout-childSizeY);
70
67
  }
71
68
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustY-fit {
72
69
  align-items: stretch;
@@ -82,7 +79,6 @@
82
79
  min-height: 100%;
83
80
  }
84
81
  .nws-layout-stack.nws-layout-direction-x.nws-layout-adjustY-shrink > * {
85
- min-height: 0;
86
82
  max-height: 100%;
87
83
  }
88
84
  .nws-layout-stack.nws-layout-direction-y {
@@ -115,14 +111,14 @@
115
111
  .nws-layout-stack.nws-layout-direction-y.nws-layout-alignY-spaceEvenly {
116
112
  justify-content: space-evenly;
117
113
  }
118
- .nws-layout-stack.nws-layout-direction-y.nws-layout-childSizeX > * {
119
- width: var(--nws-layout-childSizeX);
120
- }
121
- .nws-layout-stack.nws-layout-direction-y.nws-layout-childSizeY > * {
122
- flex-basis: var(--nws-layout-childSizeY);
123
- }
124
114
  .nws-layout-stack.nws-layout-direction-y > * {
115
+ flex-grow: 0;
116
+ flex-shrink: 0;
125
117
  min-width: 0;
118
+ min-height: 0;
119
+ }
120
+ .nws-layout-stack.nws-layout-direction-y.nws-layout-childSizeX > * {
121
+ width: var(--nws-layout-childSizeX);
126
122
  }
127
123
  .nws-layout-stack.nws-layout-direction-y.nws-layout-adjustX-fit {
128
124
  align-items: stretch;
@@ -138,13 +134,10 @@
138
134
  min-width: 100%;
139
135
  }
140
136
  .nws-layout-stack.nws-layout-direction-y.nws-layout-adjustX-shrink > * {
141
- min-width: 0;
142
137
  max-width: 100%;
143
138
  }
144
- .nws-layout-stack.nws-layout-direction-y > * {
145
- flex-grow: 0;
146
- flex-shrink: 0;
147
- min-height: 0;
139
+ .nws-layout-stack.nws-layout-direction-y.nws-layout-childSizeY > * {
140
+ flex-basis: var(--nws-layout-childSizeY);
148
141
  }
149
142
  .nws-layout-stack.nws-layout-direction-y.nws-layout-adjustY-fit {
150
143
  justify-content: flex-start;
@@ -153,7 +146,6 @@
153
146
  flex-grow: 1;
154
147
  flex-shrink: 1;
155
148
  flex-basis: auto;
156
- min-height: 0;
157
149
  }
158
150
  .nws-layout-stack.nws-layout-direction-y.nws-layout-adjustY-fit.nws-layout-childSizeY > * {
159
151
  flex-basis: var(--nws-layout-childSizeY);
@@ -168,8 +160,18 @@
168
160
  aspect-ratio: var(--nws-layout-childRatio);
169
161
  }
170
162
  .nws-layout-stack.nws-layout-gapX {
171
- column-gap: var(--nws-layout-gapX);
163
+ margin-left: calc(var(--nws-layout-gapX) / -2);
164
+ margin-right: calc(var(--nws-layout-gapX) / -2);
165
+ }
166
+ .nws-layout-stack.nws-layout-gapX > * {
167
+ margin-left: calc(var(--nws-layout-gapX) / 2);
168
+ margin-right: calc(var(--nws-layout-gapX) / 2);
172
169
  }
173
170
  .nws-layout-stack.nws-layout-gapY {
174
- row-gap: var(--nws-layout-gapY);
171
+ margin-top: calc(var(--nws-layout-gapY) / -2);
172
+ margin-bottom: calc(var(--nws-layout-gapY) / -2);
173
+ }
174
+ .nws-layout-stack.nws-layout-gapY > * {
175
+ margin-top: calc(var(--nws-layout-gapY) / 2);
176
+ margin-bottom: calc(var(--nws-layout-gapY) / 2);
175
177
  }