lism-css 0.13.0 → 0.14.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 (59) hide show
  1. package/config/defaults/props.ts +8 -7
  2. package/config/defaults/tokens.ts +1 -1
  3. package/config/defaults/traits.ts +0 -1
  4. package/dist/components/Dummy/Dummy.d.ts +1 -1
  5. package/dist/components/Lism/Lism.stories.d.ts +1 -2
  6. package/dist/components/atomic/Decorator/Decorator.d.ts +6 -1
  7. package/dist/components/atomic/Decorator/index.js +4 -5
  8. package/dist/components/atomic/Divider/index.js +4 -5
  9. package/dist/components/atomic/Icon/getProps.d.ts +1 -1
  10. package/dist/components/atomic/Icon/getProps.js +34 -35
  11. package/dist/components/atomic/Spacer/index.js +5 -6
  12. package/dist/components/index.d.ts +1 -1
  13. package/dist/config/default-config.d.ts +13 -9
  14. package/dist/config/defaults/props.d.ts +12 -7
  15. package/dist/config/defaults/props.js +10 -9
  16. package/dist/config/defaults/tokens.d.ts +1 -1
  17. package/dist/config/defaults/tokens.js +1 -1
  18. package/dist/config/defaults/traits.d.ts +0 -1
  19. package/dist/config/defaults/traits.js +3 -4
  20. package/dist/config/index.d.ts +26 -18
  21. package/dist/config/index.js +4 -4
  22. package/dist/css/base/set.css +1 -1
  23. package/dist/css/base.css +1 -1
  24. package/dist/css/main.css +1 -1
  25. package/dist/css/main_no_layer.css +1 -1
  26. package/dist/css/primitives/layout.css +1 -1
  27. package/dist/css/primitives/trait.css +1 -1
  28. package/dist/css/props.css +1 -1
  29. package/dist/lib/getAtomicProps.d.ts +24 -0
  30. package/dist/lib/getAtomicProps.js +30 -0
  31. package/dist/lib/getLayoutProps.d.ts +1 -1
  32. package/dist/lib/getLayoutProps.js +28 -18
  33. package/dist/lib/getLismProps.d.ts +11 -8
  34. package/dist/lib/getLismProps.js +50 -56
  35. package/dist/lib/getMaybeTokenValue.js +20 -20
  36. package/dist/lib/types/AtomicProps.d.ts +22 -0
  37. package/dist/lib/types/TraitProps.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/packages/astro/Dummy/Dummy.astro +1 -1
  40. package/packages/astro/atomic/Decorator/Decorator.astro +4 -7
  41. package/packages/astro/atomic/Divider/Divider.astro +1 -2
  42. package/packages/astro/atomic/Spacer/Spacer.astro +1 -2
  43. package/packages/astro/index.ts +1 -1
  44. package/src/scss/_prop-config.scss +13 -6
  45. package/src/scss/base/_html.scss +1 -1
  46. package/src/scss/base/set/_bp.scss +2 -2
  47. package/src/scss/base/set/index.scss +1 -1
  48. package/src/scss/base/tokens/_tokens.scss +6 -7
  49. package/src/scss/primitives/atomic/_icon.scss +2 -2
  50. package/src/scss/primitives/layout/_fluidCols.scss +1 -1
  51. package/src/scss/primitives/layout/_sideMain.scss +1 -1
  52. package/src/scss/primitives/trait/index.scss +0 -1
  53. package/dist/components/atomic/Decorator/getProps.d.ts +0 -8
  54. package/dist/components/atomic/Decorator/getProps.js +0 -15
  55. package/dist/components/atomic/Divider/getProps.d.ts +0 -2
  56. package/dist/components/atomic/Divider/getProps.js +0 -11
  57. package/dist/components/atomic/Spacer/getProps.d.ts +0 -2
  58. package/dist/components/atomic/Spacer/getProps.js +0 -27
  59. package/src/scss/primitives/trait/_vertical.scss +0 -9
