lism-css 0.22.0 → 0.22.2

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.
@@ -1,45 +0,0 @@
1
- /**
2
- --size- → --szー
3
- トークンはハイフン二つ
4
-
5
- globalトークン、 --target-- → --target- かな
6
- → --(\w)+?-- で検索。
7
-
8
-
9
- ・flow, container → l--、 frame→is--では?
10
- ・普通のクラス設計、BEMにもどす
11
-
12
- */
13
-
14
- // tier 1 layout・フォントは超短縮系に省略. 覚えてもらう必要があるもの。
15
- // p m g flex grid ai ac ji jc lh lts
16
-
17
- // 方向指定、一文字のもの(p,m,g) はそのまま繋げる。 start/endのみハイフン。
18
- // 2文字以上のものは、すべてハイフンで繋ぐ
19
-
20
- // tier 2 わかる程度に省略/名称変換
21
- // ovwrap wbreak
22
-
23
- // tier 3 非省略
24
- // whitespace translate rotate scale order
25
- // -whitespace:nowrap (-whspace?)
26
-
27
- // wrap-anywhere と break-keep, break-all,
28
- // -ovwrap:anywhere, -wordbreak:keep -wordbreak:all
29
-
30
- // 値のキーワード単体で容易に対応するプロパティが想像できるものは、ユーティリティクラスで {-prop} 部分が省略可能とします。
31
- // .underline .italic .uppercase, .-lowercase, .emphasis
32
- // .relative .absolute .fixed, ...
33
- // .block flex block in-block in-flex, ...
34
-
35
- // -txd:none
36
-
37
- // -d:none
38
- // -v:visible, -v:hidden isolate
39
-
40
- // prop省略系?→utility
41
- // .u--colorBox .u--trimLeading u--srOnly
42
-
43
- // .underline
44
- // --under-offset, --under-c, --under-thickness
45
- //
@@ -1,361 +0,0 @@
1
- /**
2
- * isVar: 1 → クラス出力はせずstyle属性での変数出力のみ (--bdw, --keycolor など)
3
- * bp: 0 → Prop-valユーティリティクラス化されなければ、style属性で出力するだけ。
4
- * bp: 1 → .-prop と --prop の セットがベースにあり、.-prop_bp と .--prop_bp で ブレイクポイント指定できる。
5
- * .-prop{property:var(--prop)} が基本で、ユーティリティクラスは .-prop:val{property:value} となる。
6
- *
7
- * ↓コンポーネント処理で使用される
8
- * tokenClass: 1 → 対応するトークン値がそのまま全てユーティリティクラス化されるもの。
9
- * 2 → ユーティリティクラスされ、内容は別途ファイルで記述するもの。
10
- * shorthands: → コンポーネント側で短く書くための設定
11
- *
12
- * ↓SCSS出力で使用される
13
- * alwaysVar: 1 → state変数扱い。 .-prop,[class*=-prop:] {property:var(--prop)} の base 出力となり、
14
- * ユーティリティクラスは --prop をセットする形になる。
15
- * 加えて BPクラスも .-prop_$bp { property: var(--prop); --prop: var(--prop_$bp) !important; } を出力し、
16
- * 常に --prop が当該要素の現在値になるよう上書きされる(consumer が --prop を参照できる)。
17
- * important: 1 → !important を付けて最終的に出力する
18
- */
19
-
20
- const PLACE_PRESETS = ['start', 'center', 'end'] as const;
21
- const PLACE_FX_PRESETS = ['flex-start', 'flex-end'] as const;
22
- const PLACE_SHORTHANDS = { s: 'start', e: 'end', c: 'center', fs: 'flex-start', fe: 'flex-end' } as const;
23
-
24
- export default {
25
- f: { prop: 'font', presets: ['inherit'] },
26
- fz: { prop: 'fontSize', token: 'fz', tokenClass: 1, bp: 1 },
27
- fw: {
28
- prop: 'fontWeight',
29
- token: 'fw',
30
- tokenClass: 1,
31
- presets: ['100', '200', '300', '400', '500', '600', '700', '800', '900'],
32
- },
33
- ff: { prop: 'fontFamily', token: 'ff', tokenClass: 1 },
34
- fs: { prop: 'fontStyle', presets: ['italic'], shorthands: { i: 'italic' } },
35
- lh: {
36
- prop: 'lineHeight',
37
- presets: ['1'],
38
- token: 'hl',
39
- tokenClass: 2,
40
- exUtility: { 1: '' },
41
- },
42
- hl: {
43
- isVar: 1,
44
- token: 'hl',
45
- tokenClass: 0,
46
- bp: 0,
47
- },
48
- lts: { prop: 'letterSpacing', token: 'lts', tokenClass: 1, bp: 0 },
49
- ta: { prop: 'textAlign', presets: ['center', 'left', 'right'] },
50
- td: { prop: 'textDecoration', utils: { none: 'none' } },
51
- tt: { prop: 'textTransform', utils: { upper: 'uppercase', lower: 'lowercase' } },
52
- // te: { prop: 'textEmphasis', presets: ['filled'] },
53
- // tsh: { prop: 'textShadow' },
54
-
55
- d: {
56
- prop: 'display',
57
- presets: ['none', 'block', 'flex', 'inline-flex', 'grid', 'inline-grid', 'inline', 'inline-block'],
58
- bp: 'lg',
59
- },
60
- o: { prop: 'opacity', presets: ['0'], token: 'o', tokenClass: 1 },
61
- v: { prop: 'visibility', presets: ['hidden'] },
62
- ov: { prop: 'overflow', presets: ['hidden', 'auto', 'clip'] },
63
- 'ov-x': { prop: 'overflowX', presets: ['clip', 'auto', 'scroll'] },
64
- 'ov-y': { prop: 'overflowY', presets: ['clip', 'auto', 'scroll'] },
65
- // overflow-clip-margin → safariで使えない
66
- ar: {
67
- prop: 'aspectRatio',
68
- presets: ['21/9', '16/9', '3/2', '1/1'], // 4/3, 2/1
69
- token: 'ar',
70
- tokenClass: 1,
71
- bp: 1,
72
- },
73
-
74
- // size
75
- w: { prop: 'width', utils: { fit: 'fit-content' }, presets: ['100%'], token: 'sz', bp: 1 },
76
- h: { prop: 'height', utils: { fit: 'fit-content' }, presets: ['100%'], token: 'sz', bp: 1 },
77
- 'min-w': { prop: 'minWidth', presets: ['100%'], token: 'sz', bp: 1 },
78
- 'max-w': { prop: 'maxWidth', presets: ['100%'], token: 'sz', bp: 1 },
79
- 'min-h': { prop: 'minHeight', presets: ['100%'], token: 'sz', bp: 1 },
80
- 'max-h': { prop: 'maxHeight', presets: ['100%'], token: 'sz', bp: 1 },
81
-
82
- contentSize: { isVar: 1, presets: ['s', 'm', 'l', 'xl'], token: 'sz' },
83
- sz: { prop: 'inlineSize', token: 'sz' },
84
- 'min-sz': { prop: 'minInlineSize', token: 'sz' },
85
- 'max-sz': {
86
- prop: 'maxInlineSize',
87
- token: 'sz',
88
- tokenClass: 1,
89
- presets: ['full', 'bleed'],
90
- exUtility: {
91
- full: '',
92
- bleed: '',
93
- },
94
- },
95
- bsz: { prop: 'blockSize', token: 'sz' },
96
- 'min-bsz': { prop: 'minBlockSize', token: 'sz' },
97
- 'max-bsz': { prop: 'maxBlockSize', token: 'sz' },
98
-
99
- // bg
100
- bg: { prop: 'background', bp: 0 },
101
- bgi: { prop: 'backgroundImage' },
102
- bgr: { prop: 'backgroundRepeat', presets: ['no-repeat'] },
103
- bgp: { prop: 'backgroundPosition', presets: ['center'] },
104
- bgsz: { prop: 'backgroundSize', presets: ['cover', 'contain'] },
105
- // bga: { prop: 'backgroundAttachment' }, // fixed
106
- // bgo: { prop: 'backgroundOrigin' }, // border, padding, content
107
- // bgblend: { prop: 'backgroundBlendMode' },
108
- // bgclip: {
109
- // prop: 'backgroundClip',
110
- // presets: ['text'],
111
- // },
112
- bgc: {
113
- prop: 'backgroundColor',
114
- presets: ['base', 'base-2', 'text', 'brand', 'accent', 'inherit', 'transparent'],
115
- token: 'color',
116
- exUtility: { inherit: { 'background-color': 'inherit' } },
117
- alwaysVar: 1,
118
- },
119
-
120
- c: {
121
- // Note: bg系(bgclip)より後にくるように。
122
- prop: 'color',
123
- presets: ['base', 'text', 'text-2', 'brand', 'accent', 'inherit'],
124
- token: 'color',
125
- exUtility: {
126
- inherit: { color: 'inherit' }, // --c ではなく color で出力したい
127
- // mix: {'--_c1:currentColor;--_c2:transparent;--c:color-mix(in srgb, var(--_c1) var(--_mix-c, 50%), var(--_c2))'},
128
- },
129
- alwaysVar: 1,
130
- },
131
- keycolor: { isVar: 1, token: 'color' },
132
- bd: { prop: 'border', presets: ['none'] },
133
- bds: { isVar: 1, presets: ['dashed', 'dotted', 'double'] },
134
- bdc: {
135
- isVar: 1,
136
- presets: ['brand', 'accent', 'divider', 'inherit', 'transparent'],
137
- utils: { current: 'currentColor' },
138
- token: 'color',
139
- },
140
- bdw: { isVar: 1, bp: 1 }, // --bdw のみ
141
- 'bd-x': { prop: 'borderInline' },
142
- 'bd-y': { prop: 'borderBlock' },
143
- 'bd-s': { prop: 'borderInlineStart' },
144
- 'bd-e': { prop: 'borderInlineEnd' },
145
- 'bd-bs': { prop: 'borderBlockStart' },
146
- 'bd-be': { prop: 'borderBlockEnd' },
147
- 'bd-t': { prop: 'borderTop' },
148
- 'bd-b': { prop: 'borderBottom' },
149
- 'bd-l': { prop: 'borderLeft' },
150
- 'bd-r': { prop: 'borderRight' },
151
-
152
- bdrs: {
153
- prop: 'borderRadius',
154
- presets: ['0'],
155
- token: 'bdrs',
156
- tokenClass: 1,
157
- bp: 1,
158
- alwaysVar: 1,
159
- },
160
- 'bdrs-tl': { prop: 'borderTopLeftRadius', token: 'bdrs' },
161
- 'bdrs-tr': { prop: 'borderTopRightRadius', token: 'bdrs' },
162
- 'bdrs-br': { prop: 'borderBottomRightRadius', token: 'bdrs' },
163
- 'bdrs-bl': { prop: 'borderBottomLeftRadius', token: 'bdrs' },
164
- 'bdrs-ss': { prop: 'borderStartStartRadius', token: 'bdrs' },
165
- 'bdrs-se': { prop: 'borderStartEndRadius', token: 'bdrs' },
166
- 'bdrs-es': { prop: 'borderEndStartRadius', token: 'bdrs' },
167
- 'bdrs-ee': { prop: 'borderEndEndRadius', token: 'bdrs' },
168
-
169
- bxsh: { prop: 'boxShadow', utils: { 0: 'none' }, token: 'bxsh', tokenClass: 1, bp: 1 },
170
-
171
- // position
172
- pos: {
173
- prop: 'position',
174
- presets: ['static', 'fixed', 'sticky', 'relative', 'absolute'],
175
- bp: 1,
176
- },
177
- z: { prop: 'zIndex', presets: ['-1', '0', '1', '99'] },
178
- t: { prop: 'top', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
179
- l: { prop: 'left', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
180
- r: { prop: 'right', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
181
- b: { prop: 'bottom', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
182
- i: { prop: 'inset', utils: { 0: '0%' }, token: 'space' },
183
- 'i-x': { prop: 'insetInline', token: 'space' },
184
- 'i-y': { prop: 'insetBlock', token: 'space' },
185
- 'i-s': { prop: 'insetInlineStart', token: 'space' },
186
- 'i-e': { prop: 'insetInlineEnd', token: 'space' },
187
- 'i-bs': { prop: 'insetBlockStart', token: 'space' },
188
- 'i-be': { prop: 'insetBlockEnd', token: 'space' },
189
-
190
- // space
191
- p: {
192
- prop: 'padding',
193
- presets: ['0'],
194
- token: 'space',
195
- tokenClass: 1,
196
- alwaysVar: 1,
197
- bp: 1,
198
- },
199
- px: { prop: 'paddingInline', presets: ['0'], token: 'space', tokenClass: 1, bp: 1 },
200
- py: { prop: 'paddingBlock', presets: ['0'], token: 'space', tokenClass: 1, bp: 1 },
201
- ps: { prop: 'paddingInlineStart', token: 'space', bp: 1 },
202
- pe: { prop: 'paddingInlineEnd', token: 'space', bp: 1 },
203
- pbs: { prop: 'paddingBlockStart', token: 'space', bp: 1 },
204
- pbe: { prop: 'paddingBlockEnd', token: 'space', bp: 1 },
205
- pl: { prop: 'paddingLeft', token: 'space', bp: 0 },
206
- pr: { prop: 'paddingRight', token: 'space', bp: 0 },
207
- pt: { prop: 'paddingTop', token: 'space', bp: 0 },
208
- pb: { prop: 'paddingBottom', token: 'space', bp: 0 },
209
- m: {
210
- prop: 'margin',
211
- presets: ['auto', '0'],
212
- token: 'space',
213
- tokenClass: 1,
214
- alwaysVar: 1,
215
- bp: 1,
216
- },
217
- mx: { prop: 'marginInline', presets: ['auto', '0'], token: 'space', tokenClass: 1, bp: 1 },
218
- my: { prop: 'marginBlock', presets: ['auto', '0'], token: 'space', tokenClass: 1, bp: 1 },
219
- ms: { prop: 'marginInlineStart', presets: ['auto'], token: 'space', bp: 1 },
220
- me: { prop: 'marginInlineEnd', presets: ['auto'], token: 'space', bp: 1 },
221
- mbs: { prop: 'marginBlockStart', token: 'space', bp: 1, presets: ['auto', '0'], tokenClass: 1 },
222
- mbe: { prop: 'marginBlockEnd', presets: ['auto'], token: 'space', bp: 1 },
223
- ml: { prop: 'marginLeft', token: 'space', bp: 0 },
224
- mr: { prop: 'marginRight', token: 'space', bp: 0 },
225
- mt: { prop: 'marginTop', token: 'space', bp: 0 },
226
- mb: { prop: 'marginBottom', token: 'space', bp: 0 },
227
-
228
- g: {
229
- prop: 'gap',
230
- presets: ['0', 'inherit'],
231
- exUtility: { inherit: { gap: 'inherit' } },
232
- token: 'space',
233
- tokenClass: 1,
234
- bp: 'lg',
235
- },
236
- cg: { prop: 'columnGap', token: 'space', bp: 0 },
237
- rg: { prop: 'rowGap', token: 'space', bp: 0 },
238
- cols: { isVar: 1, bp: 'lg' },
239
- rows: { isVar: 1, bp: 1 },
240
-
241
- // flex
242
- fxf: { prop: 'flexFlow' },
243
- fxw: { prop: 'flexWrap', presets: ['wrap'], bp: 1 },
244
- fxd: { prop: 'flexDirection', presets: ['column', 'column-reverse', 'row-reverse'], bp: 1 },
245
- fx: { prop: 'flex', presets: ['1'], bp: 1 },
246
- fxg: { prop: 'flexGrow', presets: ['1'] },
247
- fxsh: { prop: 'flexShrink', presets: ['0'] },
248
- fxb: { prop: 'flexBasis', bp: 1 },
249
-
250
- // grid
251
- // gd: { prop: 'grid' },
252
- gt: {
253
- prop: 'gridTemplate',
254
- bp: 1,
255
- },
256
- gta: { prop: 'gridTemplateAreas', bp: 'lg' },
257
- gtc: {
258
- prop: 'gridTemplateColumns',
259
- presets: ['subgrid'],
260
- bp: 'lg',
261
- },
262
- gtr: {
263
- prop: 'gridTemplateRows',
264
- presets: ['subgrid'],
265
- bp: 'lg',
266
- },
267
- gaf: { prop: 'gridAutoFlow', presets: ['row', 'column'], bp: 1 }, //dense
268
- gac: { prop: 'gridAutoColumns' },
269
- gar: { prop: 'gridAutoRows' },
270
-
271
- // grid item
272
- ga: { prop: 'gridArea', utils: { '1/1': '1 / 1' }, bp: 'lg' },
273
- gc: { prop: 'gridColumn', utils: { '1/-1': '1 / -1' }, bp: 'lg' },
274
- gr: { prop: 'gridRow', utils: { '1/-1': '1 / -1' }, bp: 'lg' },
275
- gcs: { prop: 'gridColumnStart' },
276
- gce: { prop: 'gridColumnEnd' },
277
- grs: { prop: 'gridRowStart' },
278
- gre: { prop: 'gridRowEnd' },
279
-
280
- // places
281
- // -(ai|ac|ji|jc|aslf|jslf): / -$1:
282
- ai: {
283
- prop: 'alignItems',
284
- presets: [...PLACE_PRESETS, 'stretch', ...PLACE_FX_PRESETS],
285
- shorthands: PLACE_SHORTHANDS,
286
- bp: 1,
287
- },
288
- ac: {
289
- prop: 'alignContent',
290
- presets: [...PLACE_PRESETS, ...PLACE_FX_PRESETS],
291
- utils: { between: 'space-between' },
292
- shorthands: PLACE_SHORTHANDS,
293
- bp: 1,
294
- },
295
- ji: {
296
- prop: 'justifyItems',
297
- presets: [...PLACE_PRESETS, 'stretch', ...PLACE_FX_PRESETS],
298
- shorthands: PLACE_SHORTHANDS,
299
- bp: 1,
300
- },
301
- jc: {
302
- prop: 'justifyContent',
303
- presets: [...PLACE_PRESETS, ...PLACE_FX_PRESETS],
304
- utils: { between: 'space-between' },
305
- shorthands: PLACE_SHORTHANDS,
306
- bp: 1,
307
- },
308
- pi: { prop: 'placeItems', presets: PLACE_PRESETS },
309
- pc: { prop: 'placeContent', presets: PLACE_PRESETS },
310
- aslf: {
311
- prop: 'alignSelf',
312
- presets: [...PLACE_PRESETS, 'stretch'],
313
- shorthands: PLACE_SHORTHANDS,
314
- },
315
- jslf: {
316
- prop: 'justifySelf',
317
- presets: [...PLACE_PRESETS, 'stretch'],
318
- shorthands: PLACE_SHORTHANDS,
319
- },
320
- pslf: { prop: 'placeSelf', presets: PLACE_PRESETS },
321
- order: { prop: 'order', presets: ['0', '-1', '1'], bp: 1 },
322
-
323
- // transform
324
- // translate: {
325
- // prop: 'translate',
326
- // utils: {
327
- // '-50X': '-50% 0',
328
- // '-50Y': '0 -50%',
329
- // '-50XY': '-50% -50%',
330
- // },
331
- // },
332
-
333
- // rotate: {
334
- // prop: 'rotate',
335
- // utils: {
336
- // [`45`]: '45deg',
337
- // '-45': '-45deg',
338
- // [`90`]: '90deg',
339
- // '-90': '-90deg',
340
- // // '180': '180deg',
341
- // },
342
- // },
343
-
344
- // scale: {
345
- // prop: 'scale',
346
- // utils: {
347
- // '-X': '-1 1',
348
- // '-Y': '1 -1',
349
- // '-XY': '-1 -1',
350
- // },
351
- // },
352
-
353
- // others
354
- ovw: { prop: 'overflowWrap', presets: ['anywhere'] },
355
- whs: { prop: 'whiteSpace', presets: ['nowrap'] },
356
- // wordbreak: { prop: 'wordBreak', utils: { keep: 'keep-all', all: 'break-all' } },
357
- float: { prop: 'float', presets: ['left', 'right'] },
358
- clear: { prop: 'clear', presets: ['both'] },
359
- iso: { prop: 'isolation', presets: ['isolate'] },
360
- wm: { prop: 'writingMode', presets: ['vertical-rl'], bp: 1 },
361
- } as const;
@@ -1,27 +0,0 @@
1
- export default {
2
- fz: ['root', 'base', '5xl', '4xl', '3xl', '2xl', 'xl', 'l', 'm', 's', 'xs', '2xs'],
3
- lh: ['base', 'xs', 's', 'l'],
4
- hl: ['base', 'xs', 's', 'l'],
5
- lts: ['base', 's', 'l', 'xl'],
6
- ff: ['base', 'accent', 'mono'],
7
- fw: ['light', 'normal', 'bold'],
8
- o: ['mp', 'p', 'pp', 'ppp'],
9
- bdrs: ['10', '20', '30', '40', '99', 'inner'],
10
- bxsh: ['10', '20', '30', '40', '50'],
11
- sz: ['xs', 's', 'm', 'l', 'xl'],
12
- ar: ['og'],
13
- space: {
14
- pre: '--s',
15
- values: ['5', '10', '15', '20', '25', '30', '35', '40', '50', '60', '70', '80'],
16
- },
17
- c: {
18
- pre: '--',
19
- values: ['base', 'base-2', 'text', 'text-2', 'divider', 'link', 'brand', 'accent', 'neutral'],
20
- },
21
- palette: {
22
- pre: '--',
23
- values: ['red', 'blue', 'green', 'yellow', 'purple', 'orange', 'pink', 'gray', 'white', 'black', 'keycolor'],
24
- },
25
- writing: ['vertical'],
26
- flow: ['s', 'l'],
27
- } as const;
@@ -1,13 +0,0 @@
1
- export default {
2
- isContainer: 'is--container',
3
- isWrapper: 'is--wrapper',
4
- isLayer: 'is--layer',
5
- isBoxLink: 'is--boxLink',
6
- isCoverLink: 'is--coverLink',
7
- isSide: 'is--side',
8
- isSkipFlow: 'is--skipFlow',
9
- hasTransition: 'has--transition',
10
- hasGutter: 'has--gutter',
11
- hasSnap: 'has--snap',
12
- hasMask: 'has--mask',
13
- } as const;
@@ -1,22 +0,0 @@
1
- /**
2
- * html文字列をminify
3
- */
4
- const minifyHtml = (html: string) => {
5
- if (!html) return '';
6
-
7
- // 改行先に削除
8
- html = html.replace(/\r?\n/g, '');
9
-
10
- // タブ → スペース
11
- html = html.replace(/\t/g, ' ');
12
-
13
- // 複数のスペースを1つに
14
- html = html.replace(/\s\s+/g, ' ');
15
-
16
- // タグとタグの間のスペースを削除
17
- html = html.replace(/> </g, '><');
18
-
19
- return html;
20
- };
21
-
22
- export default minifyHtml;