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.
- package/config/defaults/props.ts +3 -1
- package/config/defaults/traits.ts +1 -7
- package/dist/components/atomic/Icon/presets.d.ts +28 -12
- package/dist/components/atomic/Icon/presets.js +38 -33
- package/dist/components/layout/AutoColumns/AutoColumns.stories.d.ts +1 -1
- package/dist/components/state/Wrapper/Wrapper.d.ts +2 -4
- package/dist/components/state/Wrapper/index.js +5 -5
- package/dist/config/default-config.d.ts +8 -7
- package/dist/config/defaults/props.d.ts +7 -0
- package/dist/config/defaults/props.js +4 -2
- package/dist/config/defaults/traits.d.ts +1 -7
- package/dist/config/defaults/traits.js +1 -7
- package/dist/config/index.d.ts +16 -14
- package/dist/css/base/set.css +1 -1
- package/dist/css/base.css +1 -1
- package/dist/css/main.css +1 -1
- package/dist/css/main_no_layer.css +1 -1
- package/dist/css/primitives/layout.css +1 -1
- package/dist/css/props.css +1 -1
- package/dist/css/reset.css +1 -1
- package/dist/css/trait.css +1 -1
- package/dist/css/utility.css +1 -1
- package/dist/lib/getLayoutProps.d.ts +1 -1
- package/dist/lib/getLayoutProps.js +2 -2
- package/dist/lib/getLismProps.d.ts +1 -8
- package/dist/lib/getLismProps.js +96 -94
- package/dist/lib/types/LayoutProps.d.ts +1 -1
- package/dist/lib/types/TraitProps.d.ts +11 -12
- package/dist/lib/types/allowedTags.d.ts +1 -1
- package/package.json +1 -1
- package/packages/astro/state/Wrapper/Wrapper.astro +2 -8
- package/src/scss/_prop-config.scss +12 -0
- package/src/scss/base/_html.scss +6 -20
- package/src/scss/base/set/_bdrsInner.scss +1 -1
- package/src/scss/base/set/_bleed.scss +3 -0
- package/src/scss/base/set/_hov.scss +4 -4
- package/src/scss/base/set/index.scss +1 -0
- package/src/scss/base/tokens/_shadow.scss +2 -2
- package/src/scss/base/tokens/_space.scss +3 -3
- package/src/scss/base/tokens/_tokens.scss +3 -3
- package/src/scss/primitives/layout/_autoColumns.scss +1 -1
- package/src/scss/props/_hover.scss +1 -1
- package/src/scss/props/_size.scss +2 -2
- package/src/scss/reset.scss +0 -3
- package/src/scss/trait/has/_gutter.scss +2 -1
- package/src/scss/trait/is/_container.scss +1 -1
- package/src/scss/trait/is/_wrapper.scss +1 -8
- package/src/scss/utility/_divide.scss +2 -2
package/dist/lib/getLismProps.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { TRAITS as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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
|
|
7
|
-
import
|
|
6
|
+
import g from "./getUtilKey.js";
|
|
7
|
+
import C from "./getMaybeCssVar.js";
|
|
8
8
|
import x from "./getBpData.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
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
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
return
|
|
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
|
|
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(
|
|
31
|
-
const { forwardedRef:
|
|
32
|
-
this.styles = { ...r }, this._propConfig = { ...
|
|
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(
|
|
38
|
-
return
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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(
|
|
65
|
-
if (
|
|
66
|
-
let i =
|
|
66
|
+
analyzeLismProp(t, s) {
|
|
67
|
+
if (s == null) return;
|
|
68
|
+
let i = d[t] || null;
|
|
67
69
|
if (i === null) return;
|
|
68
|
-
this._propConfig?.[
|
|
69
|
-
const { base: e, ...o } = x(
|
|
70
|
-
process.env.NODE_ENV !== "production" && !i.bp && Object.keys(o).length > 0 &&
|
|
71
|
-
i && this.setAttrs(
|
|
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(
|
|
75
|
-
this.setClasses.push(`set--${
|
|
76
|
+
addSet(t) {
|
|
77
|
+
this.setClasses.push(`set--${t}`);
|
|
76
78
|
}
|
|
77
|
-
addUtil(
|
|
78
|
-
this.uClasses.push(
|
|
79
|
+
addUtil(t) {
|
|
80
|
+
this.uClasses.push(t);
|
|
79
81
|
}
|
|
80
|
-
addUtils(
|
|
81
|
-
this.uClasses.push(...
|
|
82
|
+
addUtils(t) {
|
|
83
|
+
this.uClasses.push(...t);
|
|
82
84
|
}
|
|
83
|
-
addProp(
|
|
84
|
-
this.propClasses.push(
|
|
85
|
+
addProp(t) {
|
|
86
|
+
this.propClasses.push(t);
|
|
85
87
|
}
|
|
86
|
-
addStyle(
|
|
87
|
-
this.styles[
|
|
88
|
+
addStyle(t, s) {
|
|
89
|
+
this.styles[t] = s;
|
|
88
90
|
}
|
|
89
|
-
addStyles(
|
|
90
|
-
this.styles = { ...this.styles, ...
|
|
91
|
+
addStyles(t) {
|
|
92
|
+
this.styles = { ...this.styles, ...t };
|
|
91
93
|
}
|
|
92
|
-
addAttrs(
|
|
93
|
-
this.addStyles(
|
|
94
|
+
addAttrs(t) {
|
|
95
|
+
this.addStyles(t.styles || {}), this.addUtils(t.utils || []);
|
|
94
96
|
}
|
|
95
|
-
extractProp(
|
|
96
|
-
const
|
|
97
|
-
return this.attrs[
|
|
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(
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
this.attrs[i] !== void 0 && (
|
|
103
|
-
}),
|
|
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(
|
|
108
|
-
if (
|
|
109
|
-
let o = `--${
|
|
110
|
-
if (e && (o = `--${
|
|
111
|
-
this.addProp(`${r}:${
|
|
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:
|
|
116
|
-
if (p &&
|
|
117
|
-
const
|
|
118
|
-
|
|
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 (
|
|
122
|
-
const
|
|
123
|
-
|
|
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
|
|
127
|
-
if (
|
|
128
|
-
this.addProp(`${r}:${
|
|
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 (
|
|
134
|
+
if (s === !0) {
|
|
133
135
|
this.addProp(r);
|
|
134
136
|
return;
|
|
135
137
|
}
|
|
136
|
-
const { prop:
|
|
137
|
-
let
|
|
138
|
-
if (
|
|
139
|
-
if (
|
|
140
|
-
this.addStyle(`--${
|
|
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 (!
|
|
143
|
-
this.addStyle(
|
|
144
|
+
} else if (!O && !$) {
|
|
145
|
+
this.addStyle(u, a);
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
|
-
this.addProp(r), this.addStyle(o,
|
|
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(
|
|
163
|
-
|
|
164
|
-
this.addProp(`-hov:${
|
|
165
|
-
}) : typeof
|
|
166
|
-
const i = s
|
|
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:${
|
|
171
|
+
this.addProp(`-hov:${s}`);
|
|
170
172
|
else if (typeof i == "string" || typeof i == "number") {
|
|
171
|
-
const e =
|
|
172
|
-
this.addProp(`-hov:-${
|
|
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(
|
|
179
|
-
if (Object.keys(
|
|
180
|
+
function D(n) {
|
|
181
|
+
if (Object.keys(n).length === 0)
|
|
180
182
|
return {};
|
|
181
|
-
const { atomic:
|
|
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
|
-
|
|
194
|
+
L as LismPropsData,
|
|
193
195
|
D as default
|
|
194
196
|
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { TRAITS } from '../../../config/index';
|
|
2
|
-
import {
|
|
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 :
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
21
|
+
export type TraitProps = Omit<GeneratedTraitProps, 'isWrapper'> & {
|
|
22
|
+
isWrapper?: boolean | ContentSizeStringValue;
|
|
24
23
|
};
|
|
25
24
|
/** set prop で使われるプリセット値(エディタ補完用) */
|
|
26
|
-
type SetPreset = 'plain' | 'revert' | '
|
|
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' | '
|
|
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,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
|
|
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',
|
package/src/scss/base/_html.scss
CHANGED
|
@@ -8,7 +8,9 @@ body {
|
|
|
8
8
|
letter-spacing: var(--lts--base);
|
|
9
9
|
background-color: var(--base);
|
|
10
10
|
color: var(--text);
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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,16 +1,16 @@
|
|
|
1
1
|
@media (any-hover: hover) {
|
|
2
|
-
.set--
|
|
2
|
+
.set--hov:hover {
|
|
3
3
|
--_notHov: ;
|
|
4
4
|
}
|
|
5
|
-
.set--
|
|
5
|
+
.set--hov:not(:is(:hover, :focus-within)) {
|
|
6
6
|
--_isHov: ;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
@media (any-hover: none) {
|
|
10
|
-
.set--
|
|
10
|
+
.set--hov {
|
|
11
11
|
--_isHov: ;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
.set--
|
|
14
|
+
.set--hov:is(:focus-visible, :focus-within) {
|
|
15
15
|
--_notHov: ;
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* --------------------------------------------------
|
|
2
2
|
shadow
|
|
3
3
|
Memo: :root だけで --bxsh-- をセットしてしまうと --shc がその時点で固定されるので、
|
|
4
|
-
要素ごとに --shc を上書きできるよう、再セット用の set--
|
|
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--
|
|
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--
|
|
3
|
+
Memo: set--s で、SPACEトークンを再定義できる。
|
|
4
4
|
-------------------------------------------------- */
|
|
5
5
|
:root,
|
|
6
|
-
.set--
|
|
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--
|
|
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
|
|
100
|
+
--gutter--base: var(--s30);
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* コンテンツ間の余白バリエーションを定義
|
|
@@ -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
|
|
7
|
-
margin-inline: calc(var(--gutter
|
|
6
|
+
max-inline-size: calc(100% + var(--gutter) * 2);
|
|
7
|
+
margin-inline: calc(var(--gutter) * -1);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
package/src/scss/reset.scss
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
.is--container.has--gutter > * {
|
|
12
12
|
// has--gutterがある場合はその分を加算
|
|
13
|
-
--sz--bleed: calc(100cqi + var(--gutter
|
|
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:
|
|
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 層に出力される。
|