@@ -1,59 +1,53 @@
1
- import { TRAITS as P, PROPS as y } from "../config/index.js";
2
- import p from "./getLayoutProps.js";
3
- import S from "./isPresetValue.js";
4
- import E from "./isTokenValue.js";
5
- import C from "./getUtilKey.js";
6
- import c from "./getMaybeCssVar.js";
7
- import V from "./getBpData.js";
8
- import x from "./helper/atts.js";
9
- import w from "./helper/isEmptyObj.js";
10
- import U from "./helper/filterEmptyObj.js";
11
- import O from "./helper/mergeSet.js";
12
- import j from "./helper/splitWithComma.js";
13
- const _ = (n) => {
14
- const i = y[n];
1
+ import { TRAITS as C, PROPS as d } from "../config/index.js";
2
+ import E from "./getLayoutProps.js";
3
+ import V from "./getAtomicProps.js";
4
+ import P from "./isPresetValue.js";
5
+ import x from "./isTokenValue.js";
6
+ import S from "./getUtilKey.js";
7
+ import u from "./getMaybeCssVar.js";
8
+ import w from "./getBpData.js";
9
+ import A from "./helper/atts.js";
10
+ import _ from "./helper/isEmptyObj.js";
11
+ import p from "./helper/filterEmptyObj.js";
12
+ import b from "./helper/mergeSet.js";
13
+ import U from "./helper/splitWithComma.js";
14
+ const z = (n) => {
15
+ const i = d[n];
15
16
  return i && i?.token || "";
16
17
  };
17
- function z(n, i) {
18
- if (!n) return "";
19
- if (!i) return n;
20
- const t = n.split(" "), s = t[0];
21
- return [s, `${s}--${i}`, ...t.slice(1)].join(" ");
22
- }
23
18
  class L {
24
19
  // 最終出力 className
25
20
  className = "";
26
- // 出力順のためのクラスバケット: [lismClass] [lismTrait] [uClasses]
27
- // - lismClass : コンポーネント基底クラス + variant + l--{layout}(getLayoutProps 側で付与済み)
28
- // - lismTrait : is--* 等の trait クラス
29
- // - uClasses : set--* → u--* → -property の順で push される utility クラス
30
- lismClass = "";
31
- lismTrait = [];
21
+ // 出力順のためのクラスバケット: [primitiveClass] [uClasses]
22
+ // - primitiveClass : a--* / l--* / is--* の primitive クラス(getAtomicProps → getLayoutProps → analyzeTrait の順で push)
23
+ // - uClasses : set--* u--* → -property の順で push される utility クラス
24
+ primitiveClass = [];
32
25
  uClasses = [];
33
26
  styles = {};
34
27
  attrs = {};
35
28
  _propConfig;
36
29
  constructor(i) {
37
- const { forwardedRef: t, class: s, className: e, lismClass: l, variant: r, style: o = {}, _propConfig: d = {}, ...u } = i;
38
- this.styles = { ...o }, this._propConfig = { ...d }, this.lismClass = z(l, r), w(u) || (this.attrs = { ...u }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = this.buildClassName(e, s);
30
+ const { forwardedRef: t, class: s, className: e, primitiveClass: l, style: r = {}, _propConfig: o = {}, ...c } = i;
31
+ this.styles = { ...r }, this._propConfig = { ...o }, l && l.length && (this.primitiveClass = [...l]), _(c) || (this.attrs = { ...c }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = this.buildClassName(e, s);
39
32
  }
40
33
  // 最終クラス文字列の組み立て(出力順の唯一の確定地点)
41
- // 出力順: [user/astro className] [lismClass] [lismTrait] [uClasses]
34
+ // 出力順: [className&class] [primitiveClass] [uClasses]
35
+ // className と class が両方来た場合は両方マージする(atts 内で重複は除去される)。
42
36
  buildClassName(i, t) {
43
- return x(i || t, this.lismClass, this.lismTrait, this.uClasses);
37
+ return A(i, t, this.primitiveClass, this.uClasses);
44
38
  }
45
39
  analyzeTrait(i, t) {
46
40
  const { className: s, preset: e, presetClass: l, customVar: r, tokenKey: o } = i;
47
- t === !0 ? this.lismTrait.push(s) : e && S(e, t) ? this.lismTrait.push(`${s} ${l}:${String(t)}`) : t && (this.lismTrait.push(s), o && r && this.addStyle(r, c(t, o)));
41
+ t === !0 ? this.primitiveClass.push(s) : e && P(e, t) ? this.primitiveClass.push(`${s} ${l}:${String(t)}`) : t && (this.primitiveClass.push(s), o && r && this.addStyle(r, u(t, o)));
48
42
  }
49
43
  // prop解析
50
44
  analyzeProps() {
51
45
  const i = this.extractProp("set"), t = this.extractProp("util");
52
- O(void 0, i).forEach((s) => this.addUtil(`set--${s}`)), O(void 0, t).forEach((s) => this.addUtil(`u--${s}`)), Object.keys(this.attrs).forEach((s) => {
53
- if (Object.hasOwn(P, s)) {
54
- const e = this.extractProp(s), l = P[s];
55
- typeof l == "string" ? e && this.lismTrait.push(l) : this.analyzeTrait(l, e);
56
- } else if (Object.hasOwn(y, s)) {
46
+ b(void 0, i).forEach((s) => this.addUtil(`set--${s}`)), b(void 0, t).forEach((s) => this.addUtil(`u--${s}`)), Object.keys(this.attrs).forEach((s) => {
47
+ if (Object.hasOwn(C, s)) {
48
+ const e = this.extractProp(s), l = C[s];
49
+ typeof l == "string" ? e && this.primitiveClass.push(l) : this.analyzeTrait(l, e);
50
+ } else if (Object.hasOwn(d, s)) {
57
51
  const e = this.attrs[s];
58
52
  delete this.attrs[s], this.analyzeLismProp(s, e);
59
53
  } else if (s === "hov") {
@@ -68,10 +62,10 @@ class L {
68
62
  // Lism Prop 解析
69
63
  analyzeLismProp(i, t) {
70
64
  if (t == null) return;
71
- let s = y[i] || null;
65
+ let s = d[i] || null;
72
66
  if (s === null) return;
73
67
  this._propConfig?.[i] && (s = Object.assign({}, s, this._propConfig[i]));
74
- const { base: e, ...l } = V(t);
68
+ const { base: e, ...l } = w(t);
75
69
  this.setAttrs(i, e, s), Object.keys(l).forEach((r) => {
76
70
  s && this.setAttrs(i, l[r], s, r);
77
71
  });
@@ -114,19 +108,19 @@ class L {
114
108
  return;
115
109
  }
116
110
  if (!e) {
117
- const { presets: g, tokenClass: T, utils: $, shorthands: b } = s;
118
- if (g && S(g, t)) {
111
+ const { presets: m, tokenClass: j, utils: g, shorthands: $ } = s;
112
+ if (m && P(m, t)) {
119
113
  const h = typeof t == "string" || typeof t == "number" ? String(t) : "";
120
114
  h && this.addUtil(`${r}:${h}`);
121
115
  return;
122
116
  }
123
- if (T && s.token && E(s.token, t)) {
117
+ if (j && s.token && x(s.token, t)) {
124
118
  const h = typeof t == "string" || typeof t == "number" ? String(t) : "";
125
119
  h && this.addUtil(`${r}:${h}`);
126
120
  return;
127
121
  }
128
122
  let a = "";
129
- if ($ && typeof t == "string" && (a = C($, t)), !a && b && typeof t == "string" && (a = C(b, t, !0)), a) {
123
+ if (g && typeof t == "string" && (a = S(g, t)), !a && $ && typeof t == "string" && (a = S($, t, !0)), a) {
130
124
  this.addUtil(`${r}:${a}`);
131
125
  return;
132
126
  }
@@ -135,13 +129,13 @@ class L {
135
129
  this.addUtil(r);
136
130
  return;
137
131
  }
138
- const { prop: o, isVar: d, alwaysVar: u, token: m, bp: k } = s;
132
+ const { prop: o, isVar: c, alwaysVar: O, token: y, bp: k } = s;
139
133
  let f;
140
- if (m && (typeof t == "string" || typeof t == "number") ? f = c(t, m) : typeof t == "string" || typeof t == "number" ? f = t : f = JSON.stringify(t), !e) {
141
- if (d) {
134
+ if (y && (typeof t == "string" || typeof t == "number") ? f = u(t, y) : typeof t == "string" || typeof t == "number" ? f = t : f = JSON.stringify(t), !e) {
135
+ if (c) {
142
136
  this.addStyle(`--${i}`, f);
143
137
  return;
144
- } else if (!k && !u) {
138
+ } else if (!k && !O) {
145
139
  this.addStyle(o, f);
146
140
  return;
147
141
  }
@@ -162,7 +156,7 @@ class L {
162
156
  // });
163
157
  // }
164
158
  setHovProps(i) {
165
- i && (i === "-" || i === !0 ? this.addUtil("-hov") : typeof i == "string" ? j(i).forEach((t) => {
159
+ i && (i === "-" || i === !0 ? this.addUtil("-hov") : typeof i == "string" ? U(i).forEach((t) => {
166
160
  this.addUtil(`-hov:${t}`);
167
161
  }) : typeof i == "object" && Object.keys(i).forEach((t) => {
168
162
  const s = i[t];
@@ -170,31 +164,31 @@ class L {
170
164
  if (s === "-" || s === !0)
171
165
  this.addUtil(`-hov:${t}`);
172
166
  else if (t === "class")
173
- j(s).forEach((e) => {
167
+ U(s).forEach((e) => {
174
168
  this.addUtil(`-hov:${e}`);
175
169
  });
176
170
  else if (typeof s == "string" || typeof s == "number") {
177
- const e = c(s, _(t));
171
+ const e = u(s, z(t));
178
172
  this.addUtil(`-hov:${t}`), this.addStyle(`--hov-${t}`, e);
179
173
  }
180
174
  }
181
175
  }));
182
176
  }
183
177
  }
184
- function X(n) {
178
+ function Y(n) {
185
179
  if (Object.keys(n).length === 0)
186
180
  return {};
187
- const { layout: i, ...t } = n, s = new L(p(i, t));
181
+ const { atomic: i, layout: t, ...s } = n, e = V(i, s), l = E(t, e), r = new L(l);
188
182
  return {
189
- ...U({
190
- className: s.className,
191
- style: U(s.styles)
183
+ ...p({
184
+ className: r.className,
185
+ style: p(r.styles)
192
186
  }),
193
- ...s.attrs
187
+ ...r.attrs
194
188
  // data-* などHTMLの標準属性はそのまま渡す
195
189
  };
196
190
  }
197
191
  export {
198
192
  L as LismPropsData,
199
- X as default
193
+ Y as default
200
194
  };
@@ -1,25 +1,25 @@
1
- function a(n, t, f) {
2
- if (n === "color") {
3
- let e = a("c", t, f);
4
- return e === String(t) && (e = a("palette", t, f)), e;
1
+ function a(i, r, f) {
2
+ if (i === "color") {
3
+ let n = a("c", r, f);
4
+ return n === String(r) && (n = a("palette", r, f)), n;
5
5
  }
6
- const i = f[n];
7
- if (!i) return String(t);
8
- let r = typeof t == "number" ? `${t}` : t;
9
- if (i instanceof Set) {
10
- if (i.has(r))
11
- return r.startsWith("-") && (r = `n${r.slice(1)}`), `var(--${n}--${r})`;
12
- } else if (Array.isArray(i)) {
13
- if (i.includes(r))
14
- return r.startsWith("-") && (r = `n${r.slice(1)}`), `var(--${n}--${r})`;
15
- } else if ("pre" in i || "values" in i) {
16
- const { pre: e = "", values: s = [] } = i;
17
- if (s instanceof Set && s.has(r))
18
- return `var(${e}${r})`;
19
- if (Array.isArray(s) && s.includes(r))
20
- return `var(${e}${r})`;
6
+ const e = f[i];
7
+ if (!e) return String(r);
8
+ const t = typeof r == "number" ? `${r}` : r;
9
+ if (e instanceof Set) {
10
+ if (e.has(t))
11
+ return `var(--${i}--${t})`;
12
+ } else if (Array.isArray(e)) {
13
+ if (e.includes(t))
14
+ return `var(--${i}--${t})`;
15
+ } else if ("pre" in e || "values" in e) {
16
+ const { pre: n = "", values: s = [] } = e;
17
+ if (s instanceof Set && s.has(t))
18
+ return `var(${n}${t})`;
19
+ if (Array.isArray(s) && s.includes(t))
20
+ return `var(${n}${t})`;
21
21
  }
22
- return String(t);
22
+ return String(r);
23
23
  }
24
24
  export {
25
25
  a as default
@@ -0,0 +1,22 @@
1
+ import { CssValue } from './LayoutProps';
2
+ export interface NoAtomicProps {
3
+ atomic?: undefined;
4
+ }
5
+ export interface DividerAtomicProps {
6
+ atomic: 'divider';
7
+ }
8
+ export interface SpacerAtomicProps {
9
+ atomic: 'spacer';
10
+ }
11
+ export interface DecoratorAtomicProps {
12
+ atomic: 'decorator';
13
+ size?: CssValue;
14
+ }
15
+ export interface IconAtomicProps {
16
+ atomic: 'icon';
17
+ }
18
+ export type AtomicSpecificProps = NoAtomicProps | DividerAtomicProps | SpacerAtomicProps | DecoratorAtomicProps | IconAtomicProps;
19
+ export type AtomicType = Exclude<AtomicSpecificProps, NoAtomicProps>['atomic'];
20
+ export interface AtomicProps {
21
+ atomic?: AtomicType;
22
+ }
@@ -23,7 +23,7 @@ export type TraitProps = {
23
23
  [K in keyof TraitsConfig]?: ExtractTraitValue<TraitsConfig[K]>;
24
24
  };
25
25
  /** set prop で使われるプリセット値(エディタ補完用) */
26
- type SetPreset = 'gutter' | 'shadow' | 'hov' | 'transition' | 'mask' | 'plain' | 'innerRs' | 'bp';
26
+ type SetPreset = 'gutter' | 'shadow' | 'hov' | 'transition' | 'mask' | 'plain' | 'innerRs';
27
27
  /**
28
28
  * set prop の値の型。プリセット値がサジェストされつつ、任意の文字列も受け付ける。
29
29
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lism-css",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Lism CSS is a layout-first CSS framework for websites.",
5
5
  "author": {
6
6
  "name": "ddryo",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  /**
3
- * @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください。
3
+ * @deprecated DummyText (@lism-css/ui) を使用してください。
4
4
  */
5
5
  import { Lism } from '../Lism';
6
6
 
@@ -1,15 +1,12 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types';
3
- import type { DecoratorProps } from 'lism-css/react/atomic/Decorator/getProps';
3
+ import type { AstroLismFixedLayoutProps } from '../../types';
4
+ import type { DecoratorOwnProps } from 'lism-css/react/atomic/Decorator/Decorator';
4
5
  import { Lism } from '../../Lism';
5
- import getProps from 'lism-css/react/atomic/Decorator/getProps';
6
6
 
7
- type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
8
- DecoratorProps & {
9
- exProps?: Record<string, unknown>;
10
- };
7
+ type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & DecoratorOwnProps;
11
8
 
12
9
  const { as: Tag = 'div', exProps, ...props } = Astro.props;
13
10
  ---
14
11
 
15
- <Lism as={Tag} {...getProps(props)} {...exProps}><slot /></Lism>
12
+ <Lism as={Tag} atomic="decorator" aria-hidden="true" {...props} {...exProps}><slot /></Lism>
@@ -2,11 +2,10 @@
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types';
3
3
  import type { AstroLismBaseProps } from '../../types';
4
4
  import { Lism } from '../../Lism';
5
- import { getDividerProps } from 'lism-css/react/atomic/Divider/getProps';
6
5
 
7
6
  type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
8
7
 
9
8
  const { as: Tag = 'div', exProps, ...props } = Astro.props;
10
9
  ---
11
10
 
12
- <Lism as={Tag} {...getDividerProps(props)} {...exProps} />
11
+ <Lism as={Tag} atomic="divider" aria-hidden="true" {...props} {...exProps} />
@@ -2,11 +2,10 @@
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types';
3
3
  import type { AstroLismBaseProps } from '../../types';
4
4
  import { Lism } from '../../Lism';
5
- import getProps from 'lism-css/react/atomic/Spacer/getProps';
6
5
 
7
6
  type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
8
7
 
9
8
  const { as: Tag = 'div', exProps, ...props } = Astro.props;
10
9
  ---
11
10
 
12
- <Lism as={Tag} {...getProps(props)} {...exProps} />
11
+ <Lism as={Tag} atomic="spacer" aria-hidden="true" {...props} {...exProps} />
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  export * from './Lism';
6
- /** @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください */
6
+ /** @deprecated DummyText (@lism-css/ui) を使用してください */
7
7
  export * from './Dummy';
8
8
 
9
9
  // semantic wrappers
@@ -114,9 +114,9 @@ $props: (
114
114
  prop: 'opacity',
115
115
  utilities: (
116
116
  '0': '0',
117
- '-10': 'var(--o--n10)',
118
- '-20': 'var(--o--n20)',
119
- '-30': 'var(--o--n30)',
117
+ '-10': 'var(--o---10)',
118
+ '-20': 'var(--o---20)',
119
+ '-30': 'var(--o---30)',
120
120
  ),
121
121
  ),
122
122
  'v': (
@@ -818,13 +818,13 @@ $props: (
818
818
  '-1': '-1',
819
819
  ),
820
820
  ),
821
- 'ovwrap': (
821
+ 'ovw': (
822
822
  prop: 'overflow-wrap',
823
823
  utilities: (
824
824
  'anywhere': 'anywhere',
825
825
  ),
826
826
  ),
827
- 'whspace': (
827
+ 'whs': (
828
828
  prop: 'white-space',
829
829
  utilities: (
830
830
  'nowrap': 'nowrap',
@@ -843,10 +843,17 @@ $props: (
843
843
  'both': 'both',
844
844
  ),
845
845
  ),
846
- 'isolation': (
846
+ 'iso': (
847
847
  prop: 'isolation',
848
848
  utilities: (
849
849
  'isolate': 'isolate',
850
850
  ),
851
851
  ),
852
+ 'wm': (
853
+ prop: 'writing-mode',
854
+ utilities: (
855
+ 'vertical-rl': 'vertical-rl',
856
+ ),
857
+ bp: 1,
858
+ ),
852
859
  );
@@ -148,7 +148,7 @@ select,
148
148
  }
149
149
 
150
150
  :disabled {
151
- opacity: var(--o--n20);
151
+ opacity: var(--o---20);
152
152
  }
153
153
 
154
154
  /* --------------------------------------------------
@@ -1,8 +1,8 @@
1
1
  @use '../../query' as query;
2
2
 
3
- /*
3
+ /*
4
4
  * 特定のブレイクポイント以上でのみスタイルを適用させるためのハック変数を定義する
5
- * 👀: .is--vertical
5
+ * Memo: 現在import停止しコアから排除中。今後復活するかは要検討。
6
6
  */
7
7
  :root {
8
8
  --_is_sm: unset;
@@ -1,4 +1,4 @@
1
- @forward './bp';
1
+ // @forward './bp'; // Note: set--bp は無効化中。ファイルは参考用に残す
2
2
  @forward './hov';
3
3
  @forward './transition';
4
4
  @forward './mask';
@@ -18,7 +18,6 @@
18
18
  --sz--m: 56rem; // 読みやすいのが50文字程度。
19
19
  --sz--s: 42rem;
20
20
  --sz--xs: 32rem;
21
- --sz--min: 18rem; // 最低限維持したいコンテンツサイズの標準値。 sideMain等 で使用
22
21
 
23
22
  /**
24
23
  * カラーパレット
@@ -65,9 +64,9 @@
65
64
  /**
66
65
  * opacity
67
66
  */
68
- --o--n10: 0.75;
69
- --o--n20: 0.5;
70
- --o--n30: 0.25;
67
+ --o---10: 0.75;
68
+ --o---20: 0.5;
69
+ --o---30: 0.25;
71
70
 
72
71
  /**
73
72
  * border-radius
@@ -95,8 +94,8 @@
95
94
  --ar--og: 1.91/1;
96
95
 
97
96
  /**
98
- * Trait Primitive用の初期値
97
+ * サイトコンテンツの左右につける余白量
98
+ * Memo: -max-sz\:full などからも参照されるのでrootで定義している
99
99
  */
100
- --gutter-size: var(--s30); // サイトコンテンツの左右につける余白
101
- --vertical-mode: vertical-rl; // 縦書きモード
100
+ --gutter-size: var(--s30);
102
101
  }
@@ -1,5 +1,5 @@
1
1
  .a--icon {
2
- flex-shrink: 0; // Callout など、アイコンはflex直下の子要素にしたい場合も多いので、指定しておく
2
+ flex-shrink: 0; // アイコンはflex直下の子要素にしたい場合が多いのでデフォルトで適用する
3
3
  }
4
4
 
5
5
  /* fill指定のない svg にテキストカラーを継承させる */
@@ -7,7 +7,7 @@
7
7
  fill: currentcolor;
8
8
  }
9
9
 
10
- /* 属性によるサイズ指定がない場合 */
10
+ /* 属性によるサイズ指定がない場合は 1em サイズが基本 */
11
11
  .a--icon:where(:not([width])) {
12
12
  width: 1em;
13
13
  height: 1em;
@@ -2,7 +2,7 @@
2
2
  Memo: オーバーフロー回避のため、 min({cols}, 100%) とする。
3
3
  */
4
4
  .l--fluidCols {
5
- --cols: var(--sz--min);
5
+ --cols: 20rem;
6
6
  --autoMode: auto-fit;
7
7
  display: grid;
8
8
  grid-template-columns: repeat(var(--autoMode), minmax(min(var(--cols), 100%), 1fr));
@@ -4,7 +4,7 @@
4
4
  */
5
5
  .l--sideMain {
6
6
  --sideW: auto;
7
- --mainW: max(var(--sz--min), 50%);
7
+ --mainW: max(20rem, 50%);
8
8
  display: flex;
9
9
  flex-wrap: wrap;
10
10
 
@@ -4,4 +4,3 @@
4
4
  @forward './boxLink';
5
5
  @forward './coverLink'; // Note: position の関係で、boxLink より後で読み込む
6
6
  @forward './layer';
7
- @forward './vertical';
@@ -1,8 +0,0 @@
1
- import { LismProps } from '../../../lib/getLismProps';
2
- export interface DecoratorOwnProps {
3
- size?: string;
4
- clipPath?: string;
5
- boxSizing?: string;
6
- }
7
- export type DecoratorProps = LismProps & DecoratorOwnProps;
8
- export default function getDecoratorProps({ lismClass, size, clipPath, boxSizing, style: outerStyle, ...rest }: DecoratorProps): LismProps;
@@ -1,15 +0,0 @@
1
- import f from "../../../lib/helper/atts.js";
2
- function p({ lismClass: e, size: s, clipPath: o, boxSizing: a, style: i, ...n }) {
3
- const r = i ?? {};
4
- o && (r.clipPath = o), a && (r.boxSizing = a);
5
- const t = { ...n };
6
- s && (t.ar = "1/1", t.w = s), t.style = r;
7
- const c = {
8
- lismClass: f(e, "a--decorator"),
9
- "aria-hidden": "true"
10
- };
11
- return Object.assign(c, t);
12
- }
13
- export {
14
- p as default
15
- };
@@ -1,2 +0,0 @@
1
- import { LismProps } from '../../../lib/getLismProps';
2
- export declare function getDividerProps({ lismClass, ...props }: LismProps): LismProps;
@@ -1,11 +0,0 @@
1
- import t from "../../../lib/helper/atts.js";
2
- function a({ lismClass: r, ...i }) {
3
- return {
4
- lismClass: t(r, "a--divider"),
5
- "aria-hidden": "true",
6
- ...i
7
- };
8
- }
9
- export {
10
- a as getDividerProps
11
- };
@@ -1,2 +0,0 @@
1
- import { LismProps } from '../../../lib/getLismProps';
2
- export default function getSpacerProps({ lismClass, ...props }: LismProps): LismProps;
@@ -1,27 +0,0 @@
1
- import s from "../../../lib/helper/atts.js";
2
- import u from "../../../lib/getBpData.js";
3
- import c from "../../../lib/getMaybeCssVar.js";
4
- function h({ lismClass: l, ...e }) {
5
- const n = {
6
- lismClass: s(l, "a--spacer"),
7
- "aria-hidden": "true"
8
- };
9
- if (e.h != null) {
10
- let t = u(e.h);
11
- t = Object.entries(t).reduce(
12
- (r, [a, i]) => (r[a] = c(i, "space"), r),
13
- {}
14
- ), e.h = t;
15
- }
16
- if (e.w != null) {
17
- let t = u(e.w);
18
- t = Object.entries(t).reduce(
19
- (r, [a, i]) => (r[a] = c(i, "space"), r),
20
- {}
21
- ), e.w = t;
22
- }
23
- return { ...n, ...e };
24
- }
25
- export {
26
- h as default
27
- };
@@ -1,9 +0,0 @@
1
- .is--vertical {
2
- writing-mode: var(--vertical-mode);
3
- }
4
- .is--vertical\@sm {
5
- writing-mode: var(--_is_sm) var(--vertical-mode);
6
- }
7
- .is--vertical\@md {
8
- writing-mode: var(--_is_md) var(--vertical-mode);
9
- }