lism-css 0.20.0 → 0.22.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 (48) hide show
  1. package/config/defaults/props.ts +3 -1
  2. package/config/defaults/traits.ts +1 -7
  3. package/dist/components/atomic/Icon/presets.d.ts +28 -12
  4. package/dist/components/atomic/Icon/presets.js +38 -33
  5. package/dist/components/layout/AutoColumns/AutoColumns.stories.d.ts +1 -1
  6. package/dist/components/state/Wrapper/Wrapper.d.ts +2 -4
  7. package/dist/components/state/Wrapper/index.js +5 -5
  8. package/dist/config/default-config.d.ts +8 -7
  9. package/dist/config/defaults/props.d.ts +7 -0
  10. package/dist/config/defaults/props.js +4 -2
  11. package/dist/config/defaults/traits.d.ts +1 -7
  12. package/dist/config/defaults/traits.js +1 -7
  13. package/dist/config/index.d.ts +16 -14
  14. package/dist/css/base/set.css +1 -1
  15. package/dist/css/base.css +1 -1
  16. package/dist/css/main.css +1 -1
  17. package/dist/css/main_no_layer.css +1 -1
  18. package/dist/css/primitives/layout.css +1 -1
  19. package/dist/css/props.css +1 -1
  20. package/dist/css/reset.css +1 -1
  21. package/dist/css/trait.css +1 -1
  22. package/dist/css/utility.css +1 -1
  23. package/dist/lib/getLayoutProps.d.ts +1 -1
  24. package/dist/lib/getLayoutProps.js +2 -2
  25. package/dist/lib/getLismProps.d.ts +1 -8
  26. package/dist/lib/getLismProps.js +96 -94
  27. package/dist/lib/types/LayoutProps.d.ts +1 -1
  28. package/dist/lib/types/TraitProps.d.ts +11 -12
  29. package/dist/lib/types/allowedTags.d.ts +1 -1
  30. package/package.json +1 -1
  31. package/packages/astro/state/Wrapper/Wrapper.astro +2 -8
  32. package/src/scss/_prop-config.scss +12 -0
  33. package/src/scss/base/_html.scss +6 -20
  34. package/src/scss/base/set/_bdrsInner.scss +1 -1
  35. package/src/scss/base/set/_bleed.scss +3 -0
  36. package/src/scss/base/set/_hov.scss +4 -4
  37. package/src/scss/base/set/index.scss +1 -0
  38. package/src/scss/base/tokens/_shadow.scss +2 -2
  39. package/src/scss/base/tokens/_space.scss +3 -3
  40. package/src/scss/base/tokens/_tokens.scss +3 -3
  41. package/src/scss/primitives/layout/_autoColumns.scss +1 -1
  42. package/src/scss/props/_hover.scss +1 -1
  43. package/src/scss/props/_size.scss +2 -2
  44. package/src/scss/reset.scss +0 -3
  45. package/src/scss/trait/has/_gutter.scss +2 -1
  46. package/src/scss/trait/is/_container.scss +1 -1
  47. package/src/scss/trait/is/_wrapper.scss +1 -8
  48. package/src/scss/utility/_divide.scss +2 -2
@@ -1,22 +1,22 @@
1
- import { TRAITS as C, PROPS as c } from "../config/index.js";
2
- import E from "./getLayoutProps.js";
3
- import V from "./getAtomicProps.js";
4
- import g from "./isPresetValue.js";
1
+ import { TRAITS as P, PROPS as d } from "../config/index.js";
2
+ import j from "./getLayoutProps.js";
3
+ import k from "./getAtomicProps.js";
4
+ import E from "./isPresetValue.js";
5
5
  import w from "./isTokenValue.js";
6
- import $ from "./getUtilKey.js";
7
- import d from "./getMaybeCssVar.js";
6
+ import g from "./getUtilKey.js";
7
+ import C from "./getMaybeCssVar.js";
8
8
  import x from "./getBpData.js";
9
- import _ from "./warnUnsupportedBp.js";
10
- import A from "./helper/atts.js";
11
- import U from "./helper/isEmptyObj.js";
9
+ import z from "./warnUnsupportedBp.js";
10
+ import _ from "./helper/atts.js";
11
+ import A from "./helper/isEmptyObj.js";
12
12
  import S from "./helper/filterEmptyObj.js";
