lism-css 0.23.0-beta.0 → 0.24.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/README.ja.md +38 -37
- package/README.md +5 -5
- package/dist/config/default-config.d.ts +5 -2
- package/dist/config/defaults/breakpoints.d.ts +7 -0
- package/dist/config/defaults/breakpoints.js +4 -1
- package/dist/config/defaults/props.d.ts +3 -0
- package/dist/config/defaults/props.js +4 -1
- package/dist/config/defaults/tokens.d.ts +2 -2
- package/dist/config/defaults/tokens.js +11 -2
- package/dist/config/index.d.ts +12 -7
- package/dist/config/index.js +12 -15
- package/dist/config/types.d.ts +38 -0
- package/dist/config/types.js +1 -0
- package/dist/css/base.css +1 -1
- package/dist/css/full.css +1 -1
- package/dist/css/full_no_layer.css +1 -1
- package/dist/css/main.css +1 -1
- package/dist/css/main_no_layer.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/index.d.ts +1 -0
- package/dist/lib/getBpData.d.ts +1 -1
- package/dist/lib/getBpData.js +1 -1
- package/dist/lib/getLismProps.d.ts +2 -1
- package/dist/lib/types/CustomPropRegistry.d.ts +6 -1
- package/dist/lib/types/CustomPropValueRegistry.d.ts +9 -0
- package/dist/lib/types/PropValueTypes.d.ts +14 -6
- package/dist/lib/types/ResponsiveProps.d.ts +3 -1
- package/dist/lib/warnUnsupportedBp.js +5 -5
- package/package.json +5 -1
- package/src/scss/_prop-config-full.gen.scss +1 -0
- package/src/scss/_prop-config.gen.scss +1 -0
- package/src/scss/base/_html.scss +1 -2
- package/src/scss/base/tokens/_tokens.gen.scss +2 -2
- package/src/scss/reset.scss +3 -0
- package/src/scss/trait/is/_boxLink.scss +2 -1
package/README.ja.md
CHANGED
|
@@ -5,32 +5,32 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/lism-css)
|
|
6
6
|
[](https://github.com/lism-css/lism-css/blob/main/LICENSE)
|
|
7
7
|
|
|
8
|
-
## lism-css
|
|
8
|
+
## lism-cssとは?
|
|
9
9
|
|
|
10
|
-
Lism CSS
|
|
10
|
+
Lism CSSは、Webサイトのレイアウトを素早く、かつ美しく構築するための軽量な **CSS設計フレームワーク**です。
|
|
11
11
|
|
|
12
12
|
[Every Layout](https://every-layout.dev/) のレイアウトプリミティブやハーモニックモジュラースケーリング、[Tailwind CSS](https://tailwindcss.com/) のCSSプロパティ単位でのユーティリティファーストなアプローチから着想を得て、独自のCSS設計を組み立てました。
|
|
13
13
|
|
|
14
|
-
ビルドステップや設定は不要です。CDN
|
|
15
|
-
React / Astro
|
|
14
|
+
ビルドステップや設定は不要です。CDN経由でCSSファイルを読み込むか、npmからインポートするだけですぐに使い始められます。
|
|
15
|
+
React / Astro向けのコンポーネントも提供しており、propsを通じてCSSクラスとカスタムプロパティに変換されるため、ランタイムでのスタイル生成なしにコンポーネントベースの開発が可能です。
|
|
16
16
|
|
|
17
17
|
## 特徴
|
|
18
18
|
|
|
19
|
-
- **軽量** - CSS
|
|
20
|
-
- **ゼロビルドフレームワーク** — CSS
|
|
21
|
-
- **レイアウト優先のプリミティブアーキテクチャ** — レイアウトプリミティブ(`l--flex`、`l--stack`、`l--grid`、`l--columns`、`l--center`、`l--withSide` など)で、カスタム
|
|
22
|
-
- **CSS
|
|
23
|
-
- **デザイントークン** — カラー、余白、フォントサイズ、シャドウ、ボーダー半径を
|
|
24
|
-
-
|
|
25
|
-
- **レスポンシブシステム** — ブレークポイント固有のクラスと
|
|
26
|
-
- **React & Astro
|
|
19
|
+
- **軽量** - CSSバンドル全体で約30 KB(gzip圧縮時約8 KB)と、軽量です。
|
|
20
|
+
- **ゼロビルドフレームワーク** — CSSファイルを読み込むだけで、プレーンHTMLでも動作します。ビルドツール、プリプロセッサ、設定は不要。CDNまたはnpmで利用可能。
|
|
21
|
+
- **レイアウト優先のプリミティブアーキテクチャ** — レイアウトプリミティブ(`l--flex`、`l--stack`、`l--grid`、`l--columns`、`l--center`、`l--withSide` など)で、カスタムCSSを書かずに一般的なレイアウトパターンを組み立てられます。
|
|
22
|
+
- **CSSレイヤー構造** — `@layer`(lism-base → lism-trait → lism-primitive → lism-component → lism-custom → lism-utility)を使用した明確な詳細度管理。`lism-trait` は `is--` / `has--` のTraitクラス用レイヤー、`lism-primitive` の内部は `layout` / `atomic` のサブレイヤーに分かれています。`lism-component` はBEM構造の `c--` コンポーネント用レイヤー、`lism-custom` はユーザー独自プレフィックスのクラス用レイヤーです。詳細度の衝突を最小限に抑えます。
|
|
23
|
+
- **デザイントークン** — カラー、余白、フォントサイズ、シャドウ、ボーダー半径をCSSカスタムプロパティで管理。変数を上書きするだけで簡単にカスタマイズできます。
|
|
24
|
+
- **柔軟なProperty Class** — `-{prop}:{value}` の命名規則(例: `-p:20`、`-bgc:base-2`、`-fz:l`)でCSSプロパティをユーティリティクラスにマッピングし、素早く読みやすいスタイリングを実現します。
|
|
25
|
+
- **レスポンシブシステム** — ブレークポイント固有のクラスとCSS変数(例: `-p_sm`、`-p_md`)にデフォルトでコンテナクエリを採用し、親要素ベースのレスポンシブデザインを実現。メディアクエリへの切り替えも可能。
|
|
26
|
+
- **React & Astroコンポーネント** — ReactとAstroの両方に対応した専用コンポーネントが、propsをLism CSSのクラスと変数に自動変換します。`class="l--stack -g:20"` の代わりに `<Stack g="20">` と書けます。
|
|
27
27
|
|
|
28
28
|
## インストール
|
|
29
29
|
|
|
30
30
|
### CDN(ビルド不要)
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
|
-
<link href="https://cdn.jsdelivr.net/npm/lism-css@0/dist/css/main.css" rel="stylesheet" />
|
|
33
|
+
<link href="https://cdn.jsdelivr.net/npm/lism-css@0.24.0/dist/css/main.css" rel="stylesheet" />
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### npm
|
|
@@ -47,15 +47,15 @@ pnpm add lism-css
|
|
|
47
47
|
|
|
48
48
|
## セットアップ
|
|
49
49
|
|
|
50
|
-
グローバルスタイルとして
|
|
50
|
+
グローバルスタイルとしてCSSをインポートします:
|
|
51
51
|
|
|
52
52
|
```js
|
|
53
53
|
import 'lism-css/main.css';
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
**Next.js
|
|
56
|
+
**Next.js**の場合は、`layout.js`(App Router)または `_app.js`(Pages Router)で読み込みます。
|
|
57
57
|
|
|
58
|
-
**Astro
|
|
58
|
+
**Astro**の場合は、`node_modules` から `.astro` コンポーネントをインポートできるよう、`astro.config.js` に以下を追加します:
|
|
59
59
|
|
|
60
60
|
```js
|
|
61
61
|
export default defineConfig({
|
|
@@ -107,7 +107,7 @@ import { Box, Flex, Stack, Text, Heading } from 'lism-css/astro';
|
|
|
107
107
|
</Stack>
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
### HTML(CSS
|
|
110
|
+
### HTML(CSSのみ)
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
113
|
<div class="l--stack -g:20">
|
|
@@ -125,37 +125,38 @@ import { Box, Flex, Stack, Text, Heading } from 'lism-css/astro';
|
|
|
125
125
|
|
|
126
126
|
## コアコンポーネント
|
|
127
127
|
|
|
128
|
-
Lism CSS
|
|
128
|
+
Lism CSSは以下の React / Astroコンポーネントを提供します:
|
|
129
129
|
|
|
130
130
|
**レイアウトコンポーネント:**
|
|
131
|
-
Lism, Box, Flow, Flex, Cluster, Stack, Grid, AutoColumns, SwitchColumns, WithSide, Center, Columns, Frame
|
|
131
|
+
Lism, Box, Flow, Flex, Cluster, Stack, Grid, AutoColumns, SwitchColumns, WithSide, Center, Columns, Frame, TileGrid
|
|
132
132
|
|
|
133
133
|
**構造コンポーネント:**
|
|
134
134
|
Container, Wrapper, Layer, BoxLink
|
|
135
135
|
|
|
136
136
|
**コンテンツコンポーネント:**
|
|
137
|
-
Text, Heading, Inline, Link, Group, List
|
|
137
|
+
Text, Heading, Inline, Link, Group, List, Media
|
|
138
138
|
|
|
139
139
|
**アトミックコンポーネント:**
|
|
140
|
-
Icon,
|
|
140
|
+
Icon, Decorator, Divider, Spacer
|
|
141
141
|
|
|
142
|
-
すべてのコンポーネントは
|
|
142
|
+
すべてのコンポーネントはLism props(例: `p`、`m`、`g`、`fz`、`bgc`、`bdrs`)を受け取り、CSSクラスと変数に自動的にマッピングされます。
|
|
143
143
|
|
|
144
|
-
## CSS
|
|
144
|
+
## CSSクラスシステム
|
|
145
145
|
|
|
146
|
-
Lism CSS
|
|
146
|
+
Lism CSSは構造化された命名規則をCSSクラスに使用しています:
|
|
147
147
|
|
|
148
148
|
| タイプ | パターン | 例 |
|
|
149
149
|
|--------|---------|-----|
|
|
150
150
|
| レイアウトプリミティブ | `l--{name}` | `l--flex`, `l--grid`, `l--stack`, `l--center`, `l--columns`, `l--withSide` |
|
|
151
|
-
|
|
|
152
|
-
|
|
|
151
|
+
| Trait Class(役割) | `is--{name}` | `is--wrapper`, `is--container`, `is--layer`, `is--boxLink` |
|
|
152
|
+
| Trait Class(機能) | `has--{name}` | `has--transition`, `has--gutter`, `has--snap` |
|
|
153
|
+
| Property Class | `-{prop}:{value}` | `-p:20`, `-m:auto`, `-bgc:base-2`, `-fz:l`, `-ta:center` |
|
|
153
154
|
| ブレークポイント | `-{prop}_{bp}` | `-p_sm`, `-g_md`, `-fz_lg` |
|
|
154
155
|
| ユーティリティクラス | `u--{name}` | `u--cbox` |
|
|
155
156
|
|
|
156
157
|
## レスポンシブシステム
|
|
157
158
|
|
|
158
|
-
レスポンシブ値は、ブレークポイント固有のクラスと
|
|
159
|
+
レスポンシブ値は、ブレークポイント固有のクラスとCSS変数を使って設定します:
|
|
159
160
|
|
|
160
161
|
**HTML:**
|
|
161
162
|
|
|
@@ -177,36 +178,36 @@ Lism CSS は構造化された命名規則を CSS クラスに使用していま
|
|
|
177
178
|
|
|
178
179
|
## デザイントークン
|
|
179
180
|
|
|
180
|
-
Lism CSS
|
|
181
|
+
Lism CSSは一貫したデザインのためのCSSカスタムプロパティを提供します:
|
|
181
182
|
|
|
182
|
-
- **カラー:** `--base`、`--base-2`、`--text`、`--text-2`、`--link`、`--divider`、`--brand`、`--accent`、パレットカラー(`--red`、`--blue`、`--green` など)
|
|
183
|
-
- **余白:** `--s5`, `--s10`, `--s15`, `--s20`, `--s25`, `--s30`, `--s35`, `--s40` … `--s80`(rem
|
|
183
|
+
- **カラー:** `--base`、`--base-2`、`--text`、`--text-2`、`--link`、`--divider`、`--brand`、`--accent`、`--neutral`、パレットカラー(`--red`、`--blue`、`--green` など)
|
|
184
|
+
- **余白:** `--s5`, `--s10`, `--s15`, `--s20`, `--s25`, `--s30`, `--s35`, `--s40` … `--s80`(rem値にマッピング)
|
|
184
185
|
- **フォントサイズ:** `--fz--2xs` 〜 `--fz--5xl`
|
|
185
186
|
- **ボーダー半径:** `--bdrs--10`(0.25rem)〜 `--bdrs--99`(99rem)
|
|
186
187
|
- **シャドウ:** `--bxsh--10` 〜 `--bxsh--50`(シャドウカラー設定可能)
|
|
187
188
|
- **コンテナサイズ:** `--sz--xs`(400px)、`--sz--s`(640px)、`--sz--m`(880px)、`--sz--l`(1200px)、`--sz--xl`(1600px)
|
|
188
189
|
|
|
189
|
-
## UI
|
|
190
|
+
## UIコンポーネント
|
|
190
191
|
|
|
191
|
-
インタラクティブな
|
|
192
|
+
インタラクティブなUIコンポーネント(Accordion、Modal、Tabs、Alert、Avatar、Badge、Buttonなど)については、別パッケージの [@lism-css/ui](https://www.npmjs.com/package/@lism-css/ui) を参照してください。
|
|
192
193
|
|
|
193
194
|
```bash
|
|
194
195
|
npm i @lism-css/ui
|
|
195
196
|
```
|
|
196
197
|
|
|
197
|
-
## AI
|
|
198
|
+
## AIツール連携
|
|
198
199
|
|
|
199
200
|
### llms.txt
|
|
200
201
|
|
|
201
|
-
AI
|
|
202
|
+
AIアシスタントやLLMベースのツール向けに、機械可読なドキュメントインデックスを提供しています:
|
|
202
203
|
|
|
203
204
|
```
|
|
204
205
|
https://lism-css.com/llms.txt
|
|
205
206
|
```
|
|
206
207
|
|
|
207
|
-
### MCP
|
|
208
|
+
### MCPサーバー
|
|
208
209
|
|
|
209
|
-
AI
|
|
210
|
+
AIコーディングツール向けのMCP(Model Context Protocol)サーバーが利用可能です:
|
|
210
211
|
|
|
211
212
|
**Claude Code:**
|
|
212
213
|
|
|
@@ -249,7 +250,7 @@ claude mcp add lism-css -- npx -y @lism-css/mcp
|
|
|
249
250
|
|
|
250
251
|
## コミュニティ
|
|
251
252
|
|
|
252
|
-
フィードバックや質問は、[Lism CSS Discord
|
|
253
|
+
フィードバックや質問は、[Lism CSS Discordサーバー](https://discord.gg/6PMcFHvc4h)までお気軽にどうぞ。
|
|
253
254
|
|
|
254
255
|
## クレジット
|
|
255
256
|
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ No build step or configuration is required. Simply load the CSS file via CDN or
|
|
|
29
29
|
### CDN (no build required)
|
|
30
30
|
|
|
31
31
|
```html
|
|
32
|
-
<link href="https://cdn.jsdelivr.net/npm/lism-css@0/dist/css/main.css" rel="stylesheet" />
|
|
32
|
+
<link href="https://cdn.jsdelivr.net/npm/lism-css@0.24.0/dist/css/main.css" rel="stylesheet" />
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### npm
|
|
@@ -127,16 +127,16 @@ import { Box, Flex, Stack, Text, Heading } from 'lism-css/astro';
|
|
|
127
127
|
Lism CSS provides the following React and Astro components:
|
|
128
128
|
|
|
129
129
|
**Layout Components:**
|
|
130
|
-
Lism, Box, Flow, Flex, Cluster, Stack, Grid, AutoColumns, SwitchColumns, WithSide, Center, Columns, Frame
|
|
130
|
+
Lism, Box, Flow, Flex, Cluster, Stack, Grid, AutoColumns, SwitchColumns, WithSide, Center, Columns, Frame, TileGrid
|
|
131
131
|
|
|
132
132
|
**Structure Components:**
|
|
133
133
|
Container, Wrapper, Layer, BoxLink
|
|
134
134
|
|
|
135
135
|
**Content Components:**
|
|
136
|
-
Text, Heading, Inline, Link, Group, List
|
|
136
|
+
Text, Heading, Inline, Link, Group, List, Media
|
|
137
137
|
|
|
138
138
|
**Atomic Components:**
|
|
139
|
-
Icon,
|
|
139
|
+
Icon, Decorator, Divider, Spacer
|
|
140
140
|
|
|
141
141
|
All components accept Lism props (e.g., `p`, `m`, `g`, `fz`, `bgc`, `bdrs`) that automatically map to CSS classes and variables.
|
|
142
142
|
|
|
@@ -179,7 +179,7 @@ Default breakpoints: `sm` = 480px, `md` = 800px, `lg` = 1120px (container querie
|
|
|
179
179
|
|
|
180
180
|
Lism CSS provides CSS custom properties for consistent design:
|
|
181
181
|
|
|
182
|
-
- **Colors:** `--base`, `--base-2`, `--text`, `--text-2`, `--link`, `--divider`, `--brand`, `--accent`, plus palette colors (`--red`, `--blue`, `--green`, etc.)
|
|
182
|
+
- **Colors:** `--base`, `--base-2`, `--text`, `--text-2`, `--link`, `--divider`, `--brand`, `--accent`, `--neutral`, plus palette colors (`--red`, `--blue`, `--green`, etc.)
|
|
183
183
|
- **Spacing:** `--s5`, `--s10`, `--s15`, `--s20`, `--s25`, `--s30`, `--s35`, `--s40` … `--s80` (mapped to rem values)
|
|
184
184
|
- **Font Sizes:** `--fz--2xs` through `--fz--5xl`
|
|
185
185
|
- **Border Radius:** `--bdrs--10` (0.25rem) through `--bdrs--99` (99rem)
|
|
@@ -56,8 +56,8 @@ declare const _default: {
|
|
|
56
56
|
readonly xl: "0.1em";
|
|
57
57
|
};
|
|
58
58
|
readonly ff: {
|
|
59
|
-
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif
|
|
60
|
-
readonly accent: "
|
|
59
|
+
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif";
|
|
60
|
+
readonly accent: "Georgia, serif";
|
|
61
61
|
readonly mono: "ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace";
|
|
62
62
|
};
|
|
63
63
|
readonly fw: {
|
|
@@ -159,6 +159,9 @@ declare const _default: {
|
|
|
159
159
|
readonly token: "hl";
|
|
160
160
|
readonly tokenClass: 1;
|
|
161
161
|
readonly bp: 1;
|
|
162
|
+
readonly utils: {
|
|
163
|
+
readonly '0': "0px";
|
|
164
|
+
};
|
|
162
165
|
};
|
|
163
166
|
readonly lts: {
|
|
164
167
|
readonly prop: "letterSpacing";
|
|
@@ -13,3 +13,10 @@ declare const BREAKPOINTS: {
|
|
|
13
13
|
readonly xl: 0;
|
|
14
14
|
};
|
|
15
15
|
export default BREAKPOINTS;
|
|
16
|
+
/** ブレイクポイントの全キー集合(`base` を除く)。config 執筆時の型・prop の bp リスト等の単一 source。 */
|
|
17
|
+
export type BreakpointKey = keyof typeof BREAKPOINTS;
|
|
18
|
+
export declare const BREAK_POINTS: readonly ["sm", "md", "lg", "xl"];
|
|
19
|
+
/** 配列記法の位置順(`base` を除く)。位置は固定の契約(変更しない)。 */
|
|
20
|
+
export type BreakpointSequence = typeof BREAK_POINTS;
|
|
21
|
+
export declare const BREAK_POINTS_ALL: readonly ["base", "sm", "md", "lg", "xl"];
|
|
22
|
+
export declare const BREAK_POINTS_OBJ: readonly ["base", "xs", "sm", "md", "lg", "xl"];
|
|
@@ -21,7 +21,10 @@ const e = ["start", "center", "end"], r = ["flex-start", "flex-end"], p = { s: "
|
|
|
21
21
|
isVar: 1,
|
|
22
22
|
token: "hl",
|
|
23
23
|
tokenClass: 1,
|
|
24
|
-
bp: 1
|
|
24
|
+
bp: 1,
|
|
25
|
+
// hl="0" で half-leading なし (--hl:0px) を表現できるようにする互換ユーティリティ。
|
|
26
|
+
// lh="1"(互換ショートカット)の .-lh:1 と同じ出力にし、正規 prop の hl 側でも揃えられるようにする。
|
|
27
|
+
utils: { 0: "0px" }
|
|
25
28
|
},
|
|
26
29
|
lts: { prop: "letterSpacing", token: "lts", tokenClass: 1 },
|
|
27
30
|
ta: { prop: "textAlign", presets: ["center", "left", "right"] },
|
|
@@ -63,8 +63,8 @@ declare const _default: {
|
|
|
63
63
|
readonly xl: "0.1em";
|
|
64
64
|
};
|
|
65
65
|
readonly ff: {
|
|
66
|
-
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif
|
|
67
|
-
readonly accent: "
|
|
66
|
+
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif";
|
|
67
|
+
readonly accent: "Georgia, serif";
|
|
68
68
|
readonly mono: "ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace";
|
|
69
69
|
};
|
|
70
70
|
readonly fw: {
|
|
@@ -52,8 +52,17 @@ const a = {
|
|
|
52
52
|
lts: { base: "normal", s: "-0.025em", l: "0.05em", xl: "0.1em" },
|
|
53
53
|
// font-family
|
|
54
54
|
ff: {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
/* Base:
|
|
56
|
+
* -apple-system/BlinkMacSystemFont → Macで英数字をSan Franciscoに。(前者がSafari/Firefox、後者がChrome用)
|
|
57
|
+
* 'Hiragino Sans' → Macでの和文フォントの指定。ここを省くと、Chromeで sans-serifが Hiragino Kaku Gothic ProN になってしまう
|
|
58
|
+
* sans-serif: Mac=Hiragino系 / Win=Noto|Meiryo
|
|
59
|
+
*
|
|
60
|
+
* Note: system-ui は和文に游ゴシックが当たるため使わない。
|
|
61
|
+
*/
|
|
62
|
+
base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif",
|
|
63
|
+
// Accent: 装飾用セリフ。初期状態はあくまで一例で実際はカスタマイズしてもらう想定。
|
|
64
|
+
accent: "Georgia, serif",
|
|
65
|
+
// Mono: ui-monospace=各OSのUI等幅 / SFMono・Menlo→Mac・Consolas→Win のフォールバック
|
|
57
66
|
mono: "ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace"
|
|
58
67
|
},
|
|
59
68
|
// font-weight
|
package/dist/config/index.d.ts
CHANGED
|
@@ -43,6 +43,9 @@ export declare const CONFIG: {
|
|
|
43
43
|
readonly token: "hl";
|
|
44
44
|
readonly tokenClass: 1;
|
|
45
45
|
readonly bp: 1;
|
|
46
|
+
readonly utils: {
|
|
47
|
+
readonly '0': "0px";
|
|
48
|
+
};
|
|
46
49
|
};
|
|
47
50
|
readonly lts: {
|
|
48
51
|
readonly prop: "letterSpacing";
|
|
@@ -809,8 +812,8 @@ export declare const CONFIG: {
|
|
|
809
812
|
readonly xl: "0.1em";
|
|
810
813
|
};
|
|
811
814
|
readonly ff: {
|
|
812
|
-
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif
|
|
813
|
-
readonly accent: "
|
|
815
|
+
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif";
|
|
816
|
+
readonly accent: "Georgia, serif";
|
|
814
817
|
readonly mono: "ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace";
|
|
815
818
|
};
|
|
816
819
|
readonly fw: {
|
|
@@ -957,8 +960,8 @@ export declare const TOKENS: {
|
|
|
957
960
|
readonly xl: "0.1em";
|
|
958
961
|
};
|
|
959
962
|
readonly ff: {
|
|
960
|
-
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif
|
|
961
|
-
readonly accent: "
|
|
963
|
+
readonly base: "-apple-system, 'BlinkMacSystemFont', 'Hiragino Sans', sans-serif";
|
|
964
|
+
readonly accent: "Georgia, serif";
|
|
962
965
|
readonly mono: "ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace";
|
|
963
966
|
};
|
|
964
967
|
readonly fw: {
|
|
@@ -1060,6 +1063,9 @@ export declare const PROPS: {
|
|
|
1060
1063
|
readonly token: "hl";
|
|
1061
1064
|
readonly tokenClass: 1;
|
|
1062
1065
|
readonly bp: 1;
|
|
1066
|
+
readonly utils: {
|
|
1067
|
+
readonly '0': "0px";
|
|
1068
|
+
};
|
|
1063
1069
|
};
|
|
1064
1070
|
readonly lts: {
|
|
1065
1071
|
readonly prop: "letterSpacing";
|
|
@@ -1782,6 +1788,5 @@ export declare const TRAITS: {
|
|
|
1782
1788
|
readonly hasSnap: "has--snap";
|
|
1783
1789
|
readonly hasMask: "has--mask";
|
|
1784
1790
|
};
|
|
1785
|
-
export
|
|
1786
|
-
export
|
|
1787
|
-
export declare const BREAK_POINTS_OBJ: readonly ["base", "xs", "sm", "md", "lg", "xl"];
|
|
1791
|
+
export { BREAK_POINTS, BREAK_POINTS_ALL, BREAK_POINTS_OBJ } from './defaults/breakpoints';
|
|
1792
|
+
export type { BreakpointKey, BreakpointSequence } from './defaults/breakpoints';
|
package/dist/config/index.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { arrayConvertToSet as
|
|
5
|
-
const
|
|
6
|
-
let t = e(
|
|
1
|
+
import r from "./default-config.js";
|
|
2
|
+
import i from "./presets/props-full.js";
|
|
3
|
+
import n from "lism-css/config.js";
|
|
4
|
+
import { arrayConvertToSet as s, objDeepMerge as e } from "./helper.js";
|
|
5
|
+
const l = n.isFullMode, p = l ? e(r, { props: i }) : r;
|
|
6
|
+
let t = e(p, n);
|
|
7
7
|
typeof window < "u" && window._LISM_CSS_CONFIG_ && (t = e(t, window._LISM_CSS_CONFIG_));
|
|
8
|
-
const
|
|
8
|
+
const C = t, { tokens: o, props: c, traits: f } = C, d = {
|
|
9
9
|
...o,
|
|
10
10
|
color: { ...o.color, ...o.palette }
|
|
11
|
-
},
|
|
11
|
+
}, a = s(structuredClone(d)), g = s(structuredClone(c)), w = f;
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
a as PROPS,
|
|
18
|
-
O as TOKENS,
|
|
19
|
-
g as TRAITS
|
|
13
|
+
C as CONFIG,
|
|
14
|
+
g as PROPS,
|
|
15
|
+
a as TOKENS,
|
|
16
|
+
w as TRAITS
|
|
20
17
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `lism.config.*` を書く側の静的型。`lism-css/config-types` として公開する。
|
|
3
|
+
*
|
|
4
|
+
* 使い方:
|
|
5
|
+
* - `.ts`: `export default { ... } satisfies LismConfig`(typo 検出・補完・literal 保持)
|
|
6
|
+
* - `.js`: `/** @type {import('lism-css/config-types').LismConfig} *\/`
|
|
7
|
+
*
|
|
8
|
+
* - `lism-env.d.ts`(ビルド時生成物)や副作用付きの `config/index.ts` には依存しない。
|
|
9
|
+
* - typo 検出が目的なので index signature は付けない(object literal の excess property check を効かせる)。
|
|
10
|
+
* - ランタイム側の `PropConfig`(`src/lib/getLismProps.ts` の Set 化後の形)とは別物。
|
|
11
|
+
*/
|
|
12
|
+
export type { BreakpointKey } from './defaults/breakpoints';
|
|
13
|
+
import type { BreakpointKey } from './defaults/breakpoints';
|
|
14
|
+
/** prop 1 件分の設定(config 執筆時の形)。 */
|
|
15
|
+
export interface PropConfig {
|
|
16
|
+
prop?: string;
|
|
17
|
+
token?: string;
|
|
18
|
+
tokenClass?: 0 | 1;
|
|
19
|
+
presets?: readonly (string | number)[];
|
|
20
|
+
utils?: Record<string, string | number>;
|
|
21
|
+
shorthands?: Record<string, string>;
|
|
22
|
+
isVar?: 0 | 1;
|
|
23
|
+
bp?: 0 | 1 | readonly BreakpointKey[];
|
|
24
|
+
alwaysVar?: 0 | 1;
|
|
25
|
+
important?: 0 | 1;
|
|
26
|
+
exUtility?: Record<string, string | Record<string, string>>;
|
|
27
|
+
}
|
|
28
|
+
/** `lism.config.*` の default export(および `window._LISM_CSS_CONFIG_`)の型。 */
|
|
29
|
+
export interface LismConfig {
|
|
30
|
+
tokens?: Record<string, Record<string, string | number> | readonly (string | number)[]>;
|
|
31
|
+
props?: Record<string, PropConfig>;
|
|
32
|
+
traits?: Record<string, string>;
|
|
33
|
+
breakpoints?: Partial<Record<BreakpointKey, string | number>>;
|
|
34
|
+
defaultImportant?: boolean;
|
|
35
|
+
isFullMode?: boolean;
|
|
36
|
+
/** lism-cli の UI 設定。スキーマは lism-cli 側が管理するため緩い型にとどめる。 */
|
|
37
|
+
ui?: Record<string, unknown>;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/css/base.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@property --hl{syntax:"<length>";inherits:true;initial-value:.25rem}@property --sz--bleed{syntax:"<length-percentage>";initial-value:100svi;inherits:true}:root{--L:60%;--C:0.2;--red:oklch(var(--L) var(--C) 20);--orange:oklch(calc(var(--L) + 6%) calc(var(--C) - 0.01) 48);--yellow:oklch(calc(var(--L) + 12%) calc(var(--C) - 0.02) 80);--green:oklch(calc(var(--L) + 4%) calc(var(--C) - 0.02) 152);--blue:oklch(calc(var(--L) - 4%) calc(var(--C) + 0.01) 264);--purple:oklch(calc(var(--L) - 4%) calc(var(--C) + 0.01) 288);--pink:oklch(calc(var(--L) + 2%) calc(var(--C) + 0.01) 352);--gray:oklch(calc(var(--L) - 4%) calc(var(--C)/10) 240);--brand:#1e5f8c;--accent:#d94a6a;--base:#fcfcfc;--base-2:#f2f2f3;--text:#141414;--text-2:#4e5155;--link:oklch(50% 0.3 240);--divider:#dfe0e2;--shadow:rgba(20,20,21,.12);--neutral:#cbcccd;--shc:var(--shadow);--shsz--10:0px 1px 3px;--shsz--20:0px 2px 6px;--shsz--30:0px 4px 12px;--shsz--40:0px 8px 24px;--shsz--50:0px 16px 48px;--fz-mol:8;--hl-unit:calc(var(--fz--base)*0.125);--s-unit:calc(var(--fz--base)*0.5);--gutter--base:var(--s30);--flow--base:var(--s30);--flow--s:var(--s20)}:root:where([lang=ja]){--flow--base:var(--s35)}:root{--white:#fff;--black:#000;--fz--base:1rem;--fz--5xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 6));--fz--4xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 5));--fz--3xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 4));--fz--2xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 3));--fz--xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 2));--fz--l:calc(1em*var(--fz-mol)/(var(--fz-mol) - 1));--fz--m:1em;--fz--s:calc(1em*var(--fz-mol)/(var(--fz-mol) + 1));--fz--xs:calc(1em*var(--fz-mol)/(var(--fz-mol) + 2));--fz--2xs:calc(1em*var(--fz-mol)/(var(--fz-mol) + 3));--hl--base:calc(var(--hl-unit)*3);--hl--xs:var(--hl-unit);--hl--s:calc(var(--hl-unit)*2);--hl--l:calc(var(--hl-unit)*4);--lts--base:normal;--lts--s:-0.025em;--lts--l:0.05em;--lts--xl:0.1em;--ff--base:-apple-system,"BlinkMacSystemFont","Hiragino Sans",sans-serif
|
|
1
|
+
@property --hl{syntax:"<length>";inherits:true;initial-value:.25rem}@property --sz--bleed{syntax:"<length-percentage>";initial-value:100svi;inherits:true}:root{--L:60%;--C:0.2;--red:oklch(var(--L) var(--C) 20);--orange:oklch(calc(var(--L) + 6%) calc(var(--C) - 0.01) 48);--yellow:oklch(calc(var(--L) + 12%) calc(var(--C) - 0.02) 80);--green:oklch(calc(var(--L) + 4%) calc(var(--C) - 0.02) 152);--blue:oklch(calc(var(--L) - 4%) calc(var(--C) + 0.01) 264);--purple:oklch(calc(var(--L) - 4%) calc(var(--C) + 0.01) 288);--pink:oklch(calc(var(--L) + 2%) calc(var(--C) + 0.01) 352);--gray:oklch(calc(var(--L) - 4%) calc(var(--C)/10) 240);--brand:#1e5f8c;--accent:#d94a6a;--base:#fcfcfc;--base-2:#f2f2f3;--text:#141414;--text-2:#4e5155;--link:oklch(50% 0.3 240);--divider:#dfe0e2;--shadow:rgba(20,20,21,.12);--neutral:#cbcccd;--shc:var(--shadow);--shsz--10:0px 1px 3px;--shsz--20:0px 2px 6px;--shsz--30:0px 4px 12px;--shsz--40:0px 8px 24px;--shsz--50:0px 16px 48px;--fz-mol:8;--hl-unit:calc(var(--fz--base)*0.125);--s-unit:calc(var(--fz--base)*0.5);--gutter--base:var(--s30);--flow--base:var(--s30);--flow--s:var(--s20)}:root:where([lang=ja]){--flow--base:var(--s35)}:root{--white:#fff;--black:#000;--fz--base:1rem;--fz--5xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 6));--fz--4xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 5));--fz--3xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 4));--fz--2xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 3));--fz--xl:calc(1em*var(--fz-mol)/(var(--fz-mol) - 2));--fz--l:calc(1em*var(--fz-mol)/(var(--fz-mol) - 1));--fz--m:1em;--fz--s:calc(1em*var(--fz-mol)/(var(--fz-mol) + 1));--fz--xs:calc(1em*var(--fz-mol)/(var(--fz-mol) + 2));--fz--2xs:calc(1em*var(--fz-mol)/(var(--fz-mol) + 3));--hl--base:calc(var(--hl-unit)*3);--hl--xs:var(--hl-unit);--hl--s:calc(var(--hl-unit)*2);--hl--l:calc(var(--hl-unit)*4);--lts--base:normal;--lts--s:-0.025em;--lts--l:0.05em;--lts--xl:0.1em;--ff--base:-apple-system,"BlinkMacSystemFont","Hiragino Sans",sans-serif;--ff--accent:Georgia,serif;--ff--mono:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;--fw--light:300;--fw--normal:400;--fw--bold:600;--o--mp:0.9;--o--p:0.75;--o--pp:0.5;--o--ppp:0.25;--bdrs--10:0.25rem;--bdrs--20:0.5rem;--bdrs--30:1rem;--bdrs--40:1.5rem;--bdrs--99:99rem;--sz--xs:400px;--sz--s:640px;--sz--m:880px;--sz--l:1200px;--sz--xl:1600px;--ar--og:1.91/1}.set--bxsh,:root{--bxsh--10:var(--shsz--10) var(--shc);--bxsh--20:var(--shsz--20) var(--shc);--bxsh--30:var(--shsz--30) var(--shc);--bxsh--40:var(--shsz--40) var(--shc);--bxsh--50:var(--shsz--50) var(--shc)}.set--s,:root{--s5:calc(var(--s-unit)*0.5);--s10:var(--s-unit);--s15:calc(var(--s-unit)*1.5);--s20:calc(var(--s-unit)*2);--s25:calc(var(--s-unit)*2.5);--s30:calc(var(--s-unit)*3);--s35:calc(var(--s-unit)*4);--s40:calc(var(--s-unit)*5);--s50:calc(var(--s-unit)*8);--s60:calc(var(--s-unit)*13);--s70:calc(var(--s-unit)*21);--s80:calc(var(--s-unit)*34)}body{--hl:var(--hl--base);background-color:var(--base);color:var(--text);font-family:var(--ff--base);font-size:var(--fz--base);letter-spacing:var(--lts--base);-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-underline-offset:.125em}*{line-height:calc(1em + var(--hl)*2)}:is(h1,h2,h3,h4,h5,h6){font-family:var(--headings-ff,inherit);font-weight:var(--headings-fw,var(--fw--bold))}h1{font-size:var(--fz--3xl)}h2{font-size:var(--fz--2xl)}h3{font-size:var(--fz--xl)}h4{font-size:var(--fz--l)}h5,h6{font-size:var(--fz--m)}a{color:var(--link-c,var(--link));-webkit-text-decoration:var(--link-td,underline);text-decoration:var(--link-td,underline)}small{--hl:var(--hl--s);font-size:var(--fz--xs)}b,strong{font-weight:var(--fw--bold)}sub,sup{--hl:var(--hl--xs);font-size:80%}code,kbd,samp,var{font-family:var(--ff--mono);letter-spacing:normal}:where(blockquote>p)+p{margin-block-start:var(--s10)}blockquote,q{font-style:italic}blockquote{background-color:var(--base-2);padding:var(--s20)}caption,figcaption{font-size:var(--fz--s)}hr{block-size:0;border:none;border-block-start:1px solid var(--divider)}:is(ul,ol):where(:not([class])){list-style:revert;padding-inline-start:var(--list-ps,1.75em)}dt{font-weight:var(--fw--bold)}dd+dt{margin-block-start:var(--s20)}td,th{padding:var(--cells-p,.625em .875em)}::file-selector-button,button,input:not([type=range]),select,textarea{background-color:var(--controls-bgc,var(--base-2));border:1px solid var(--controls-bdc,var(--divider));padding:var(--controls-p,.25em .5em)}:disabled{opacity:var(--o--pp)}:focus-visible{outline-offset:var(--focus-offset,0)}@media (any-hover:hover){.set--hov:hover{--_notHov: }.set--hov:not(:is(:hover,:focus-within)){--_isHov: }}@media (any-hover:none){.set--hov{--_isHov: }}.set--hov:is(:focus-visible,:focus-within){--_notHov: }.set--bdrsInner{--bdrs--inner:calc(var(--bdrs, 0px) - var(--p, 0px))}.set--bleed{--bleed:max(var(--gutter,var(--gutter--base)),calc((100cqi - min(100cqi, var(--contentSize, var(--sz--m)))) / 2))}.set--plain{background:none;border:none;border-radius:0;color:inherit;font:inherit;height:auto;line-height:calc(1em + var(--hl)*2);margin:0;max-height:none;max-width:none;min-height:0;min-width:0;padding:0;text-decoration:none;width:auto}:is(ul,ol).set--revert{list-style:revert;padding-inline-start:var(--list-ps,1.75em)}.set--s{--s-unit:0.5em}
|