@lism-css/mcp 0.22.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 +15 -15
- package/README.md +5 -5
- package/dist/data/docs-index.json +232 -96
- package/dist/data/guides/SKILL.md +162 -224
- package/dist/data/guides/antipatterns-layout.md +268 -0
- package/dist/data/guides/antipatterns.md +118 -196
- package/dist/data/guides/base-styles.md +14 -12
- package/dist/data/guides/components-core.md +26 -8
- package/dist/data/guides/components-ui.md +28 -24
- package/dist/data/guides/css-rules.md +40 -57
- package/dist/data/guides/customize.md +121 -37
- package/dist/data/guides/naming.md +23 -42
- package/dist/data/guides/primitive-class.md +5 -5
- package/dist/data/guides/primitives/a--decorator.md +2 -28
- package/dist/data/guides/primitives/a--divider.md +1 -52
- package/dist/data/guides/primitives/a--icon.md +2 -76
- package/dist/data/guides/primitives/a--spacer.md +1 -49
- package/dist/data/guides/primitives/l--autoColumns.md +7 -54
- package/dist/data/guides/primitives/l--box.md +1 -21
- package/dist/data/guides/primitives/l--center.md +6 -39
- package/dist/data/guides/primitives/l--cluster.md +6 -26
- package/dist/data/guides/primitives/l--columns.md +7 -56
- package/dist/data/guides/primitives/l--flex.md +5 -62
- package/dist/data/guides/primitives/l--flow.md +11 -72
- package/dist/data/guides/primitives/l--frame.md +7 -78
- package/dist/data/guides/primitives/l--grid.md +5 -56
- package/dist/data/guides/primitives/l--stack.md +5 -44
- package/dist/data/guides/primitives/l--switchColumns.md +8 -53
- package/dist/data/guides/primitives/l--tileGrid.md +7 -44
- package/dist/data/guides/primitives/l--withSide.md +9 -79
- package/dist/data/guides/property-class/all-props.md +244 -0
- package/dist/data/guides/property-class/bd.md +5 -70
- package/dist/data/guides/property-class/hov.md +14 -73
- package/dist/data/guides/property-class/max-sz.md +3 -39
- package/dist/data/guides/property-class.md +31 -249
- package/dist/data/guides/references/authoring.md +246 -0
- package/dist/data/guides/references/page-sections.md +99 -0
- package/dist/data/guides/references/verification.md +73 -0
- package/dist/data/guides/responsive.md +68 -20
- package/dist/data/guides/set-class.md +2 -12
- package/dist/data/guides/tokens.md +31 -31
- package/dist/data/guides/trait-class/has--gutter.md +3 -31
- package/dist/data/guides/trait-class/has--mask.md +3 -36
- package/dist/data/guides/trait-class/has--snap.md +3 -34
- package/dist/data/guides/trait-class/has--transition.md +3 -41
- package/dist/data/guides/trait-class/is--boxLink.md +2 -63
- package/dist/data/guides/trait-class/is--container.md +2 -29
- package/dist/data/guides/trait-class/is--layer.md +1 -57
- package/dist/data/guides/trait-class/is--wrapper.md +11 -60
- package/dist/data/guides/trait-class.md +8 -8
- package/dist/data/guides/utility-class.md +1 -1
- package/dist/data/meta.js +4 -3
- package/dist/index.js +4 -1
- package/dist/lib/load-markdown.d.ts +4 -0
- package/dist/lib/load-markdown.js +10 -0
- package/dist/lib/markdown-utils.d.ts +1 -1
- package/dist/lib/response.d.ts +5 -0
- package/dist/lib/response.js +15 -2
- package/dist/lib/schemas.d.ts +35 -0
- package/dist/lib/schemas.js +13 -0
- package/dist/lib/search.d.ts +2 -0
- package/dist/lib/search.js +45 -2
- package/dist/lib/types.d.ts +5 -21
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.js +8 -0
- package/dist/tools/convert-css.js +38 -15
- package/dist/tools/get-component.js +2 -2
- package/dist/tools/get-guide.d.ts +2 -0
- package/dist/tools/get-guide.js +40 -17
- package/dist/tools/get-overview.js +2 -2
- package/dist/tools/get-props-system.js +8 -6
- package/dist/tools/get-tokens.js +2 -2
- package/dist/tools/search-docs.js +13 -7
- package/package.json +17 -2
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
`scroll-snap-*` 系のプロパティを CSS 変数経由でセットする Trait クラス。横スクロールカルーセルなどで子要素のスナップ位置を制御したい時に使う。
|
|
4
4
|
|
|
5
|
-
## 基本情報
|
|
6
|
-
|
|
7
|
-
- クラス名: `has--snap`
|
|
8
5
|
- Lism props: `hasSnap`(`<Lism hasSnap>` 等)
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
|
|
7
|
+
公式ドキュメント(使い方・コード例): https://lism-css.com/docs/trait-class.md#has--snap
|
|
11
8
|
|
|
12
9
|
## SCSS 定義
|
|
13
10
|
|
|
@@ -30,39 +27,11 @@
|
|
|
30
27
|
## CSS 変数
|
|
31
28
|
|
|
32
29
|
| 変数 | 役割 | デフォルト |
|
|
33
|
-
|
|
30
|
+
| --- | --- | --- |
|
|
34
31
|
| `--snapType` | `scroll-snap-type` | `both mandatory` |
|
|
35
32
|
| `--snapAlign` | 子要素の `scroll-snap-align` | `start` |
|
|
36
33
|
| `--snapStop` | 子要素の `scroll-snap-stop` | `normal` |
|
|
37
34
|
|
|
38
|
-
## Usage
|
|
39
|
-
|
|
40
|
-
`ov="auto"`(または `overflow: auto`)と一緒に使い、スクロールコンテナとして成立させる必要がある。
|
|
41
|
-
|
|
42
|
-
```html
|
|
43
|
-
<div class="has--snap -ov:auto -ar:16/9 -bd">
|
|
44
|
-
<div class="l--frame -ar:16/9 -p:15"><img src="..." /></div>
|
|
45
|
-
<div class="l--frame -ar:16/9 -p:15"><img src="..." /></div>
|
|
46
|
-
<div class="l--frame -ar:16/9 -p:15"><img src="..." /></div>
|
|
47
|
-
</div>
|
|
48
|
-
```
|
|
49
|
-
```jsx
|
|
50
|
-
<Box hasSnap ov="auto" ar="16/9" bd>
|
|
51
|
-
<Frame ar="16/9" p="15"><img src="..." /></Frame>
|
|
52
|
-
<Frame ar="16/9" p="15"><img src="..." /></Frame>
|
|
53
|
-
<Frame ar="16/9" p="15"><img src="..." /></Frame>
|
|
54
|
-
</Box>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### スナップ方向を水平だけに限定する例
|
|
58
|
-
|
|
59
|
-
```html
|
|
60
|
-
<div class="has--snap -ov:auto" style="--snapType: x mandatory">...</div>
|
|
61
|
-
```
|
|
62
|
-
```jsx
|
|
63
|
-
<Box hasSnap ov="auto" style={{ '--snapType': 'x mandatory' }}>...</Box>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
35
|
## 関連
|
|
67
36
|
|
|
68
37
|
- `-ov:*` プロパティクラス — スクロールコンテナ化に必須
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
`transition` 系のプロパティを CSS 変数経由でセットする Trait クラス。主に `-hov:*` クラスと組み合わせて、ホバー時のスムーズな変化に使う。
|
|
4
4
|
|
|
5
|
-
## 基本情報
|
|
6
|
-
|
|
7
|
-
- クラス名: `has--transition`
|
|
8
5
|
- Lism props: `hasTransition`(`<Lism hasTransition>` / `<Box hasTransition>` 等)
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
|
|
7
|
+
公式ドキュメント(使い方・コード例): https://lism-css.com/docs/trait-class.md#has--transition
|
|
11
8
|
|
|
12
9
|
## SCSS 定義
|
|
13
10
|
|
|
@@ -25,48 +22,13 @@
|
|
|
25
22
|
## CSS 変数
|
|
26
23
|
|
|
27
24
|
| 変数 | 役割 | デフォルト |
|
|
28
|
-
|
|
25
|
+
| --- | --- | --- |
|
|
29
26
|
| `--transitionProps` | transition 対象プロパティ | `all` |
|
|
30
27
|
| `--duration` | トランジションの長さ | `var(--transition-duration, 0.25s)` |
|
|
31
28
|
| `--ease` | イージング関数 | `ease` |
|
|
32
29
|
| `--delay` | ディレイ | `0s` |
|
|
33
30
|
| `--transition-duration` | 全体のデフォルト duration を `:root` などから上書きするためのグローバル変数 | `0.25s` |
|
|
34
31
|
|
|
35
|
-
## Usage
|
|
36
|
-
|
|
37
|
-
### 基本:`-hov:*` と組み合わせる
|
|
38
|
-
|
|
39
|
-
```html
|
|
40
|
-
<div class="has--transition -hov:-c" style="--transitionProps: color; --hov-c: var(--red);">Example</div>
|
|
41
|
-
```
|
|
42
|
-
```jsx
|
|
43
|
-
<Lism hasTransition hov={{c: 'red'}} style={{ '--transitionProps': 'color'}}>Example</Lism>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### `duration` を個別に上書き
|
|
47
|
-
|
|
48
|
-
```html
|
|
49
|
-
<a class="is--boxLink has--transition -hov:-bdc -bd -p:20" style="--hov-bdc: var(--red); --duration: 0.5s">
|
|
50
|
-
...
|
|
51
|
-
</a>
|
|
52
|
-
```
|
|
53
|
-
```jsx
|
|
54
|
-
<BoxLink href="###" hasTransition hov={{ bdc: 'red' }} bd p="20" style={{ '--duration': '.5s' }}>
|
|
55
|
-
...
|
|
56
|
-
</BoxLink>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### `box-shadow` を変化させる例
|
|
60
|
-
|
|
61
|
-
```html
|
|
62
|
-
<a href="###" class="is--boxLink has--transition -bxsh:10 -hov:-bxsh -bd -p:20" style="--hov-bxsh: var(--bxsh--40)">
|
|
63
|
-
...
|
|
64
|
-
</a>
|
|
65
|
-
```
|
|
66
|
-
```jsx
|
|
67
|
-
<BoxLink href="###" hasTransition bxsh="10" hov={{ bxsh: '40' }} bd p="20">...</BoxLink>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
32
|
## 関連
|
|
71
33
|
|
|
72
34
|
- [`-hov:*` プロパティクラス](../property-class.md) — ホバー時の変化を定義
|
|
@@ -2,77 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
ボックス全体をクリック可能なリンク領域にするクラス。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- クラス名: `is--boxLink`
|
|
8
|
-
- コンポーネント: `<BoxLink>`
|
|
9
|
-
- SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/is/_boxLink.scss
|
|
10
|
-
- 公式ドキュメント: https://lism-css.com/docs/trait-class/is--boxLink.md
|
|
5
|
+
公式ドキュメント(使い方・コード例): https://lism-css.com/docs/trait-class/is--boxLink.md
|
|
11
6
|
|
|
12
7
|
## 専用Props
|
|
13
8
|
|
|
14
9
|
| Prop | 説明 |
|
|
15
|
-
|
|
10
|
+
| --- | --- |
|
|
16
11
|
| `href` | リンク先を指定。`href` があれば `<BoxLink>` 自体が `<a>` タグに、なければ `<div>` として出力される(**特殊挙動**) |
|
|
17
12
|
|
|
18
13
|
通常の `<Lism>` エイリアスコンポーネントと異なり、`<BoxLink>` だけは `href` 指定の有無で出力タグが動的に切り替わります。
|
|
19
14
|
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
BoxLink には主に2通りの使い方があります。
|
|
23
|
-
|
|
24
|
-
### パターン1: `<BoxLink>` 自身を `<a>` にする
|
|
25
|
-
|
|
26
|
-
`href` を指定すると `<BoxLink>` 自体が `<a>` タグとして出力されます。シンプルなカード全体リンクに最適。
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
29
|
-
<BoxLink href="/article/1" p="30" bgc="base" bd bdrs="30" hov="-o">
|
|
30
|
-
<Group fz="xl" fw="bold">Heading text</Group>
|
|
31
|
-
<Text lh="s" mbs="15">記事の抜粋テキスト...</Text>
|
|
32
|
-
<Group fz="s" c="text-2" ta="right" lh="1" mbs="10">
|
|
33
|
-
MORE →
|
|
34
|
-
</Group>
|
|
35
|
-
</BoxLink>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
```html
|
|
39
|
-
<a class="is--boxLink -hov:-o -p:30 -bgc:base -bd -bdrs:30" href="/article/1">
|
|
40
|
-
<p class="-fz:xl -fw:bold">Heading text</p>
|
|
41
|
-
<p class="-c:text-2 -lh:s -mbs:15">記事の抜粋テキスト...</p>
|
|
42
|
-
<p class="-fz:s -c:text-2 -ta:right -lh:1 -mbs:10">MORE →</p>
|
|
43
|
-
</a>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### パターン2: `<div>` + 内部に `is--coverLink`
|
|
47
|
-
|
|
48
|
-
`<BoxLink>` は `<div>` にしたまま、内部のアンカー要素に `is--coverLink` クラスを付けてボックス全体をクリック可能にします。**BoxLink 内部にさらに別のリンクを配置したい場合はこちらを選ぶこと**。
|
|
49
|
-
|
|
50
|
-
```jsx
|
|
51
|
-
<BoxLink as="section" p="30" bgc="base" bd bdrs="30" hasTransition hov="-bxsh">
|
|
52
|
-
<Group fz="xl" fw="bold">
|
|
53
|
-
<Link isCoverLink href="/article/1">
|
|
54
|
-
Heading link text
|
|
55
|
-
</Link>
|
|
56
|
-
</Group>
|
|
57
|
-
<Text c="text-2" lh="s" mbs="15">記事の抜粋テキスト...</Text>
|
|
58
|
-
<Group mbs="10">
|
|
59
|
-
<a href="/tag/foo" className="-hov:-o">Inner Link</a>
|
|
60
|
-
</Group>
|
|
61
|
-
</BoxLink>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
```html
|
|
65
|
-
<div class="is--boxLink -hov:-bxsh -p:30 -bgc:base -bd -bdrs:30 has--transition">
|
|
66
|
-
<div class="-fz:xl -fw:bold">
|
|
67
|
-
<a class="is--coverLink" href="/article/1">Heading link text</a>
|
|
68
|
-
</div>
|
|
69
|
-
<p class="-c:text-2 -lh:s -mbs:15">記事の抜粋テキスト...</p>
|
|
70
|
-
<div class="-mbs:10">
|
|
71
|
-
<a href="/tag/foo" class="-hov:-o">Inner Link</a>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
15
|
## Opt-in スタイル
|
|
77
16
|
|
|
78
17
|
### Tabキーフォーカス時のアウトラインをボックス全体に広げる
|
|
@@ -2,43 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
`container-type` を宣言してコンテナクエリを有効にするクラス。レスポンシブ Property Class(`p={['10', '30']}` のような配列指定)を使うとき、基準要素として必要になります。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- クラス名: `is--container`
|
|
8
|
-
- コンポーネント: `<Container>`
|
|
9
|
-
- SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/is/_container.scss
|
|
10
|
-
- 公式ドキュメント: https://lism-css.com/docs/trait-class/is--container.md
|
|
5
|
+
公式ドキュメント(使い方・コード例): https://lism-css.com/docs/trait-class/is--container.md
|
|
11
6
|
|
|
12
7
|
## 使い方
|
|
13
8
|
|
|
14
9
|
`<Container>` は `<Lism isContainer>` のエイリアスです。`isContainer` Prop は他のコンポーネントにも使用できます(例: `<Flow isContainer>`)。
|
|
15
10
|
|
|
16
11
|
| Prop | 出力 |
|
|
17
|
-
|
|
12
|
+
| --- | --- |
|
|
18
13
|
| `isContainer` | `is--container` |
|
|
19
14
|
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
### 使用例
|
|
23
|
-
|
|
24
|
-
```jsx
|
|
25
|
-
<Container isWrapper="s" p="20">
|
|
26
|
-
<Box bd p={['10', '30']}>
|
|
27
|
-
このBOXは、padding が切り替わります
|
|
28
|
-
</Box>
|
|
29
|
-
</Container>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```html
|
|
33
|
-
<div class="is--container is--wrapper -contentSize:s -p:20">
|
|
34
|
-
<div class="l--box -bd -p:10 -p_sm" style="--p_sm: var(--s30)">
|
|
35
|
-
このBOXは、padding が切り替わります
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
子要素側は `p={['10', '30']}` のようなブレイクポイント配列指定にすることで、親の `is--container` を基準としたコンテナクエリで値が切り替わります。
|
|
41
|
-
|
|
42
15
|
## `--sz--bleed` の提供
|
|
43
16
|
|
|
44
17
|
最外側の `is--container` は直下の子要素に `--sz--bleed: 100cqi` をセットします。`-max-sz:bleed` はこの値を参照しており、最外側の `is--container` 基準の幅まで広がります(ネストされた `is--container` は `--sz--bleed` を再上書きしないため、内側の子要素は外側の値を inherit で参照します)。
|
|
@@ -2,68 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
`position: absolute` で親要素の上に被せて配置するオーバーレイ用クラス。親には `pos="relative"` が必要です。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- クラス名: `is--layer`
|
|
8
|
-
- コンポーネント: `<Layer>`
|
|
9
|
-
- SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/is/_layer.scss
|
|
10
|
-
- 公式ドキュメント: https://lism-css.com/docs/trait-class/is--layer.md
|
|
5
|
+
公式ドキュメント(使い方・コード例): https://lism-css.com/docs/trait-class/is--layer.md
|
|
11
6
|
|
|
12
7
|
## 使い方
|
|
13
8
|
|
|
14
9
|
`<Layer>` は `<Lism isLayer>` のエイリアスです。他コンポーネントにも `isLayer` Prop で付与できます(例: `<Frame isLayer>`)。
|
|
15
10
|
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
### 基本的な使い方
|
|
19
|
-
|
|
20
|
-
親要素に `pos="relative"` を指定し、子に `<Layer>` を置くことで上に重なるオーバーレイになります。
|
|
21
|
-
|
|
22
|
-
```jsx
|
|
23
|
-
<Box pos="relative" py="40">
|
|
24
|
-
<Text fz="2xl" fw="bold" ta="center">BACKGROUND</Text>
|
|
25
|
-
<Layer p="15" bgc="purple:10%">
|
|
26
|
-
<p>Layer Contents...</p>
|
|
27
|
-
</Layer>
|
|
28
|
-
</Box>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<div class="l--box -pos:relative -py:40">
|
|
33
|
-
<p class="-fz:2xl -fw:bold -ta:center">BACKGROUND</p>
|
|
34
|
-
<div class="is--layer -p:15 -bgc" style="--bgc: color-mix(in srgb, var(--purple) 10%, transparent)">
|
|
35
|
-
<p>Layer Contents...</p>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### backdrop-filter の活用
|
|
41
|
-
|
|
42
|
-
`style` プロパティで `backdropFilter` を直接指定すると、背景をブラー・セピアなどの効果で加工できます。
|
|
43
|
-
|
|
44
|
-
```jsx
|
|
45
|
-
<Frame ar="2/1" pos="relative">
|
|
46
|
-
<img src="/img/a-1.jpg" alt="" width="960" height="640" />
|
|
47
|
-
<Layer style={{ backdropFilter: 'contrast(1.1) sepia(0.4)' }} />
|
|
48
|
-
</Frame>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### メディアレイヤー(画像を背景にする)
|
|
52
|
-
|
|
53
|
-
`<Frame isLayer>` でメディアをレイヤー化して背景画像として配置し、さらに `<Layer>` で暗幕を重ね、本文は `pos="relative"` で上にのせる構成が定番です。
|
|
54
|
-
|
|
55
|
-
```jsx
|
|
56
|
-
<Box pos="relative" py="50" px="40">
|
|
57
|
-
<Frame isLayer>
|
|
58
|
-
<Media src="/img/a-2.jpg" alt="" width="960" height="640" />
|
|
59
|
-
</Frame>
|
|
60
|
-
<Layer bgc="black:50%" />
|
|
61
|
-
<Stack pos="relative" g="30" c="white">
|
|
62
|
-
<p>本文テキスト...</p>
|
|
63
|
-
</Stack>
|
|
64
|
-
</Box>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
11
|
## 関連プリミティブ
|
|
68
12
|
|
|
69
13
|
- [l--frame](../primitives/l--frame.md) — `isLayer` 併用でメディア背景のレイヤー化
|
|
@@ -2,19 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
直下のコンテンツ幅を一括制御するクラス。`max-width` とセンタリングを担い、記事・セクションのコンテンツ幅の統一に使います。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- クラス名: `is--wrapper`
|
|
8
|
-
- コンポーネント: `<Wrapper>`
|
|
9
|
-
- SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/is/_wrapper.scss
|
|
10
|
-
- 公式ドキュメント: https://lism-css.com/docs/trait-class/is--wrapper.md
|
|
5
|
+
公式ドキュメント(使い方・コード例): https://lism-css.com/docs/trait-class/is--wrapper.md
|
|
11
6
|
|
|
12
7
|
## 使い方
|
|
13
8
|
|
|
14
9
|
`<Wrapper>` は `<Lism isWrapper>` のエイリアスです。`isWrapper` Prop は他のコンポーネントにも使用できます(例: `<Flow isWrapper>`)。
|
|
15
10
|
|
|
16
11
|
| 指定 | 出力 |
|
|
17
|
-
|
|
12
|
+
| --- | --- |
|
|
18
13
|
| `isWrapper` | `is--wrapper` |
|
|
19
14
|
| `isWrapper="s"` | `is--wrapper -contentSize:s` |
|
|
20
15
|
| `isWrapper="m"` | `is--wrapper -contentSize:m` |
|
|
@@ -25,7 +20,7 @@
|
|
|
25
20
|
## 専用Props
|
|
26
21
|
|
|
27
22
|
| Prop | 説明 |
|
|
28
|
-
|
|
23
|
+
| --- | --- |
|
|
29
24
|
| `contentSize` | コンテンツサイズ。`s` / `m` / `l` / `xl` / トークン / 任意値 |
|
|
30
25
|
|
|
31
26
|
```jsx
|
|
@@ -34,66 +29,22 @@
|
|
|
34
29
|
<Wrapper contentSize="s" layout="flow" isContainer>...</Wrapper>
|
|
35
30
|
```
|
|
36
31
|
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
### `layout` との組み合わせ
|
|
40
|
-
|
|
41
|
-
```jsx
|
|
42
|
-
<Wrapper layout="flow" p="20">
|
|
43
|
-
<p>Content</p>
|
|
44
|
-
<p>Content</p>
|
|
45
|
-
</Wrapper>
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
```html
|
|
49
|
-
<div class="l--flow is--wrapper -p:20">
|
|
50
|
-
<p>Content</p>
|
|
51
|
-
<p>Content</p>
|
|
52
|
-
</div>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### `contentSize` 指定
|
|
56
|
-
|
|
57
|
-
```jsx
|
|
58
|
-
<Wrapper contentSize="s" layout="flow" p="20">
|
|
59
|
-
<p>Content</p>
|
|
60
|
-
<p>Content</p>
|
|
61
|
-
</Wrapper>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
```html
|
|
65
|
-
<div class="l--flow is--wrapper -contentSize:s -p:20">
|
|
66
|
-
<p>Content</p>
|
|
67
|
-
<p>Content</p>
|
|
68
|
-
</div>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 任意値のコンテンツ幅
|
|
72
|
-
|
|
73
|
-
```jsx
|
|
74
|
-
<Lism isWrapper="20rem" p="20">
|
|
75
|
-
<div>Contents...</div>
|
|
76
|
-
</Lism>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
```html
|
|
80
|
-
<div class="is--wrapper -p:20" style="--contentSize: 20rem">
|
|
81
|
-
<div>Contents...</div>
|
|
82
|
-
</div>
|
|
83
|
-
```
|
|
84
|
-
|
|
85
32
|
## 直下の子要素の挙動
|
|
86
33
|
|
|
87
34
|
`is--wrapper` 直下の子要素には次のスタイルが当たる:
|
|
88
35
|
|
|
89
36
|
```scss
|
|
90
|
-
.is--wrapper
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
37
|
+
.is--wrapper {
|
|
38
|
+
--contentSize: var(--sz--m, 100%);
|
|
39
|
+
> * {
|
|
40
|
+
inline-size: 100%;
|
|
41
|
+
max-inline-size: min(100%, var(--contentSize));
|
|
42
|
+
margin-inline: auto;
|
|
43
|
+
}
|
|
94
44
|
}
|
|
95
45
|
```
|
|
96
46
|
|
|
47
|
+
- `--contentSize` の初期値は `var(--sz--m, 100%)`(`m` 相当)。`-contentSize:s` / `-contentSize:m` / `-contentSize:l` / `-contentSize:xl` のプリセットクラスは `contentSize` Prop の auto-generated 出力から props 層へ自動生成される
|
|
97
48
|
- `inline-size: 100%` により、自然幅が `--contentSize` 未満の要素(短い段落、`<table>` など)も常に親幅まで広げてから `max-inline-size` で制限される。これにより `l--stack` などの flex 縦並び配下でも横幅が揃い、ガタつきが起きない
|
|
98
49
|
- `<table>` を直下に置くと内容依存の自然幅にはならず、常に wrapper 幅まで広がる。テーブルの自然幅を保ちたい場合は `is--wrapper` を直接の親にしないように、間に別の要素を挟む
|
|
99
50
|
|
|
@@ -6,8 +6,8 @@ Lism CSS では、要素に対して宣言的に「役割」や「機能」を
|
|
|
6
6
|
## TOC
|
|
7
7
|
|
|
8
8
|
- [プレフィックス一覧](#プレフィックス一覧)
|
|
9
|
-
- [`is--` Trait(役割宣言)](#is
|
|
10
|
-
- [`has--` Trait(機能付与)](#has
|
|
9
|
+
- [`is--` Trait(役割宣言)](#is---trait役割宣言)
|
|
10
|
+
- [`has--` Trait(機能付与)](#has---trait機能付与)
|
|
11
11
|
|
|
12
12
|
[詳細](https://lism-css.com/docs/trait-class.md)
|
|
13
13
|
|
|
@@ -16,11 +16,11 @@ Lism CSS では、要素に対して宣言的に「役割」や「機能」を
|
|
|
16
16
|
## プレフィックス一覧
|
|
17
17
|
|
|
18
18
|
| プレフィックス | 種類 | レイヤー | 役割 |
|
|
19
|
-
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
20
|
| `is--` | Trait(役割宣言) | `lism-trait` | 要素に「〜である」という役割・存在を宣言する |
|
|
21
21
|
| `has--` | Trait(機能付与) | `lism-trait` | 要素に「〜を持つ」という単一機能を付与する。CSS 変数でカスタマイズ可能 |
|
|
22
22
|
|
|
23
|
-
併用ルールおよび `is--` / `has--` の判定軸は [css-rules.md](./css-rules.md
|
|
23
|
+
併用ルールおよび `is--` / `has--` の判定軸は [css-rules.md](./css-rules.md#クラス分類とプレフィックス) を参照してください。
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
## `is--` Trait(役割宣言)
|
|
@@ -28,7 +28,7 @@ Lism CSS では、要素に対して宣言的に「役割」や「機能」を
|
|
|
28
28
|
要素に**役割・存在の宣言**を付与するクラスです。他の Primitive / Component と自由に組み合わせられます。
|
|
29
29
|
|
|
30
30
|
| クラス | 用途 |
|
|
31
|
-
|
|
31
|
+
| --- | --- |
|
|
32
32
|
| `is--container` | コンテナクエリの基準要素を定義する(`container-type: inline-size`を付与する)。Lism のレスポンシブ機能の判定基準となるラッパーに付与する |
|
|
33
33
|
| `is--wrapper` | 直下の子要素のコンテンツ幅を一括で制限する。`-contentSize:s` / `-contentSize:m` / `-contentSize:l` / `-contentSize:xl` で事前定義したプリセットサイズを指定可能(デフォルト: `--sz--m`)。セクション・ヘッダー・フッター・記事コンテンツなどで、共通したコンテンツ幅を使用する |
|
|
34
34
|
| `is--layer` | 親要素全体に被さる絶対配置レイヤー(`position: absolute; inset: 0;`)。背景画像・カラーオーバーレイ・フィルターレイヤー・コンテンツ等を重ねて表示する |
|
|
@@ -51,7 +51,7 @@ Lism コンポーネントでは `isContainer`, `isLayer` 等の Props として
|
|
|
51
51
|
要素に**単一機能の trait を付与**するクラスです。CSS 変数によりカスタマイズポイントを提供します。
|
|
52
52
|
|
|
53
53
|
| クラス | 用途 | 主な CSS 変数 |
|
|
54
|
-
|
|
54
|
+
| --- | --- | --- |
|
|
55
55
|
| `has--transition` | transition プロパティをまとめてセット。主に hoverクラス(`-hov:*`)と組み合わせて使用 | `--transitionProps`, `--duration`, `--ease`, `--delay`(グローバル上書きは `--transition-duration`) |
|
|
56
56
|
| `has--gutter` | コンテンツの左右に統一した余白(gutter)を設定する | `--gutter`(基準値: `--gutter--base`、初期値 `var(--s30)`) |
|
|
57
57
|
| `has--snap` | `scroll-snap-` 系プロパティを CSS 変数経由でセットできるようにする | `--snapType`, `--snapAlign` 等 |
|
|
@@ -68,8 +68,8 @@ Lism コンポーネントでは `hasTransition`, `hasGutter`, `hasSnap`, `hasMa
|
|
|
68
68
|
|
|
69
69
|
## `is--` と `has--` の判断軸
|
|
70
70
|
|
|
71
|
-
|
|
|
72
|
-
|
|
71
|
+
| | `is--` | `has--` |
|
|
72
|
+
| --- | --- | --- |
|
|
73
73
|
| 意味 | 〜である(役割・存在の宣言) | 〜を持つ(機能の付与) |
|
|
74
74
|
| CSS 変数 | 必須ではない | 必須(カスタマイズポイント) |
|
|
75
75
|
|
|
@@ -25,7 +25,7 @@ Lism コンポーネントでの `util` prop による指定方法は [component
|
|
|
25
25
|
以下は `lism-css` コアの CSS に組み込まれているユーティリティクラスです。
|
|
26
26
|
|
|
27
27
|
| クラス | 用途 | ソースファイル |
|
|
28
|
-
|
|
28
|
+
| --- | --- | --- |
|
|
29
29
|
| `u--trim` | ハーフレディングのネガティブマージンでテキスト上下の余白を詰める | [`_trim.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_trim.scss) |
|
|
30
30
|
| `u--trimAll` | 直下の子要素(`:empty`, `figure`, `picture`, `video`, `button`, `textarea`, `table` を除く)にハーフレディングトリムを一括適用する除外方式のクラス | [`_trim.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_trim.scss) |
|
|
31
31
|
| `u--cbox` | `--keycolor` を使い `color-mix()` で `--c` / `--bgc` / `--bdc` を自動生成する色付きボックス | [`_cbox.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_cbox.scss) |
|
package/dist/data/meta.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { preloadAll } from './lib/load-data.js';
|
|
4
4
|
import { preloadGuides } from './lib/load-markdown.js';
|
|
5
|
+
import { packageVersion } from './lib/version.js';
|
|
5
6
|
import { registerGetOverview } from './tools/get-overview.js';
|
|
6
7
|
import { registerGetTokens } from './tools/get-tokens.js';
|
|
7
8
|
import { registerGetPropsSystem } from './tools/get-props-system.js';
|
|
@@ -14,7 +15,9 @@ async function main() {
|
|
|
14
15
|
preloadGuides();
|
|
15
16
|
const server = new McpServer({
|
|
16
17
|
name: 'lism-css',
|
|
17
|
-
version:
|
|
18
|
+
version: packageVersion,
|
|
19
|
+
}, {
|
|
20
|
+
instructions: 'Documentation server for the Lism CSS framework (lism-css). Recommended workflow: call get_overview FIRST to load foundational context, then use get_component for a known component, get_props_system for a known prop or CSS property, or get_guide for a broad topic. Use search_docs only as a fallback keyword search when other tools do not cover the need. Use convert_css to migrate existing CSS to Lism props in bulk. All tools are read-only. Guide content is written in Japanese.',
|
|
18
21
|
});
|
|
19
22
|
registerGetOverview(server);
|
|
20
23
|
registerGetTokens(server);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
/** skills/ を直接参照しているか(= モノレポ開発時)。npm 配布物(dist/data/guides/)を使っている場合は false。 */
|
|
2
|
+
export declare const isRunningFromSource: boolean;
|
|
1
3
|
/** guides/ ディレクトリから Markdown ファイルを読み込む(キャッシュ付き)。
|
|
2
4
|
* filename にはサブディレクトリを含む posix 区切りの相対パス(例: `primitives/l--flex.md`)を渡せる。 */
|
|
3
5
|
export declare function loadMarkdown(filename: string): string;
|
|
6
|
+
/** Prop 検索用の Markdown(property-class.md + 分冊の all-props.md)を結合して返す */
|
|
7
|
+
export declare function loadPropsMarkdown(): string;
|
|
4
8
|
/** 利用可能なガイドファイル名の一覧(サブディレクトリ配下も含む)を返す */
|
|
5
9
|
export declare function getGuideFilenames(): string[];
|
|
6
10
|
/** 起動時に全ガイドを一括読み込みしてキャッシュに載せる */
|
|
@@ -7,6 +7,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
7
7
|
const skillsDir = resolve(__dirname, '..', '..', '..', '..', 'skills', 'lism-css-guide');
|
|
8
8
|
const distDir = resolve(__dirname, '..', 'data', 'guides');
|
|
9
9
|
const guidesDir = existsSync(skillsDir) ? skillsDir : distDir;
|
|
10
|
+
/** skills/ を直接参照しているか(= モノレポ開発時)。npm 配布物(dist/data/guides/)を使っている場合は false。 */
|
|
11
|
+
export const isRunningFromSource = guidesDir === skillsDir;
|
|
10
12
|
const cache = new Map();
|
|
11
13
|
/** guides/ ディレクトリから Markdown ファイルを読み込む(キャッシュ付き)。
|
|
12
14
|
* filename にはサブディレクトリを含む posix 区切りの相対パス(例: `primitives/l--flex.md`)を渡せる。 */
|
|
@@ -18,6 +20,14 @@ export function loadMarkdown(filename) {
|
|
|
18
20
|
cache.set(filename, content);
|
|
19
21
|
return content;
|
|
20
22
|
}
|
|
23
|
+
// Prop 検索・変換で参照するファイル群。
|
|
24
|
+
// 全 Prop の実テーブルは property-class/all-props.md に分冊されているため、
|
|
25
|
+
// property-class.md 単体では bd 系などの一部しか拾えない(#474)。
|
|
26
|
+
const PROP_SOURCE_FILES = ['property-class.md', 'property-class/all-props.md'];
|
|
27
|
+
/** Prop 検索用の Markdown(property-class.md + 分冊の all-props.md)を結合して返す */
|
|
28
|
+
export function loadPropsMarkdown() {
|
|
29
|
+
return PROP_SOURCE_FILES.map((filename) => loadMarkdown(filename)).join('\n\n');
|
|
30
|
+
}
|
|
21
31
|
/** guidesDir 配下を再帰的に走査し、`.md` ファイルの相対パス(posix 区切り)を返す */
|
|
22
32
|
function walkMarkdownFiles(dir, baseDir = dir) {
|
|
23
33
|
const results = [];
|
package/dist/lib/response.d.ts
CHANGED
|
@@ -6,9 +6,14 @@ type ToolResult = {
|
|
|
6
6
|
text: string;
|
|
7
7
|
}[];
|
|
8
8
|
isError?: boolean;
|
|
9
|
+
structuredContent?: Record<string, unknown>;
|
|
9
10
|
};
|
|
10
11
|
export declare function success(data: Record<string, unknown>): ToolResult;
|
|
12
|
+
/** 候補を提示して次の行動を促す正常応答(isError は付けない)。 */
|
|
11
13
|
export declare function notFound(message: string, extra?: Record<string, unknown>): ToolResult;
|
|
12
14
|
export declare function error(message: string, extra?: Record<string, unknown>): ToolResult;
|
|
13
15
|
export declare function markdownResponse(text: string): ToolResult;
|
|
16
|
+
/** ガイド/データ読み込み失敗時の共通エラー。
|
|
17
|
+
* npx 配布環境のユーザーに「pnpm build して」という実行不可能な指示を出さないよう、実行環境で文言を分ける */
|
|
18
|
+
export declare function loadFailureError(what: string, e: unknown): ToolResult;
|
|
14
19
|
export {};
|
package/dist/lib/response.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { meta } from '../data/meta.js';
|
|
2
|
+
import { isRunningFromSource } from './load-markdown.js';
|
|
2
3
|
export const READ_ONLY_ANNOTATIONS = {
|
|
3
4
|
readOnlyHint: true,
|
|
4
5
|
destructiveHint: false,
|
|
@@ -6,13 +7,16 @@ export const READ_ONLY_ANNOTATIONS = {
|
|
|
6
7
|
openWorldHint: false,
|
|
7
8
|
};
|
|
8
9
|
export function success(data) {
|
|
10
|
+
const payload = { meta, ...data };
|
|
9
11
|
return {
|
|
10
|
-
content: [{ type: 'text', text: JSON.stringify(
|
|
12
|
+
content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
|
|
13
|
+
structuredContent: payload,
|
|
11
14
|
};
|
|
12
15
|
}
|
|
16
|
+
/** 候補を提示して次の行動を促す正常応答(isError は付けない)。 */
|
|
13
17
|
export function notFound(message, extra) {
|
|
14
18
|
return {
|
|
15
|
-
content: [{ type: 'text', text: JSON.stringify({ meta,
|
|
19
|
+
content: [{ type: 'text', text: JSON.stringify({ meta, message, ...extra }, null, 2) }],
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
22
|
export function error(message, extra) {
|
|
@@ -26,3 +30,12 @@ export function markdownResponse(text) {
|
|
|
26
30
|
content: [{ type: 'text', text }],
|
|
27
31
|
};
|
|
28
32
|
}
|
|
33
|
+
/** ガイド/データ読み込み失敗時の共通エラー。
|
|
34
|
+
* npx 配布環境のユーザーに「pnpm build して」という実行不可能な指示を出さないよう、実行環境で文言を分ける */
|
|
35
|
+
export function loadFailureError(what, e) {
|
|
36
|
+
const detail = e instanceof Error ? e.message : String(e);
|
|
37
|
+
const hint = isRunningFromSource
|
|
38
|
+
? 'Run "pnpm build" in packages/mcp and retry.'
|
|
39
|
+
: 'The bundled data may be missing or corrupted — try reinstalling @lism-css/mcp (e.g. "npx -y @lism-css/mcp@latest").';
|
|
40
|
+
return error(`Failed to load ${what}: ${detail}. ${hint}`);
|
|
41
|
+
}
|
package/dist/lib/schemas.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const MetaInfoSchema: z.ZodObject<{
|
|
3
|
+
generatedAt: z.ZodString;
|
|
4
|
+
sourceCommit: z.ZodString;
|
|
5
|
+
docsVersion: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
generatedAt: string;
|
|
8
|
+
sourceCommit: string;
|
|
9
|
+
docsVersion: string;
|
|
10
|
+
}, {
|
|
11
|
+
generatedAt: string;
|
|
12
|
+
sourceCommit: string;
|
|
13
|
+
docsVersion: string;
|
|
14
|
+
}>;
|
|
2
15
|
export declare const DocsEntrySchema: z.ZodObject<{
|
|
3
16
|
sourcePath: z.ZodString;
|
|
4
17
|
title: z.ZodString;
|
|
@@ -24,3 +37,25 @@ export declare const DocsEntrySchema: z.ZodObject<{
|
|
|
24
37
|
keywords: string[];
|
|
25
38
|
snippet: string;
|
|
26
39
|
}>;
|
|
40
|
+
export declare const SearchResultSchema: z.ZodObject<{
|
|
41
|
+
sourcePath: z.ZodString;
|
|
42
|
+
url: z.ZodString;
|
|
43
|
+
heading: z.ZodString;
|
|
44
|
+
snippet: z.ZodString;
|
|
45
|
+
score: z.ZodNumber;
|
|
46
|
+
nextTool: z.ZodNullable<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
sourcePath: string;
|
|
49
|
+
snippet: string;
|
|
50
|
+
url: string;
|
|
51
|
+
heading: string;
|
|
52
|
+
score: number;
|
|
53
|
+
nextTool: string | null;
|
|
54
|
+
}, {
|
|
55
|
+
sourcePath: string;
|
|
56
|
+
snippet: string;
|
|
57
|
+
url: string;
|
|
58
|
+
heading: string;
|
|
59
|
+
score: number;
|
|
60
|
+
nextTool: string | null;
|
|
61
|
+
}>;
|