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.
- package/config/defaults/props.ts +8 -7
- package/config/defaults/tokens.ts +1 -1
- package/config/defaults/traits.ts +0 -1
- package/dist/components/Dummy/Dummy.d.ts +1 -1
- package/dist/components/Lism/Lism.stories.d.ts +1 -2
- package/dist/components/atomic/Decorator/Decorator.d.ts +6 -1
- package/dist/components/atomic/Decorator/index.js +4 -5
- package/dist/components/atomic/Divider/index.js +4 -5
- package/dist/components/atomic/Icon/getProps.d.ts +1 -1
- package/dist/components/atomic/Icon/getProps.js +34 -35
- package/dist/components/atomic/Spacer/index.js +5 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/config/default-config.d.ts +13 -9
- package/dist/config/defaults/props.d.ts +12 -7
- package/dist/config/defaults/props.js +10 -9
- package/dist/config/defaults/tokens.d.ts +1 -1
- package/dist/config/defaults/tokens.js +1 -1
- package/dist/config/defaults/traits.d.ts +0 -1
- package/dist/config/defaults/traits.js +3 -4
- package/dist/config/index.d.ts +26 -18
- package/dist/config/index.js +4 -4
- 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/primitives/trait.css +1 -1
- package/dist/css/props.css +1 -1
- package/dist/lib/getAtomicProps.d.ts +24 -0
- package/dist/lib/getAtomicProps.js +30 -0
- package/dist/lib/getLayoutProps.d.ts +1 -1
- package/dist/lib/getLayoutProps.js +28 -18
- package/dist/lib/getLismProps.d.ts +11 -8
- package/dist/lib/getLismProps.js +50 -56
- package/dist/lib/getMaybeTokenValue.js +20 -20
- package/dist/lib/types/AtomicProps.d.ts +22 -0
- package/dist/lib/types/TraitProps.d.ts +1 -1
- package/package.json +1 -1
- package/packages/astro/Dummy/Dummy.astro +1 -1
- package/packages/astro/atomic/Decorator/Decorator.astro +4 -7
- package/packages/astro/atomic/Divider/Divider.astro +1 -2
- package/packages/astro/atomic/Spacer/Spacer.astro +1 -2
- package/packages/astro/index.ts +1 -1
- package/src/scss/_prop-config.scss +13 -6
- package/src/scss/base/_html.scss +1 -1
- package/src/scss/base/set/_bp.scss +2 -2
- package/src/scss/base/set/index.scss +1 -1
- package/src/scss/base/tokens/_tokens.scss +6 -7
- package/src/scss/primitives/atomic/_icon.scss +2 -2
- package/src/scss/primitives/layout/_fluidCols.scss +1 -1
- package/src/scss/primitives/layout/_sideMain.scss +1 -1
- package/src/scss/primitives/trait/index.scss +0 -1
- package/dist/components/atomic/Decorator/getProps.d.ts +0 -8
- package/dist/components/atomic/Decorator/getProps.js +0 -15
- package/dist/components/atomic/Divider/getProps.d.ts +0 -2
- package/dist/components/atomic/Divider/getProps.js +0 -11
- package/dist/components/atomic/Spacer/getProps.d.ts +0 -2
- package/dist/components/atomic/Spacer/getProps.js +0 -27
- package/src/scss/primitives/trait/_vertical.scss +0 -9
package/dist/lib/getLismProps.js
CHANGED
|
@@ -1,59 +1,53 @@
|
|
|
1
|
-
import { TRAITS as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
// 出力順のためのクラスバケット: [
|
|
27
|
-
// -
|
|
28
|
-
// -
|
|
29
|
-
|
|
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,
|
|
38
|
-
this.styles = { ...
|
|
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
|
-
// 出力順: [
|
|
34
|
+
// 出力順: [className&class] [primitiveClass] [uClasses]
|
|
35
|
+
// className と class が両方来た場合は両方マージする(atts 内で重複は除去される)。
|
|
42
36
|
buildClassName(i, t) {
|
|
43
|
-
return
|
|
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.
|
|
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
|
-
|
|
53
|
-
if (Object.hasOwn(
|
|
54
|
-
const e = this.extractProp(s), l =
|
|
55
|
-
typeof l == "string" ? e && this.
|
|
56
|
-
} else if (Object.hasOwn(
|
|
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 =
|
|
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 } =
|
|
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:
|
|
118
|
-
if (
|
|
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 (
|
|
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 (
|
|
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:
|
|
132
|
+
const { prop: o, isVar: c, alwaysVar: O, token: y, bp: k } = s;
|
|
139
133
|
let f;
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
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 && !
|
|
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" ?
|
|
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
|
-
|
|
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 =
|
|
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
|
|
178
|
+
function Y(n) {
|
|
185
179
|
if (Object.keys(n).length === 0)
|
|
186
180
|
return {};
|
|
187
|
-
const {
|
|
181
|
+
const { atomic: i, layout: t, ...s } = n, e = V(i, s), l = E(t, e), r = new L(l);
|
|
188
182
|
return {
|
|
189
|
-
...
|
|
190
|
-
className:
|
|
191
|
-
style:
|
|
183
|
+
...p({
|
|
184
|
+
className: r.className,
|
|
185
|
+
style: p(r.styles)
|
|
192
186
|
}),
|
|
193
|
-
...
|
|
187
|
+
...r.attrs
|
|
194
188
|
// data-* などHTMLの標準属性はそのまま渡す
|
|
195
189
|
};
|
|
196
190
|
}
|
|
197
191
|
export {
|
|
198
192
|
L as LismPropsData,
|
|
199
|
-
|
|
193
|
+
Y as default
|
|
200
194
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
function a(
|
|
2
|
-
if (
|
|
3
|
-
let
|
|
4
|
-
return
|
|
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
|
|
7
|
-
if (!
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
} else if (Array.isArray(
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
15
|
-
} else if ("pre" in
|
|
16
|
-
const { pre:
|
|
17
|
-
if (s instanceof Set && s.has(
|
|
18
|
-
return `var(${
|
|
19
|
-
if (Array.isArray(s) && s.includes(
|
|
20
|
-
return `var(${
|
|
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(
|
|
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'
|
|
26
|
+
type SetPreset = 'gutter' | 'shadow' | 'hov' | 'transition' | 'mask' | 'plain' | 'innerRs';
|
|
27
27
|
/**
|
|
28
28
|
* set prop の値の型。プリセット値がサジェストされつつ、任意の文字列も受け付ける。
|
|
29
29
|
*
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
-
import type {
|
|
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} {...
|
|
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} {...
|
|
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} {...
|
|
11
|
+
<Lism as={Tag} atomic="spacer" aria-hidden="true" {...props} {...exProps} />
|
package/packages/astro/index.ts
CHANGED
|
@@ -114,9 +114,9 @@ $props: (
|
|
|
114
114
|
prop: 'opacity',
|
|
115
115
|
utilities: (
|
|
116
116
|
'0': '0',
|
|
117
|
-
'-10': 'var(--o
|
|
118
|
-
'-20': 'var(--o
|
|
119
|
-
'-30': 'var(--o
|
|
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
|
-
'
|
|
821
|
+
'ovw': (
|
|
822
822
|
prop: 'overflow-wrap',
|
|
823
823
|
utilities: (
|
|
824
824
|
'anywhere': 'anywhere',
|
|
825
825
|
),
|
|
826
826
|
),
|
|
827
|
-
'
|
|
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
|
-
'
|
|
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
|
);
|
package/src/scss/base/_html.scss
CHANGED
|
@@ -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
|
|
69
|
-
--o
|
|
70
|
-
--o
|
|
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
|
-
*
|
|
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; //
|
|
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;
|
|
@@ -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,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
|
-
};
|