13
13
  import b from "./helper/mergeSet.js";
14
- import z from "./helper/splitWithComma.js";
15
- const L = (l) => {
16
- const s = c[l];
17
- return s && s?.token || "";
14
+ import U from "./helper/splitWithComma.js";
15
+ const W = (n) => {
16
+ const t = d[n];
17
+ return t && t?.token || "";
18
18
  };
19
- class T {
19
+ class L {
20
20
  // 最終出力 className
21
21
  className = "";
22
22
  primitiveClass = [];
@@ -27,28 +27,25 @@ class T {
27
27
  styles = {};
28
28
  attrs = {};
29
29
  _propConfig;
30
- constructor(s) {
31
- const { forwardedRef: t, class: i, className: e, primitiveClass: o, style: r = {}, _propConfig: a = {}, ...u } = s;
32
- this.styles = { ...r }, this._propConfig = { ...a }, o && o.length && (this.primitiveClass = [...o]), U(u) || (this.attrs = { ...u }, this.analyzeProps()), t && (this.attrs.ref = t), this.className = this.buildClassName(e, i);
30
+ constructor(t) {
31
+ const { forwardedRef: s, class: i, className: e, primitiveClass: o, style: r = {}, _propConfig: u = {}, ...h } = t;
32
+ this.styles = { ...r }, this._propConfig = { ...u }, o && o.length && (this.primitiveClass = [...o]), A(h) || (this.attrs = { ...h }, this.analyzeProps()), s && (this.attrs.ref = s), this.className = this.buildClassName(e, i);
33
33
  }
34
34
  // 最終クラス文字列の組み立て(出力順の唯一の確定地点)
35
35
  // 出力順: [className&class] [primitiveClass] [setClasses] [traitClasses] [uClasses] [propClasses]
36
36
  // className と class が両方来た場合は両方マージする(atts 内で重複は除去される)。
37
- buildClassName(s, t) {
38
- return A(s, t, this.primitiveClass, this.setClasses, this.traitClasses, this.uClasses, this.propClasses);
39
- }
40
- analyzeTrait(s, t) {
41
- const { className: i, preset: e, presetClass: o, customVar: r, tokenKey: a } = s;
42
- t === !0 ? this.traitClasses.push(i) : e && g(e, t) ? this.traitClasses.push(`${i} ${o}:${String(t)}`) : t && (this.traitClasses.push(i), a && r && this.addStyle(r, d(t, a)));
37
+ buildClassName(t, s) {
38
+ return _(t, s, this.primitiveClass, this.setClasses, this.traitClasses, this.uClasses, this.propClasses);
43
39
  }
44
40
  // prop解析
45
41
  analyzeProps() {
46
- const s = this.extractProp("set"), t = this.extractProp("util");
47
- b(void 0, s).forEach((i) => this.addSet(i)), b(void 0, t).forEach((i) => this.addUtil(`u--${i}`)), Object.keys(this.attrs).forEach((i) => {
48
- if (Object.hasOwn(C, i)) {
49
- const e = this.extractProp(i), o = C[i];
50
- typeof o == "string" ? e && this.traitClasses.push(o) : this.analyzeTrait(o, e);
51
- } else if (Object.hasOwn(c, i)) {
42
+ this.normalizeIsWrapper();
43
+ const t = this.extractProp("set"), s = this.extractProp("util");
44
+ b(void 0, t).forEach((i) => this.addSet(i)), b(void 0, s).forEach((i) => this.addUtil(`u--${i}`)), Object.keys(this.attrs).forEach((i) => {
45
+ if (Object.hasOwn(P, i)) {
46
+ const e = this.extractProp(i), o = P[i];
47
+ e && this.traitClasses.push(o);
48
+ } else if (Object.hasOwn(d, i)) {
52
49
  const e = this.attrs[i];
53
50
  delete this.attrs[i], this.analyzeLismProp(i, e);
54
51
  } else if (i === "hov") {
@@ -60,91 +57,96 @@ class T {
60
57
  }
61
58
  });
62
59
  }
60
+ // isWrapper="s" 形式のサイズ指定は contentSize Prop に寄せる。
61
+ normalizeIsWrapper() {
62
+ const t = this.attrs.isWrapper;
63
+ t == null || t === !1 || t === "" || t !== !0 && (this.attrs.contentSize === void 0 && (this.attrs.contentSize = t), this.attrs.isWrapper = !0);
64
+ }
63
65
  // Lism Prop 解析
64
- analyzeLismProp(s, t) {
65
- if (t == null) return;
66
- let i = c[s] || null;
66
+ analyzeLismProp(t, s) {
67
+ if (s == null) return;
68
+ let i = d[t] || null;
67
69
  if (i === null) return;
68
- this._propConfig?.[s] && (i = Object.assign({}, i, this._propConfig[s]));
69
- const { base: e, ...o } = x(t);
70
- process.env.NODE_ENV !== "production" && !i.bp && Object.keys(o).length > 0 && _(s), this.setAttrs(s, e, i), Object.keys(o).forEach((r) => {
71
- i && this.setAttrs(s, o[r], i, r);
70
+ this._propConfig?.[t] && (i = Object.assign({}, i, this._propConfig[t]));
71
+ const { base: e, ...o } = x(s);
72
+ process.env.NODE_ENV !== "production" && !i.bp && Object.keys(o).length > 0 && z(t), this.setAttrs(t, e, i), Object.keys(o).forEach((r) => {
73
+ i && this.setAttrs(t, o[r], i, r);
72
74
  });
73
75
  }
74
- addSet(s) {
75
- this.setClasses.push(`set--${s}`);
76
+ addSet(t) {
77
+ this.setClasses.push(`set--${t}`);
76
78
  }
77
- addUtil(s) {
78
- this.uClasses.push(s);
79
+ addUtil(t) {
80
+ this.uClasses.push(t);
79
81
  }
80
- addUtils(s) {
81
- this.uClasses.push(...s);
82
+ addUtils(t) {
83
+ this.uClasses.push(...t);
82
84
  }
83
- addProp(s) {
84
- this.propClasses.push(s);
85
+ addProp(t) {
86
+ this.propClasses.push(t);
85
87
  }
86
- addStyle(s, t) {
87
- this.styles[s] = t;
88
+ addStyle(t, s) {
89
+ this.styles[t] = s;
88
90
  }
89
- addStyles(s) {
90
- this.styles = { ...this.styles, ...s };
91
+ addStyles(t) {
92
+ this.styles = { ...this.styles, ...t };
91
93
  }
92
- addAttrs(s) {
93
- this.addStyles(s.styles || {}), this.addUtils(s.utils || []);
94
+ addAttrs(t) {
95
+ this.addStyles(t.styles || {}), this.addUtils(t.utils || []);
94
96
  }
95
- extractProp(s) {
96
- const t = this.attrs[s];
97
- return this.attrs[s] === void 0 ? null : (delete this.attrs[s], t);
97
+ extractProp(t) {
98
+ const s = this.attrs[t];
99
+ return this.attrs[t] === void 0 ? null : (delete this.attrs[t], s);
98
100
  }
99
- extractProps(s) {
100
- const t = {};
101
- return s.forEach((i) => {
102
- this.attrs[i] !== void 0 && (t[i] = this.attrs[i], delete this.attrs[i]);
103
- }), t;
101
+ extractProps(t) {
102
+ const s = {};
103
+ return t.forEach((i) => {
104
+ this.attrs[i] !== void 0 && (s[i] = this.attrs[i], delete this.attrs[i]);
105
+ }), s;
104
106
  }
105
107
  // propertyクラスを追加するか、styleにセットするかの分岐処理 @base
106
108
  // 値が null, undefined, '', false の時はスキップ
107
- setAttrs(s, t, i = {}, e = "") {
108
- if (t == null || t === "" || t === !1) return;
109
- let o = `--${s}`, r = `-${String(i.utilKey || s)}`;
110
- if (e && (o = `--${s}_${e}`, r += `_${e}`), typeof t == "string" && t.startsWith(":")) {
111
- this.addProp(`${r}:${t.replace(":", "")}`);
109
+ setAttrs(t, s, i = {}, e = "") {
110
+ if (s == null || s === "" || s === !1) return;
111
+ let o = `--${t}`, r = `-${String(i.utilKey || t)}`;
112
+ if (e && (o = `--${t}_${e}`, r += `_${e}`), typeof s == "string" && s.startsWith(":")) {
113
+ this.addProp(`${r}:${s.replace(":", "")}`);
112
114
  return;
113
115
  }
114
116
  if (!e) {
115
- const { presets: p, tokenClass: j, utils: m, shorthands: P } = i;
116
- if (p && g(p, t)) {
117
- const h = typeof t == "string" || typeof t == "number" ? String(t) : "";
118
- h && this.addProp(`${r}:${h}`);
117
+ const { presets: p, tokenClass: V, utils: y, shorthands: m } = i;
118
+ if (p && E(p, s)) {
119
+ const f = typeof s == "string" || typeof s == "number" ? String(s) : "";
120
+ f && this.addProp(`${r}:${f}`);
119
121
  return;
120
122
  }
121
- if (j && i.token && w(i.token, t)) {
122
- const h = typeof t == "string" || typeof t == "number" ? String(t) : "";
123
- h && this.addProp(`${r}:${h}`);
123
+ if (V && i.token && w(i.token, s)) {
124
+ const f = typeof s == "string" || typeof s == "number" ? String(s) : "";
125
+ f && this.addProp(`${r}:${f}`);
124
126
  return;
125
127
  }
126
- let f = "";
127
- if (m && typeof t == "string" && (f = $(m, t)), !f && P && typeof t == "string" && (f = $(P, t, !0)), f) {
128
- this.addProp(`${r}:${f}`);
128
+ let l = "";
129
+ if (y && typeof s == "string" && (l = g(y, s)), !l && m && typeof s == "string" && (l = g(m, s, !0)), l) {
130
+ this.addProp(`${r}:${l}`);
129
131
  return;
130
132
  }
131
133
  }
132
- if (t === !0) {
134
+ if (s === !0) {
133
135
  this.addProp(r);
134
136
  return;
135
137
  }
136
- const { prop: a, isVar: u, alwaysVar: O, token: y, bp: k } = i;
137
- let n;
138
- if (y && (typeof t == "string" || typeof t == "number") ? n = d(t, y) : typeof t == "string" || typeof t == "number" ? n = t : n = JSON.stringify(t), !e) {
139
- if (u) {
140
- this.addStyle(`--${s}`, n);
138
+ const { prop: u, isVar: h, alwaysVar: $, token: c, bp: O } = i;
139
+ let a;
140
+ if (c && (typeof s == "string" || typeof s == "number") ? a = C(s, c) : typeof s == "string" || typeof s == "number" ? a = s : a = JSON.stringify(s), !e) {
141
+ if (h) {
142
+ this.addStyle(`--${t}`, a);
141
143
  return;
142
- } else if (!k && !O) {
143
- this.addStyle(a, n);
144
+ } else if (!O && !$) {
145
+ this.addStyle(u, a);
144
146
  return;
145
147
  }
146
148
  }
147
- this.addProp(r), this.addStyle(o, n);
149
+ this.addProp(r), this.addStyle(o, a);
148
150
  }
149
151
  // setPassProps(passVars) {
150
152
  // let dataList = [];
@@ -159,26 +161,26 @@ class T {
159
161
  // this.addStyle(`--pass_${propName}`, value);
160
162
  // });
161
163
  // }
162
- setHovProps(s) {
163
- s && (s === !0 ? this.addProp("-hov") : typeof s == "string" ? z(s).forEach((t) => {
164
- this.addProp(`-hov:${t}`);
165
- }) : typeof s == "object" && Object.keys(s).forEach((t) => {
166
- const i = s[t];
164
+ setHovProps(t) {
165
+ t && (t === !0 ? this.addProp("-hov") : typeof t == "string" ? U(t).forEach((s) => {
166
+ this.addProp(`-hov:${s}`);
167
+ }) : typeof t == "object" && Object.keys(t).forEach((s) => {
168
+ const i = t[s];
167
169
  if (!(i == null || i === "" || i === !1)) {
168
170
  if (i === !0)
169
- this.addProp(`-hov:${t}`);
171
+ this.addProp(`-hov:${s}`);
170
172
  else if (typeof i == "string" || typeof i == "number") {
171
- const e = d(i, L(t));
172
- this.addProp(`-hov:-${t}`), this.addStyle(`--hov-${t}`, e);
173
+ const e = C(i, W(s));
174
+ this.addProp(`-hov:-${s}`), this.addStyle(`--hov-${s}`, e);
173
175
  }
174
176
  }
175
177
  }));
176
178
  }
177
179
  }
178
- function D(l) {
179
- if (Object.keys(l).length === 0)
180
+ function D(n) {
181
+ if (Object.keys(n).length === 0)
180
182
  return {};
181
- const { atomic: s, layout: t, ...i } = l, e = V(s, i), o = E(t, e), r = new T(o);
183
+ const { atomic: t, layout: s, ...i } = n, e = k(t, i), o = j(s, e), r = new L(o);
182
184
  return {
183
185
  ...S({
184
186
  className: r.className,
@@ -189,6 +191,6 @@ function D(l) {
189
191
  };
190
192
  }
191
193
  export {
192
- T as LismPropsData,
194
+ L as LismPropsData,
193
195
  D as default
194
196
  };
@@ -35,7 +35,7 @@ export interface FlowLayoutProps {
35
35
  }
36
36
  export interface AutoColumnsProps {
37
37
  layout: 'autoColumns';
38
- autoFill?: boolean;
38
+ autoFit?: boolean;
39
39
  }
40
40
  export interface WithSideProps {
41
41
  layout: 'withSide';
@@ -1,29 +1,28 @@
1
1
  import { TRAITS } from '../../../config/index';
2
- import { WithArbitraryString, ArrayElement } from './utils';
2
+ import { PropValueTypes } from './PropValueTypes';
3
+ import { WithArbitraryString } from './utils';
3
4
  /**
4
5
  * config/index.ts から TRAITS の型を取得
5
6
  * objDeepMerge の DeepMergeResult 型により literal types が保持される
6
7
  */
7
8
  type TraitsConfig = typeof TRAITS;
8
- /** preset を持つ Trait の値の型を抽出 */
9
- type PresetElement<T> = T extends {
10
- preset: readonly unknown[];
11
- } ? ArrayElement<T['preset']> : never;
12
9
  /**
13
10
  * Trait 設定から Props の値の型を抽出するユーティリティ型
14
11
  */
15
- type ExtractTraitValue<T> = T extends string ? boolean : T extends {
16
- preset: readonly unknown[];
17
- } ? WithArbitraryString<PresetElement<T>> | boolean : never;
12
+ type ExtractTraitValue<T> = T extends string ? boolean : never;
13
+ type GeneratedTraitProps = {
14
+ [K in keyof TraitsConfig]?: ExtractTraitValue<TraitsConfig[K]>;
15
+ };
16
+ type ContentSizeStringValue = Extract<NonNullable<PropValueTypes['contentSize']>, string>;
18
17
  /**
19
18
  * config/index.ts の TRAITS から自動生成される Trait Props の型
20
19
  * config/index.ts の TRAITS に新しいトレイトを追加すると自動的に反映される
21
20
  */
22
- export type TraitProps = {
23
- [K in keyof TraitsConfig]?: ExtractTraitValue<TraitsConfig[K]>;
21
+ export type TraitProps = Omit<GeneratedTraitProps, 'isWrapper'> & {
22
+ isWrapper?: boolean | ContentSizeStringValue;
24
23
  };
25
24
  /** set prop で使われるプリセット値(エディタ補完用) */
26
- type SetPreset = 'plain' | 'revert' | 'var:hov' | 'var:bxsh' | 'var:bdrsInner' | 'var:s';
25
+ type SetPreset = 'plain' | 'revert' | 'hov' | 'bxsh' | 'bdrsInner' | 'bleed' | 's';
27
26
  /**
28
27
  * set prop の値の型。プリセット値がサジェストされつつ、任意の文字列も受け付ける。
29
28
  *
@@ -34,7 +33,7 @@ type SetPreset = 'plain' | 'revert' | 'var:hov' | 'var:bxsh' | 'var:bdrsInner' |
34
33
  */
35
34
  export type SetPropValue = WithArbitraryString<SetPreset> | WithArbitraryString<SetPreset>[];
36
35
  /** util prop で使われるプリセット値(既知の `u--` クラス名・エディタ補完用) */
37
- type UtilPreset = 'cbox' | 'trim' | 'trimAll' | 'srOnly' | 'clipText' | 'divide' | 'cells';
36
+ type UtilPreset = 'cbox' | 'trim' | 'trimAll' | 'srOnly' | 'clipText' | 'divide' | 'enclose';
38
37
  /**
39
38
  * util prop の値の型。既知の `u--` クラス名がサジェストされつつ、任意の文字列も受け付ける。
40
39
  *
@@ -1,6 +1,6 @@
1
1
  export type GroupAllowedTag = 'div' | 'section' | 'article' | 'figure' | 'nav' | 'aside' | 'header' | 'footer' | 'main' | 'fieldset' | 'hgroup';
2
2
  export type TextAllowedTag = 'p' | 'div' | 'blockquote' | 'address' | 'figcaption' | 'pre';
3
- export type InlineAllowedTag = 'span' | 'em' | 'strong' | 'small' | 'code' | 'time' | 'i' | 'b' | 'mark' | 'abbr' | 'cite' | 'kbd';
3
+ export type InlineAllowedTag = 'span' | 'em' | 'strong' | 'small' | 'code' | 'time' | 'i' | 'b' | 'mark' | 'abbr' | 'cite' | 'kbd' | 'label';
4
4
  export type ListAllowedTag = 'ul' | 'ol' | 'dl';
5
5
  export type ListItemAllowedTag = 'li' | 'dt' | 'dd';
6
6
  export type MediaAllowedTag = 'img' | 'video' | 'iframe' | 'picture';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lism-css",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Lism CSS is a layout-first CSS framework for websites.",
5
5
  "author": {
6
6
  "name": "ddryo",
@@ -1,15 +1,9 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types';
3
3
  import type { AstroLismBaseProps } from '../../types';
4
- import type { LismProps } from 'lism-css/lib/getLismProps';
5
4
  import { Lism } from '../../Lism';
6
5
 
7
- type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
8
- AstroLismBaseProps & {
9
- contentSize?: LismProps['isWrapper'];
10
- };
11
-
12
- const { contentSize = true, ...props } = Astro.props;
6
+ type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
13
7
  ---
14
8
 
15
- <Lism isWrapper={contentSize} {...props}><slot /></Lism>
9
+ <Lism isWrapper {...Astro.props}><slot /></Lism>
@@ -201,6 +201,16 @@ $props: (
201
201
  ),
202
202
  bp: 1,
203
203
  ),
204
+ 'contentSize': (
205
+ prop: '--contentSize',
206
+ utilities: (
207
+ 's': 'var(--sz--s)',
208
+ 'm': 'var(--sz--m)',
209
+ 'l': 'var(--sz--l)',
210
+ 'xl': 'var(--sz--xl)',
211
+ ),
212
+ isVar: 1,
213
+ ),
204
214
  'max-sz': (
205
215
  prop: 'max-inline-size',
206
216
  utilities: (
@@ -332,6 +342,7 @@ $props: (
332
342
  'relative': 'relative',
333
343
  'absolute': 'absolute',
334
344
  ),
345
+ bp: 1,
335
346
  ),
336
347
  'z': (
337
348
  prop: 'z-index',
@@ -777,6 +788,7 @@ $props: (
777
788
  '1': '1',
778
789
  '-1': '-1',
779
790
  ),
791
+ bp: 1,
780
792
  ),
781
793
  'ovw': (
782
794
  prop: 'overflow-wrap',
@@ -8,7 +8,9 @@ body {
8
8
  letter-spacing: var(--lts--base);
9
9
  background-color: var(--base);
10
10
  color: var(--text);
11
- text-underline-offset: var(--under-offset, 0.25em);
11
+
12
+ text-underline-offset: 0.125em;
13
+ tab-size: 4;
12
14
  }
13
15
 
14
16
  /* --------------------------------------------------
@@ -120,24 +122,9 @@ dd + dt {
120
122
  /* --------------------------------------------------
121
123
  table
122
124
  -------------------------------------------------- */
123
- table {
124
- --td-c: inherit;
125
- --td-bgc: transparent;
126
- --td-p: var(--s10) var(--s15);
127
- --td-min-sz: initial;
128
- }
129
- td {
130
- color: var(--td-c);
131
- background-color: var(--td-bgc);
132
- padding: var(--td-p);
133
- min-inline-size: var(--td-min-sz);
134
- }
125
+ td,
135
126
  th {
136
- // デフォルト: tdと同じスタイル
137
- color: var(--th-c, var(--td-c));
138
- background-color: var(--th-bgc, var(--td-bgc));
139
- padding: var(--th-p, var(--td-p));
140
- min-inline-size: var(--th-min-sz, var(--td-min-sz));
127
+ padding: var(--cells-p, 0.625em 0.875em);
141
128
  }
142
129
 
143
130
  /* --------------------------------------------------
@@ -151,8 +138,7 @@ select,
151
138
  // フォーム系コントロールの最低限の見た目(テーマ差し替えは --controls-*)
152
139
  background-color: var(--controls-bgc, var(--base-2));
153
140
  border: solid 1px var(--controls-bdc, var(--divider));
154
- padding: var(--controls-p, var(--s5) var(--s10));
155
- border-radius: var(--controls-bdrs, var(--bdrs--10));
141
+ padding: var(--controls-p, 0.25em 0.5em);
156
142
  }
157
143
 
158
144
  :disabled {
@@ -1,3 +1,3 @@
1
- .set--var\:bdrsInner {
1
+ .set--bdrsInner {
2
2
  --bdrs--inner: calc(var(--bdrs, 0px) - var(--p, 0px));
3
3
  }
@@ -0,0 +1,3 @@
1
+ .set--bleed {
2
+ --bleed: max(var(--gutter, var(--gutter--base)), calc((100cqi - min(100cqi, var(--contentSize, var(--sz--m)))) / 2));
3
+ }
@@ -1,16 +1,16 @@
1
1
  @media (any-hover: hover) {
2
- .set--var\:hov:hover {
2
+ .set--hov:hover {
3
3
  --_notHov: ;
4
4
  }
5
- .set--var\:hov:not(:is(:hover, :focus-within)) {
5
+ .set--hov:not(:is(:hover, :focus-within)) {
6
6
  --_isHov: ;
7
7
  }
8
8
  }
9
9
  @media (any-hover: none) {
10
- .set--var\:hov {
10
+ .set--hov {
11
11
  --_isHov: ;
12
12
  }
13
13
  }
14
- .set--var\:hov:is(:focus-visible, :focus-within) {
14
+ .set--hov:is(:focus-visible, :focus-within) {
15
15
  --_notHov: ;
16
16
  }
@@ -1,5 +1,6 @@
1
1
  // @forward './bp'; // Note: set--bp は無効化中。ファイルは参考用に残す
2
2
  @forward './hov';
3
3
  @forward './bdrsInner';
4
+ @forward './bleed';
4
5
  @forward './plain';
5
6
  @forward './revert';
@@ -1,7 +1,7 @@
1
1
  /* --------------------------------------------------
2
2
  shadow
3
3
  Memo: :root だけで --bxsh-- をセットしてしまうと --shc がその時点で固定されるので、
4
- 要素ごとに --shc を上書きできるよう、再セット用の set--var:bxsh クラスを併用する。
4
+ 要素ごとに --shc を上書きできるよう、再セット用の set--bxsh クラスを併用する。
5
5
  -------------------------------------------------- */
6
6
  :root {
7
7
  --shc: var(--shadow);
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  :root,
17
- .set--var\:bxsh {
17
+ .set--bxsh {
18
18
  --bxsh--10: var(--shsz--10) var(--shc);
19
19
  --bxsh--20: var(--shsz--20) var(--shc);
20
20
  --bxsh--30: var(--shsz--30) var(--shc);
@@ -1,9 +1,9 @@
1
1
  /* --------------------------------------------------
2
2
  SPACEトークンの定義
3
- Memo: set--var:s で、SPACEトークンを再定義できる。
3
+ Memo: set--s で、SPACEトークンを再定義できる。
4
4
  -------------------------------------------------- */
5
5
  :root,
6
- .set--var\:s {
6
+ .set--s {
7
7
  /**
8
8
  * 余白: フィボナッチ数列をベースに設計する
9
9
  */
@@ -24,7 +24,7 @@
24
24
  --s25: calc(var(--s-unit) * 2.5); // ≒ 20px
25
25
  --s35: calc(var(--s-unit) * 4); // ≒ 32px
26
26
  }
27
- .set--var\:s {
27
+ .set--s {
28
28
  // 何も指定しなければ em 単位に変換する
29
29
  --s-unit: 0.5em;
30
30
  }
@@ -93,11 +93,11 @@
93
93
  */
94
94
  --ar--og: 1.91/1;
95
95
 
96
- /**
97
- * サイトコンテンツの左右につける余白量
96
+ /**
97
+ * サイトコンテンツの左右につける余白量の基準値
98
98
  * Memo: -max-sz\:full などからも参照されるのでrootで定義している
99
99
  */
100
- --gutter-size: var(--s30);
100
+ --gutter--base: var(--s30);
101
101
 
102
102
  /**
103
103
  * コンテンツ間の余白バリエーションを定義
@@ -3,7 +3,7 @@
3
3
  */
4
4
  .l--autoColumns {
5
5
  --cols: 20rem;
6
- --autoMode: auto-fit;
6
+ --autoMode: auto-fill;
7
7
  display: grid;
8
8
  grid-template-columns: repeat(var(--autoMode), minmax(min(var(--cols), 100%), 1fr));
9
9
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  // ----------------------------------------
35
- // .-hov\:in (set--var:hov 連動の consumer class)
35
+ // .-hov\:in (set--hov 連動の consumer class)
36
36
  // ----------------------------------------
37
37
 
38
38
  .-hov\:in\:hide {
@@ -3,8 +3,8 @@
3
3
 
4
4
  :where(.has--gutter) > & {
5
5
  inline-size: auto; // is--wrapper > * の inline-size: 100% を打ち消し、負 margin による hang を効かせる
6
- max-inline-size: calc(100% + var(--gutter-size) * 2);
7
- margin-inline: calc(var(--gutter-size) * -1);
6
+ max-inline-size: calc(100% + var(--gutter) * 2);
7
+ margin-inline: calc(var(--gutter) * -1);
8
8
  }
9
9
  }
10
10
 
@@ -38,9 +38,6 @@
38
38
  line-break: strict; /* 禁則処理を厳格に適用 */
39
39
  overflow-wrap: anywhere; /* 収まらない場合に折り返す */
40
40
 
41
- /* デフォルトの 8 はでかすぎる */
42
- tab-size: 4;
43
-
44
41
  /* 要素はみ出しによる横スクロールの発生を防止. (overflow は 継承プロパティではないので両方記述) */
45
42
  overflow-x: clip;
46
43
 
@@ -1,3 +1,4 @@
1
1
  .has--gutter {
2
- padding-inline: var(--gutter-size);
2
+ --gutter: var(--gutter--base);
3
+ padding-inline: var(--gutter);
3
4
  }
@@ -10,7 +10,7 @@
10
10
  }
11
11
  .is--container.has--gutter > * {
12
12
  // has--gutterがある場合はその分を加算
13
- --sz--bleed: calc(100cqi + var(--gutter-size) * 2);
13
+ --sz--bleed: calc(100cqi + var(--gutter) * 2);
14
14
  }
15
15
  .is--container .is--container > * {
16
16
  // --sz--bleed は一番先祖(最外側) の is--container で値をセットしたらあとは引き継ぐだけ
@@ -8,11 +8,4 @@
8
8
  }
9
9
  }
10
10
 
11
- // Memo: それぞれの直下要素( > * ) に対してスタイルをセットした方がネスト時の影響をなくせるが、wrapper のネストが多様されることは少ないので親側の変数管理のみで実装。
12
- .-contentSize\:s {
13
- --contentSize: var(--sz--s);
14
- }
15
-
16
- .-contentSize\:l {
17
- --contentSize: var(--sz--l);
18
- }
11
+ // Memo: .-contentSize:s / m / l / xl は contentSize Prop の auto-generated 出力(src/scss/_prop-config.scss 経由)から自動的に props 層に出力される。
@@ -1,5 +1,5 @@
1
1
  .u--divide,
2
- .u--cells {
2
+ .u--enclose {
3
3
  --bdw: 1px;
4
4
  --bdc: var(--divider);
5
5
  gap: var(--bdw);
@@ -13,6 +13,6 @@
13
13
  overflow: clip;
14
14
  }
15
15
  /* 各セルを囲む */
16
- .u--cells {
16
+ .u--enclose {
17
17
  padding: var(--bdw);
18
18
  }