lism-css 0.10.1 → 0.10.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.
- package/README.ja.md +260 -0
- package/README.md +202 -17
- package/dist/components/Group/Group.d.ts +2 -1
- package/dist/components/Group/Group.stories.d.ts +7 -0
- package/dist/components/Heading/Heading.stories.d.ts +7 -0
- package/dist/components/Inline/Inline.d.ts +2 -1
- package/dist/components/Inline/Inline.stories.d.ts +9 -0
- package/dist/components/List/List.d.ts +2 -1
- package/dist/components/List/List.stories.d.ts +9 -0
- package/dist/components/List/ListItem.d.ts +2 -1
- package/dist/components/Text/Text.d.ts +2 -1
- package/dist/components/Text/Text.stories.d.ts +6 -0
- package/dist/components/atomic/Media/Media.d.ts +2 -1
- package/dist/components/atomic/Media/Media.stories.d.ts +3 -0
- package/dist/components/atomic/Media/index.js +5 -5
- 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/lib/types/allowedTags.d.ts +6 -0
- package/package.json +1 -1
- package/packages/astro/Group/Group.astro +3 -2
- package/packages/astro/Inline/Inline.astro +3 -2
- package/packages/astro/List/List.astro +3 -2
- package/packages/astro/List/ListItem.astro +3 -2
- package/packages/astro/Media/Media.astro +11 -6
- package/packages/astro/Text/Text.astro +3 -2
- package/packages/astro/types/MediaPolymorphic.ts +51 -0
- package/src/scss/base/_html.scss +61 -65
- package/src/scss/base/index.scss +1 -1
- package/src/scss/base/set/_bp.scss +4 -1
- package/src/scss/base/set/_cqUnit.scss +8 -12
- package/src/scss/base/tokens/_shadow.scss +4 -4
- package/src/scss/base/tokens/_tokens.scss +46 -49
- package/src/scss/base/tokens/_typography.scss +39 -46
- package/src/scss/reset.scss +34 -43
- package/src/scss/base/tokens/_property.scss +0 -21
package/README.ja.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# lism-css
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | [日本語](./README.ja.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/lism-css)
|
|
6
|
+
[](https://github.com/lism-css/lism-css/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## lism-css とは?
|
|
9
|
+
|
|
10
|
+
Lism CSS は、WEBサイトのレイアウトを素早く、かつ美しく構築するための軽量な **CSS設計フレームワーク**です。
|
|
11
|
+
|
|
12
|
+
[Every Layout](https://every-layout.dev/) のレイアウトプリミティブ、[Tailwind CSS](https://tailwindcss.com/) のユーティリティファーストアプローチ、[ITCSS](https://www.xfive.co/blog/itcss-scalable-maintainable-css-architecture/) のレイヤリング等に着想を得て、それらを統合して設計されています。
|
|
13
|
+
|
|
14
|
+
ビルドステップや設定は不要です。CDN 経由で CSS ファイルを読み込むか、npm からインポートするだけですぐに使い始められます。
|
|
15
|
+
React / Astro 向けのコンポーネントも提供しており、propsを通じてCSSクラスとカスタムプロパティに変換されるため、ランタイムでのスタイル生成なしにコンポーネントベースの開発が可能です。
|
|
16
|
+
|
|
17
|
+
## 特徴
|
|
18
|
+
|
|
19
|
+
- **軽量** - CSS バンドル全体で約 30 KB(gzip 圧縮時 約 8 KB)と、軽量です。
|
|
20
|
+
- **ゼロビルドフレームワーク** — CSS ファイルを読み込むだけで、プレーン HTML でも動作します。ビルドツール、プリプロセッサ、設定は不要。CDN または npm で利用可能。
|
|
21
|
+
- **レイアウト優先のモジュールアーキテクチャ** — レイアウトモジュール(`l--flex`、`l--stack`、`l--grid`、`l--columns`、`l--center`、`l--sideMain` など)で、カスタム CSS を書かずに一般的なレイアウトパターンを組み立てられます。
|
|
22
|
+
- **CSS レイヤー構造** — `@layer`(lism-reset → lism.base → lism.modules → lism.utility)を使用した明確な詳細度管理。詳細度の衝突を最小限に抑えます。
|
|
23
|
+
- **デザイントークン** — カラー、スペーシング、フォントサイズ、シャドウ、ボーダー半径を CSS カスタムプロパティで管理。変数を上書きするだけで簡単にカスタマイズできます。
|
|
24
|
+
- **柔軟なプロップクラス** — `-{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
|
+
|
|
28
|
+
## インストール
|
|
29
|
+
|
|
30
|
+
### CDN(ビルド不要)
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<link href="https://cdn.jsdelivr.net/npm/lism-css@0/dist/css/main.css" rel="stylesheet" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### npm
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm i lism-css
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
または
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm add lism-css
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## セットアップ
|
|
49
|
+
|
|
50
|
+
グローバルスタイルとして CSS をインポートします:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
import 'lism-css/main.css';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Next.js** の場合は、`layout.js`(App Router)または `_app.js`(Pages Router)で読み込みます。
|
|
57
|
+
|
|
58
|
+
**Astro** の場合は、`node_modules` から `.astro` コンポーネントをインポートできるよう、`astro.config.js` に以下を追加します:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
export default defineConfig({
|
|
62
|
+
vite: {
|
|
63
|
+
ssr: {
|
|
64
|
+
noExternal: ['lism-css'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 使い方
|
|
71
|
+
|
|
72
|
+
### React
|
|
73
|
+
|
|
74
|
+
```jsx
|
|
75
|
+
import { Box, Flex, Stack, Grid, Text, Heading } from 'lism-css/react';
|
|
76
|
+
|
|
77
|
+
<Stack g="20">
|
|
78
|
+
<Heading tag="h2" fz="xl">Welcome</Heading>
|
|
79
|
+
<Flex g="20" ai="center">
|
|
80
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
81
|
+
<Text fz="l">Card A</Text>
|
|
82
|
+
</Box>
|
|
83
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
84
|
+
<Text fz="l">Card B</Text>
|
|
85
|
+
</Box>
|
|
86
|
+
</Flex>
|
|
87
|
+
</Stack>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Astro
|
|
91
|
+
|
|
92
|
+
```astro
|
|
93
|
+
---
|
|
94
|
+
import { Box, Flex, Stack, Text, Heading } from 'lism-css/astro';
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
<Stack g="20">
|
|
98
|
+
<Heading tag="h2" fz="xl">Welcome</Heading>
|
|
99
|
+
<Flex g="20" ai="center">
|
|
100
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
101
|
+
<Text fz="l">Card A</Text>
|
|
102
|
+
</Box>
|
|
103
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
104
|
+
<Text fz="l">Card B</Text>
|
|
105
|
+
</Box>
|
|
106
|
+
</Flex>
|
|
107
|
+
</Stack>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### HTML(CSS のみ)
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<div class="l--stack -g:20">
|
|
114
|
+
<h2 class="-fz:xl">Welcome</h2>
|
|
115
|
+
<div class="l--flex -g:20 -ai:center">
|
|
116
|
+
<div class="-p:20 -bgc:base-2 -bdrs:20">
|
|
117
|
+
<p class="-fz:l">Card A</p>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="-p:20 -bgc:base-2 -bdrs:20">
|
|
120
|
+
<p class="-fz:l">Card B</p>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## コアコンポーネント
|
|
127
|
+
|
|
128
|
+
Lism CSS は以下の React / Astro コンポーネントを提供します:
|
|
129
|
+
|
|
130
|
+
**レイアウトコンポーネント:**
|
|
131
|
+
Lism, Box, Flow, Flex, Cluster, Stack, Grid, FluidCols, SwitchCols, SideMain, Center, Columns, Frame
|
|
132
|
+
|
|
133
|
+
**構造コンポーネント:**
|
|
134
|
+
Container, Wrapper, Layer, LinkBox
|
|
135
|
+
|
|
136
|
+
**コンテンツコンポーネント:**
|
|
137
|
+
Text, Heading, Inline, Link, Group, List
|
|
138
|
+
|
|
139
|
+
**アトミックコンポーネント:**
|
|
140
|
+
Icon, Media, Decorator, Divider, Spacer
|
|
141
|
+
|
|
142
|
+
すべてのコンポーネントは Lism props(例: `p`、`m`、`g`、`fz`、`bgc`、`bdrs`)を受け取り、CSS クラスと変数に自動的にマッピングされます。
|
|
143
|
+
|
|
144
|
+
## CSS クラスシステム
|
|
145
|
+
|
|
146
|
+
Lism CSS は構造化された命名規則を CSS クラスに使用しています:
|
|
147
|
+
|
|
148
|
+
| タイプ | パターン | 例 |
|
|
149
|
+
|--------|---------|-----|
|
|
150
|
+
| レイアウトモジュール | `l--{name}` | `l--flex`, `l--grid`, `l--stack`, `l--center`, `l--columns`, `l--sideMain` |
|
|
151
|
+
| ステートモジュール | `is--{name}` | `is--wrapper`, `is--container`, `is--layer` |
|
|
152
|
+
| プロップクラス | `-{prop}:{value}` | `-p:20`, `-m:auto`, `-bgc:base-2`, `-fz:l`, `-ta:center` |
|
|
153
|
+
| ブレークポイント | `-{prop}_{bp}` | `-p_sm`, `-g_md`, `-fz_lg` |
|
|
154
|
+
| ユーティリティクラス | `u--{name}` | `u--cbox` |
|
|
155
|
+
|
|
156
|
+
## レスポンシブシステム
|
|
157
|
+
|
|
158
|
+
レスポンシブ値は、ブレークポイント固有のクラスと CSS 変数を使って設定します:
|
|
159
|
+
|
|
160
|
+
**HTML:**
|
|
161
|
+
|
|
162
|
+
```html
|
|
163
|
+
<div class="-p:20 -p_sm -p_md" style="--p_sm:var(--s30);--p_md:var(--s40)">
|
|
164
|
+
<p>sm (480px) と md (800px) のブレークポイントでパディングが変化</p>
|
|
165
|
+
</div>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**JSX (React / Astro):**
|
|
169
|
+
|
|
170
|
+
```jsx
|
|
171
|
+
<Lism p={['20', '30', '40']}>
|
|
172
|
+
<p>sm (480px) と md (800px) のブレークポイントでパディングが変化</p>
|
|
173
|
+
</Lism>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
デフォルトブレークポイント: `sm` = 480px、`md` = 800px、`lg` = 1120px(デフォルトでコンテナクエリを使用)。
|
|
177
|
+
|
|
178
|
+
## デザイントークン
|
|
179
|
+
|
|
180
|
+
Lism CSS は一貫したデザインのための CSS カスタムプロパティを提供します:
|
|
181
|
+
|
|
182
|
+
- **カラー:** `--base`、`--base-2`、`--text`、`--text-2`、`--link`、`--divider`、`--brand`、`--accent`、パレットカラー(`--red`、`--blue`、`--green` など)
|
|
183
|
+
- **スペーシング:** `--s10` 〜 `--s50`(rem 値にマッピング)
|
|
184
|
+
- **フォントサイズ:** `--fz--xs` 〜 `--fz--2xl`
|
|
185
|
+
- **ボーダー半径:** `--bdrs--5`(2px)〜 `--bdrs--99`(99rem)
|
|
186
|
+
- **シャドウ:** `--shsz--5` 〜 `--shsz--50`(シャドウカラー設定可能)
|
|
187
|
+
- **コンテナサイズ:** `--sz--xs`(32rem)〜 `--sz--xl`(1600px)
|
|
188
|
+
|
|
189
|
+
## UI コンポーネント
|
|
190
|
+
|
|
191
|
+
インタラクティブな UI コンポーネント(Accordion、Modal、Tabs、Alert、Avatar、Badge、Button など)については、別パッケージの [@lism-css/ui](https://www.npmjs.com/package/@lism-css/ui) を参照してください。
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm i @lism-css/ui
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## AI ツール連携
|
|
198
|
+
|
|
199
|
+
### llms.txt
|
|
200
|
+
|
|
201
|
+
AI アシスタントや LLM ベースのツール向けに、機械可読なドキュメントインデックスを提供しています:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
https://lism-css.com/llms.txt
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### MCP サーバー
|
|
208
|
+
|
|
209
|
+
AI コーディングツール向けの MCP(Model Context Protocol)サーバーが利用可能です:
|
|
210
|
+
|
|
211
|
+
**Claude Code:**
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
claude mcp add lism-css -- npx -y @lism-css/mcp
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Cursor:**
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
// .cursor/mcp.json
|
|
221
|
+
{
|
|
222
|
+
"mcpServers": {
|
|
223
|
+
"lism-css": {
|
|
224
|
+
"command": "npx",
|
|
225
|
+
"args": ["-y", "@lism-css/mcp"]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**VS Code (GitHub Copilot):**
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
// .vscode/mcp.json
|
|
235
|
+
{
|
|
236
|
+
"servers": {
|
|
237
|
+
"lism-css": {
|
|
238
|
+
"type": "stdio",
|
|
239
|
+
"command": "npx",
|
|
240
|
+
"args": ["-y", "@lism-css/mcp"]
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## ドキュメント
|
|
247
|
+
|
|
248
|
+
詳細なドキュメントは [lism-css.com](https://lism-css.com) をご覧ください。
|
|
249
|
+
|
|
250
|
+
## コミュニティ
|
|
251
|
+
|
|
252
|
+
フィードバックや質問は、[Lism CSS Discord サーバー](https://discord.gg/6PMcFHvc4h)までお気軽にどうぞ。
|
|
253
|
+
|
|
254
|
+
## クレジット
|
|
255
|
+
|
|
256
|
+
- [Phosphor Icons](https://phosphoricons.com/) — MIT License ([source](https://github.com/phosphor-icons))
|
|
257
|
+
|
|
258
|
+
## ライセンス
|
|
259
|
+
|
|
260
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# lism-css
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Provides CSS utilities, design tokens, and React / Astro layout components.
|
|
3
|
+
[English](./README.md) | [日本語](./README.ja.md)
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/lism-css)
|
|
6
|
+
[](https://github.com/lism-css/lism-css/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## What is lism-css?
|
|
9
|
+
|
|
10
|
+
Lism CSS is a lightweight **CSS design framework** for quickly and beautifully building website layouts.
|
|
11
|
+
|
|
12
|
+
Inspired by [Every Layout](https://every-layout.dev/)'s layout primitives, [Tailwind CSS](https://tailwindcss.com/)'s utility-first approach, and [ITCSS](https://www.xfive.co/blog/itcss-scalable-maintainable-css-architecture/)'s layering concept, Lism CSS integrates these ideas into a cohesive architecture.
|
|
13
|
+
|
|
14
|
+
No build step or configuration is required. Simply load the CSS file via CDN or import it from npm to get started. It also provides React and Astro components whose props are converted into CSS classes and custom properties, enabling component-based development without runtime style generation.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **Lightweight** — The entire CSS bundle is approximately 30 KB (~8 KB gzipped).
|
|
19
|
+
- **Zero-Build Framework** — Works with plain HTML by simply loading a CSS file. No build tool, preprocessor, or configuration needed. Available via CDN or npm.
|
|
20
|
+
- **Layout-First Module Architecture** — Pre-built layout modules (`l--flex`, `l--stack`, `l--grid`, `l--columns`, `l--center`, `l--sideMain`, etc.) let you compose common layout patterns without writing custom CSS.
|
|
21
|
+
- **CSS Layer Structure** — Uses `@layer` (lism-reset → lism.base → lism.modules → lism.utility) for clear specificity management. Minimizes specificity conflicts.
|
|
22
|
+
- **Design Tokens** — Colors, spacing, font sizes, shadows, and border radii are managed as CSS custom properties. Easy to customize by overriding variables.
|
|
23
|
+
- **Flexible Prop Classes** — A `-{prop}:{value}` naming convention (e.g., `-p:20`, `-bgc:base-2`, `-fz:l`) maps CSS properties to utility classes for quick, readable styling.
|
|
24
|
+
- **Responsive System** — Breakpoint-specific classes and CSS variables (e.g., `-p_sm`, `-p_md`) use container queries by default for parent-based responsive design. Switchable to media queries.
|
|
25
|
+
- **React & Astro Components** — Dedicated components for both React and Astro translate props into Lism CSS classes and variables automatically. Write `<Stack g="20">` instead of `class="l--stack -g:20"`.
|
|
7
26
|
|
|
8
27
|
## Installation
|
|
9
28
|
|
|
29
|
+
### CDN (no build required)
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<link href="https://cdn.jsdelivr.net/npm/lism-css@0/dist/css/main.css" rel="stylesheet" />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### npm
|
|
36
|
+
|
|
10
37
|
```bash
|
|
11
38
|
npm i lism-css
|
|
12
39
|
```
|
|
@@ -19,18 +46,24 @@ pnpm add lism-css
|
|
|
19
46
|
|
|
20
47
|
## Setup
|
|
21
48
|
|
|
22
|
-
Import CSS as a global style
|
|
49
|
+
Import the CSS as a global style:
|
|
23
50
|
|
|
24
51
|
```js
|
|
25
52
|
import 'lism-css/main.css';
|
|
26
53
|
```
|
|
27
54
|
|
|
28
|
-
For Next.js
|
|
55
|
+
For **Next.js**, load it in `layout.js` (App Router) or `_app.js` (Pages Router).
|
|
29
56
|
|
|
30
|
-
For
|
|
57
|
+
For **Astro**, add the following to `astro.config.js` to allow importing `.astro` components from `node_modules`:
|
|
31
58
|
|
|
32
|
-
```
|
|
33
|
-
|
|
59
|
+
```js
|
|
60
|
+
export default defineConfig({
|
|
61
|
+
vite: {
|
|
62
|
+
ssr: {
|
|
63
|
+
noExternal: ['lism-css'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
34
67
|
```
|
|
35
68
|
|
|
36
69
|
## Usage
|
|
@@ -38,12 +71,18 @@ For HTML sites, you can load CSS via CDN:
|
|
|
38
71
|
### React
|
|
39
72
|
|
|
40
73
|
```jsx
|
|
41
|
-
import { Box, Flex, Stack, Text } from 'lism-css/react';
|
|
74
|
+
import { Box, Flex, Stack, Grid, Text, Heading } from 'lism-css/react';
|
|
42
75
|
|
|
43
76
|
<Stack g="20">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
77
|
+
<Heading tag="h2" fz="xl">Welcome</Heading>
|
|
78
|
+
<Flex g="20" ai="center">
|
|
79
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
80
|
+
<Text fz="l">Card A</Text>
|
|
81
|
+
</Box>
|
|
82
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
83
|
+
<Text fz="l">Card B</Text>
|
|
84
|
+
</Box>
|
|
85
|
+
</Flex>
|
|
47
86
|
</Stack>
|
|
48
87
|
```
|
|
49
88
|
|
|
@@ -51,19 +90,165 @@ import { Box, Flex, Stack, Text } from 'lism-css/react';
|
|
|
51
90
|
|
|
52
91
|
```astro
|
|
53
92
|
---
|
|
54
|
-
import { Box, Flex, Stack, Text } from 'lism-css/astro';
|
|
93
|
+
import { Box, Flex, Stack, Text, Heading } from 'lism-css/astro';
|
|
55
94
|
---
|
|
56
95
|
|
|
57
96
|
<Stack g="20">
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
97
|
+
<Heading tag="h2" fz="xl">Welcome</Heading>
|
|
98
|
+
<Flex g="20" ai="center">
|
|
99
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
100
|
+
<Text fz="l">Card A</Text>
|
|
101
|
+
</Box>
|
|
102
|
+
<Box p="20" bgc="base-2" bdrs="20">
|
|
103
|
+
<Text fz="l">Card B</Text>
|
|
104
|
+
</Box>
|
|
105
|
+
</Flex>
|
|
61
106
|
</Stack>
|
|
62
107
|
```
|
|
63
108
|
|
|
109
|
+
### HTML (CSS-only)
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<div class="l--stack -g:20">
|
|
113
|
+
<h2 class="-fz:xl">Welcome</h2>
|
|
114
|
+
<div class="l--flex -g:20 -ai:center">
|
|
115
|
+
<div class="-p:20 -bgc:base-2 -bdrs:20">
|
|
116
|
+
<p class="-fz:l">Card A</p>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="-p:20 -bgc:base-2 -bdrs:20">
|
|
119
|
+
<p class="-fz:l">Card B</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Core Components
|
|
126
|
+
|
|
127
|
+
Lism CSS provides the following React and Astro components:
|
|
128
|
+
|
|
129
|
+
**Layout Components:**
|
|
130
|
+
Lism, Box, Flow, Flex, Cluster, Stack, Grid, FluidCols, SwitchCols, SideMain, Center, Columns, Frame
|
|
131
|
+
|
|
132
|
+
**Structure Components:**
|
|
133
|
+
Container, Wrapper, Layer, LinkBox
|
|
134
|
+
|
|
135
|
+
**Content Components:**
|
|
136
|
+
Text, Heading, Inline, Link, Group, List
|
|
137
|
+
|
|
138
|
+
**Atomic Components:**
|
|
139
|
+
Icon, Media, Decorator, Divider, Spacer
|
|
140
|
+
|
|
141
|
+
All components accept Lism props (e.g., `p`, `m`, `g`, `fz`, `bgc`, `bdrs`) that automatically map to CSS classes and variables.
|
|
142
|
+
|
|
143
|
+
## CSS Class System
|
|
144
|
+
|
|
145
|
+
Lism CSS uses a structured naming convention for CSS classes:
|
|
146
|
+
|
|
147
|
+
| Type | Pattern | Examples |
|
|
148
|
+
|------|---------|----------|
|
|
149
|
+
| Layout Module | `l--{name}` | `l--flex`, `l--grid`, `l--stack`, `l--center`, `l--columns`, `l--sideMain` |
|
|
150
|
+
| State Module | `is--{name}` | `is--wrapper`, `is--container`, `is--layer` |
|
|
151
|
+
| Prop Class | `-{prop}:{value}` | `-p:20`, `-m:auto`, `-bgc:base-2`, `-fz:l`, `-ta:center` |
|
|
152
|
+
| Breakpoint | `-{prop}_{bp}` | `-p_sm`, `-g_md`, `-fz_lg` |
|
|
153
|
+
| Utility Class | `u--{name}` | `u--cbox` |
|
|
154
|
+
|
|
155
|
+
## Responsive System
|
|
156
|
+
|
|
157
|
+
Responsive values are set using breakpoint-specific classes and CSS variables:
|
|
158
|
+
|
|
159
|
+
**HTML:**
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<div class="-p:20 -p_sm -p_md" style="--p_sm:var(--s30);--p_md:var(--s40)">
|
|
163
|
+
<p>Padding changes at sm (480px) and md (800px) breakpoints</p>
|
|
164
|
+
</div>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**JSX (React / Astro):**
|
|
168
|
+
|
|
169
|
+
```jsx
|
|
170
|
+
<Lism p={['20', '30', '40']}>
|
|
171
|
+
<p>Padding changes at sm (480px) and md (800px) breakpoints</p>
|
|
172
|
+
</Lism>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Default breakpoints: `sm` = 480px, `md` = 800px, `lg` = 1120px (container queries by default).
|
|
176
|
+
|
|
177
|
+
## Design Tokens
|
|
178
|
+
|
|
179
|
+
Lism CSS provides CSS custom properties for consistent design:
|
|
180
|
+
|
|
181
|
+
- **Colors:** `--base`, `--base-2`, `--text`, `--text-2`, `--link`, `--divider`, `--brand`, `--accent`, plus palette colors (`--red`, `--blue`, `--green`, etc.)
|
|
182
|
+
- **Spacing:** `--s10` through `--s50` (mapped to rem values)
|
|
183
|
+
- **Font Sizes:** `--fz--xs` through `--fz--2xl`
|
|
184
|
+
- **Border Radius:** `--bdrs--5` (2px) through `--bdrs--99` (99rem)
|
|
185
|
+
- **Shadows:** `--shsz--5` through `--shsz--50` with configurable shadow colors
|
|
186
|
+
- **Container Sizes:** `--sz--xs` (32rem) through `--sz--xl` (1600px)
|
|
187
|
+
|
|
64
188
|
## UI Components
|
|
65
189
|
|
|
66
|
-
For interactive UI components (Accordion, Modal, Tabs, etc.), see [@lism-css/ui](https://www.npmjs.com/package/@lism-css/ui).
|
|
190
|
+
For interactive UI components (Accordion, Modal, Tabs, Alert, Avatar, Badge, Button, etc.), see the separate package [@lism-css/ui](https://www.npmjs.com/package/@lism-css/ui).
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npm i @lism-css/ui
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## AI Tool Integration
|
|
197
|
+
|
|
198
|
+
### llms.txt
|
|
199
|
+
|
|
200
|
+
For AI assistants and LLM-powered tools, a machine-readable documentation index is available:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
https://lism-css.com/llms.txt
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### MCP Server
|
|
207
|
+
|
|
208
|
+
An MCP (Model Context Protocol) server is available for AI coding tools:
|
|
209
|
+
|
|
210
|
+
**Claude Code:**
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
claude mcp add lism-css -- npx -y @lism-css/mcp
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Cursor:**
|
|
217
|
+
|
|
218
|
+
```json
|
|
219
|
+
// .cursor/mcp.json
|
|
220
|
+
{
|
|
221
|
+
"mcpServers": {
|
|
222
|
+
"lism-css": {
|
|
223
|
+
"command": "npx",
|
|
224
|
+
"args": ["-y", "@lism-css/mcp"]
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**VS Code (GitHub Copilot):**
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
// .vscode/mcp.json
|
|
234
|
+
{
|
|
235
|
+
"servers": {
|
|
236
|
+
"lism-css": {
|
|
237
|
+
"type": "stdio",
|
|
238
|
+
"command": "npx",
|
|
239
|
+
"args": ["-y", "@lism-css/mcp"]
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Documentation
|
|
246
|
+
|
|
247
|
+
For full documentation, visit [lism-css.com](https://lism-css.com).
|
|
248
|
+
|
|
249
|
+
## Community
|
|
250
|
+
|
|
251
|
+
For feedback or questions, [join the Lism CSS Discord server](https://discord.gg/6PMcFHvc4h).
|
|
67
252
|
|
|
68
253
|
## Credits
|
|
69
254
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
3
|
+
import { GroupAllowedTag } from '../../lib/types/allowedTags';
|
|
4
|
+
export default function Group<T extends GroupAllowedTag | Exclude<ElementType, string> = 'div'>({ as, ...props }: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Group } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Group>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Group>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AsSection: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Heading } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Heading>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Heading>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AllLevels: Story;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
3
|
+
import { InlineAllowedTag } from '../../lib/types/allowedTags';
|
|
4
|
+
export default function Inline<T extends InlineAllowedTag | Exclude<ElementType, string> = 'span'>({ as, ...props }: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Inline } from './index';
|
|
3
|
+
declare const meta: Meta<typeof Inline>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Inline>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AsEm: Story;
|
|
8
|
+
export declare const AsCode: Story;
|
|
9
|
+
export declare const AsTime: Story;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
3
|
+
import { ListAllowedTag } from '../../lib/types/allowedTags';
|
|
4
|
+
export default function List<T extends ListAllowedTag | Exclude<ElementType, string> = 'ul'>({ as, ...props }: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { List } from './index';
|
|
3
|
+
declare const meta: Meta<typeof List>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof List>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AsOl: Story;
|
|
8
|
+
export declare const AsDl: Story;
|
|
9
|
+
export declare const AsDlWithDiv: Story;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
3
|
+
import { ListItemAllowedTag } from '../../lib/types/allowedTags';
|
|
4
|
+
export default function ListItem<T extends ListItemAllowedTag | Exclude<ElementType, string> = 'li'>({ as, ...props }: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../Lism';
|
|
3
|
-
|
|
3
|
+
import { TextAllowedTag } from '../../lib/types/allowedTags';
|
|
4
|
+
export default function Text<T extends TextAllowedTag | Exclude<ElementType, string> = 'p'>({ as, ...props }: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { LismComponentProps } from '../../Lism';
|
|
3
|
-
|
|
3
|
+
import { MediaAllowedTag } from '../../../lib/types/allowedTags';
|
|
4
|
+
export default function Media<T extends MediaAllowedTag | Exclude<ElementType, string> = 'img'>({ as, ...props }: LismComponentProps<T>): import("react").JSX.Element;
|
|
@@ -6,3 +6,6 @@ export declare const Default: Story;
|
|
|
6
6
|
export declare const WithObjectFitCover: Story;
|
|
7
7
|
export declare const WithObjectFitContain: Story;
|
|
8
8
|
export declare const WithObjectPosition: Story;
|
|
9
|
+
export declare const WithVideo: Story;
|
|
10
|
+
export declare const WithIframe: Story;
|
|
11
|
+
export declare const WithPicture: Story;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../Lism/index.js";
|
|
3
|
+
function e({ as: r, ...i }) {
|
|
4
|
+
return /* @__PURE__ */ m(o, { as: r ?? "img", ...i });
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as default
|
|
8
8
|
};
|
package/dist/css/base/set.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.set--cqUnit{--REM:var(--REM--cq);font-size:var(--REM
|
|
1
|
+
.set--cqUnit{--REM:var(--REM--cq);font-size:var(--REM);--hl-unit:calc(var(--REM)*0.125);--hl--xs:var(--hl-unit);--hl--s:calc(var(--hl-unit)*2);--hl--base:calc(var(--hl-unit)*3);--hl--l:calc(var(--hl-unit)*4);--s-unit:calc(var(--REM)*0.5);--s5:calc(var(--s-unit)*0.5);--s10:var(--s-unit);--s15:calc(var(--s-unit)*1.5);--s20:calc(var(--s-unit)*2);--s30:calc(var(--s-unit)*3);--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)}:root{--_is_sm:unset;--_is_md:unset}@container (min-width: 480px){.set--bp{--_is_sm: }}@container (min-width: 800px){.set--bp{--_is_md: }}@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--transition{transition:var(--hov-duration,.25s) var(--hov-ease,linear) var(--hov-delay,0s);transition-property:var(--hov-prop,all)}.set--innerRs{--bdrs--inner:calc(var(--bdrs, 0px) - var(--p, 0px))}.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}.set--gutter{padding-inline:var(--gutter-size)}
|