@lism-css/mcp 0.14.0 → 0.15.1

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.
Files changed (51) hide show
  1. package/dist/data/docs-index.json +152 -82
  2. package/dist/data/guides/SKILL.md +43 -19
  3. package/dist/data/guides/antipatterns.md +147 -0
  4. package/dist/data/guides/base-styles.md +3 -1
  5. package/dist/data/guides/components-core.md +21 -17
  6. package/dist/data/guides/components-ui.md +18 -13
  7. package/dist/data/guides/css-rules.md +43 -34
  8. package/dist/data/guides/customize.md +220 -0
  9. package/dist/data/guides/naming.md +26 -7
  10. package/dist/data/guides/primitive-class.md +82 -30
  11. package/dist/data/guides/primitives/a--decorator.md +2 -2
  12. package/dist/data/guides/primitives/a--divider.md +1 -1
  13. package/dist/data/guides/primitives/a--icon.md +1 -1
  14. package/dist/data/guides/primitives/a--spacer.md +1 -1
  15. package/dist/data/guides/primitives/l--autoColumns.md +71 -0
  16. package/dist/data/guides/primitives/l--box.md +2 -2
  17. package/dist/data/guides/primitives/l--center.md +1 -1
  18. package/dist/data/guides/primitives/l--cluster.md +2 -2
  19. package/dist/data/guides/primitives/l--columns.md +3 -3
  20. package/dist/data/guides/primitives/l--flex.md +2 -2
  21. package/dist/data/guides/primitives/l--flow.md +5 -5
  22. package/dist/data/guides/primitives/l--frame.md +2 -2
  23. package/dist/data/guides/primitives/l--grid.md +2 -2
  24. package/dist/data/guides/primitives/l--stack.md +1 -1
  25. package/dist/data/guides/primitives/{l--switchCols.md → l--switchColumns.md} +18 -18
  26. package/dist/data/guides/primitives/l--tileGrid.md +2 -2
  27. package/dist/data/guides/primitives/{l--sideMain.md → l--withSide.md} +42 -20
  28. package/dist/data/guides/prop-responsive.md +29 -4
  29. package/dist/data/guides/property-class/bd.md +127 -0
  30. package/dist/data/guides/property-class/hov.md +140 -0
  31. package/dist/data/guides/property-class/max-sz.md +99 -0
  32. package/dist/data/guides/property-class.md +49 -83
  33. package/dist/data/guides/set-class.md +65 -80
  34. package/dist/data/guides/tokens.md +26 -13
  35. package/dist/data/guides/trait-class/has--gutter.md +48 -0
  36. package/dist/data/guides/trait-class/has--mask.md +66 -0
  37. package/dist/data/guides/trait-class/has--snap.md +68 -0
  38. package/dist/data/guides/trait-class/has--transition.md +73 -0
  39. package/dist/data/guides/{primitives → trait-class}/is--boxLink.md +8 -8
  40. package/dist/data/guides/{primitives → trait-class}/is--container.md +11 -5
  41. package/dist/data/guides/{primitives → trait-class}/is--layer.md +5 -5
  42. package/dist/data/guides/{primitives → trait-class}/is--wrapper.md +8 -8
  43. package/dist/data/guides/trait-class.md +77 -0
  44. package/dist/data/guides/utility-class.md +9 -9
  45. package/dist/data/meta.js +2 -2
  46. package/dist/lib/load-markdown.js +1 -1
  47. package/dist/lib/search.js +8 -5
  48. package/dist/tools/get-component.js +4 -3
  49. package/dist/tools/get-guide.js +9 -2
  50. package/package.json +2 -2
  51. package/dist/data/guides/primitives/l--fluidCols.md +0 -71
@@ -0,0 +1,66 @@
1
+ # has--mask
2
+
3
+ `--maskImg` 変数と組み合わせて、要素自身にマスク画像を適用する Trait クラス。SVG を使った異形シェイプ表示などに使う。
4
+
5
+ ## 基本情報
6
+
7
+ - クラス名: `has--mask`
8
+ - Lism props: `hasMask`(`<Lism hasMask>` 等)
9
+ - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/has/_mask.scss
10
+ - 公式ドキュメント: https://lism-css.com/docs/trait-class.md#has--mask
11
+
12
+ ## SCSS 定義
13
+
14
+ ```scss
15
+ .has--mask {
16
+ --maskPos: 50%;
17
+ --maskSize: contain;
18
+ --maskRepeat: no-repeat;
19
+ mask: var(--maskImg) var(--maskRepeat) var(--maskPos) / var(--maskSize);
20
+ }
21
+ ```
22
+
23
+ `--maskImg` は定義されていないため、利用側で必ず指定すること。
24
+
25
+ ## CSS 変数
26
+
27
+ | 変数 | 役割 | デフォルト |
28
+ |------|------|-----------|
29
+ | `--maskImg` | マスク画像(`url(...)` で指定。SVG data URI が多い) | **未定義(必須)** |
30
+ | `--maskPos` | マスクの位置 | `50%` |
31
+ | `--maskSize` | マスクのサイズ | `contain` |
32
+ | `--maskRepeat` | マスクの繰り返し | `no-repeat` |
33
+
34
+ ## Usage
35
+
36
+ `Frame` コンポーネント(または任意の要素)に `has--mask` を付与し、`--maskImg` に SVG の data URI をセットする。
37
+
38
+ ```html
39
+ <div
40
+ class="l--frame has--mask -ar:og"
41
+ style="--maskImg: url('data:image/svg+xml,<svg viewBox=&quot;0 0 200 200&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;><path fill=&quot;%23000000&quot; d=&quot;M170.4,25.7...Z&quot; /></svg>')"
42
+ >
43
+ <img src="..." width="960" height="640" alt="" />
44
+ </div>
45
+ ```
46
+ ```jsx
47
+ <Frame
48
+ hasMask
49
+ ar="og"
50
+ style={{
51
+ '--maskImg': `url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path fill="%23000000" d="M170.4,25.7...Z" /></svg>')`
52
+ }}
53
+ >
54
+ <img src="..." width="960" height="640" alt="" />
55
+ </Frame>
56
+ ```
57
+
58
+ ### 実装メモ
59
+
60
+ - HTML 属性内で SVG data URI を使う場合、`<` / `>` / `"` をエンティティ化する必要がある
61
+ - JSX の `style` オブジェクトで渡す場合はテンプレートリテラルでそのまま書ける
62
+ - マスクの位置や繰り返しを変えたい場合は `--maskPos` / `--maskSize` / `--maskRepeat` を個別に上書き
63
+
64
+ ## 関連
65
+
66
+ - `l--frame` — アスペクト比制御。マスク画像をフィットさせるラッパーとして併用することが多い
@@ -0,0 +1,68 @@
1
+ # has--snap
2
+
3
+ `scroll-snap-*` 系のプロパティを CSS 変数経由でセットする Trait クラス。横スクロールカルーセルなどで子要素のスナップ位置を制御したい時に使う。
4
+
5
+ ## 基本情報
6
+
7
+ - クラス名: `has--snap`
8
+ - Lism props: `hasSnap`(`<Lism hasSnap>` 等)
9
+ - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/has/_snap.scss
10
+ - 公式ドキュメント: https://lism-css.com/docs/trait-class.md#has--snap
11
+
12
+ ## SCSS 定義
13
+
14
+ ```scss
15
+ .has--snap {
16
+ --snapType: both mandatory;
17
+ --snapAlign: start;
18
+ --snapStop: normal;
19
+ scroll-snap-type: var(--snapType);
20
+
21
+ & > * {
22
+ scroll-snap-align: var(--snapAlign);
23
+ scroll-snap-stop: var(--snapStop);
24
+ }
25
+ }
26
+ ```
27
+
28
+ 自身に `scroll-snap-type` を、**直下の子要素**に `scroll-snap-align` / `scroll-snap-stop` を適用する構造。
29
+
30
+ ## CSS 変数
31
+
32
+ | 変数 | 役割 | デフォルト |
33
+ |------|------|-----------|
34
+ | `--snapType` | `scroll-snap-type` | `both mandatory` |
35
+ | `--snapAlign` | 子要素の `scroll-snap-align` | `start` |
36
+ | `--snapStop` | 子要素の `scroll-snap-stop` | `normal` |
37
+
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
+ ## 関連
67
+
68
+ - `-ov:*` プロパティクラス — スクロールコンテナ化に必須
@@ -0,0 +1,73 @@
1
+ # has--transition
2
+
3
+ `transition` 系のプロパティを CSS 変数経由でセットする Trait クラス。主に `-hov:*` クラスと組み合わせて、ホバー時のスムーズな変化に使う。
4
+
5
+ ## 基本情報
6
+
7
+ - クラス名: `has--transition`
8
+ - Lism props: `hasTransition`(`<Lism hasTransition>` / `<Box hasTransition>` 等)
9
+ - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/trait/has/_transition.scss
10
+ - 公式ドキュメント: https://lism-css.com/docs/trait-class.md#has--transition
11
+
12
+ ## SCSS 定義
13
+
14
+ ```scss
15
+ .has--transition {
16
+ --duration: var(--transition-duration, 0.25s);
17
+ --ease: ease;
18
+ --delay: 0s;
19
+ --transitionProps: all;
20
+ transition: var(--duration) var(--ease) var(--delay);
21
+ transition-property: var(--transitionProps);
22
+ }
23
+ ```
24
+
25
+ ## CSS 変数
26
+
27
+ | 変数 | 役割 | デフォルト |
28
+ |------|------|-----------|
29
+ | `--transitionProps` | transition 対象プロパティ | `all` |
30
+ | `--duration` | トランジションの長さ | `var(--transition-duration, 0.25s)` |
31
+ | `--ease` | イージング関数 | `ease` |
32
+ | `--delay` | ディレイ | `0s` |
33
+ | `--transition-duration` | 全体のデフォルト duration を `:root` などから上書きするためのグローバル変数 | `0.25s` |
34
+
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
+ ## 関連
71
+
72
+ - [`-hov:*` プロパティクラス](../property-class.md) — ホバー時の変化を定義
73
+ - [`set--var:hov`](../set-class.md#set--varhov) — 親のホバー状態を子要素に伝播させる仕組み
@@ -6,8 +6,8 @@
6
6
 
7
7
  - クラス名: `is--boxLink`
8
8
  - コンポーネント: `<BoxLink>`
9
- - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/primitives/trait/_boxLink.scss
10
- - ドキュメント(人間向け): https://lism-css.com/docs/primitives/is--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
11
11
 
12
12
  ## 専用Props
13
13
 
@@ -26,7 +26,7 @@ BoxLink には主に2通りの使い方があります。
26
26
  `href` を指定すると `<BoxLink>` 自体が `<a>` タグとして出力されます。シンプルなカード全体リンクに最適。
27
27
 
28
28
  ```jsx
29
- <BoxLink href="/article/1" p="30" bgc="base" bd bdrs="30" hov="o">
29
+ <BoxLink href="/article/1" p="30" bgc="base" bd bdrs="30" hov="-o">
30
30
  <Group fz="xl" fw="bold">Heading text</Group>
31
31
  <Text lh="s" my-s="15">記事の抜粋テキスト...</Text>
32
32
  <Group fz="s" c="text-2" ta="right" lh="1" my-s="10">
@@ -36,7 +36,7 @@ BoxLink には主に2通りの使い方があります。
36
36
  ```
37
37
 
38
38
  ```html
39
- <a class="is--boxLink -hov:o -p:30 -bgc:base -bd -bdrs:30" href="/article/1">
39
+ <a class="is--boxLink -hov:-o -p:30 -bgc:base -bd -bdrs:30" href="/article/1">
40
40
  <p class="-fz:xl -fw:bold">Heading text</p>
41
41
  <p class="-c:text-2 -lh:s -my-s:15">記事の抜粋テキスト...</p>
42
42
  <p class="-fz:s -c:text-2 -ta:right -lh:1 -my-s:10">MORE →</p>
@@ -48,7 +48,7 @@ BoxLink には主に2通りの使い方があります。
48
48
  `<BoxLink>` は `<div>` にしたまま、内部のアンカー要素に `is--coverLink` クラスを付けてボックス全体をクリック可能にします。**BoxLink 内部にさらに別のリンクを配置したい場合はこちらを選ぶこと**。
49
49
 
50
50
  ```jsx
51
- <BoxLink as="section" p="30" bgc="base" bd bdrs="30" set="transition" hov="bxsh">
51
+ <BoxLink as="section" p="30" bgc="base" bd bdrs="30" hasTransition hov="-bxsh">
52
52
  <Group fz="xl" fw="bold">
53
53
  <Link isCoverLink href="/article/1">
54
54
  Heading link text
@@ -56,19 +56,19 @@ BoxLink には主に2通りの使い方があります。
56
56
  </Group>
57
57
  <Text c="text-2" lh="s" my-s="15">記事の抜粋テキスト...</Text>
58
58
  <Group my-s="10">
59
- <a href="/tag/foo" className="-hov:o">Inner Link</a>
59
+ <a href="/tag/foo" className="-hov:-o">Inner Link</a>
60
60
  </Group>
61
61
  </BoxLink>
62
62
  ```
63
63
 
64
64
  ```html
65
- <div class="is--boxLink -hov:bxsh -p:30 -bgc:base -bd -bdrs:30 set--transition">
65
+ <div class="is--boxLink -hov:-bxsh -p:30 -bgc:base -bd -bdrs:30 has--transition">
66
66
  <div class="-fz:xl -fw:bold">
67
67
  <a class="is--coverLink" href="/article/1">Heading link text</a>
68
68
  </div>
69
69
  <p class="-c:text-2 -lh:s -my-s:15">記事の抜粋テキスト...</p>
70
70
  <div class="-my-s:10">
71
- <a href="/tag/foo" class="-hov:o">Inner Link</a>
71
+ <a href="/tag/foo" class="-hov:-o">Inner Link</a>
72
72
  </div>
73
73
  </div>
74
74
  ```
@@ -6,8 +6,8 @@
6
6
 
7
7
  - クラス名: `is--container`
8
8
  - コンポーネント: `<Container>`
9
- - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/primitives/trait/_container.scss
10
- - ドキュメント(人間向け): https://lism-css.com/docs/primitives/is--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
11
11
 
12
12
  ## 使い方
13
13
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  | Prop | 出力 |
17
17
  |------|------|
18
- | `isContainer` | `.is--container` |
18
+ | `isContainer` | `is--container` |
19
19
 
20
20
  ## Usage
21
21
 
@@ -39,8 +39,14 @@
39
39
 
40
40
  子要素側は `p={['10', '30']}` のようなブレイクポイント配列指定にすることで、親の `is--container` を基準としたコンテナクエリで値が切り替わります。
41
41
 
42
+ ## `--sz--container` の提供
43
+
44
+ `is--container` は直下の子要素に `--sz--container: 100cqi` をセットします。`-max-sz:container` はこの値を参照しており、`is--container` 基準の幅まで広がります。
45
+
46
+ `has--gutter` と併用した場合は `calc(100cqi + var(--gutter-size) * 2)` に自動調整され、gutter 分を含めた端〜端の幅になります。
47
+
42
48
  ## 関連プリミティブ
43
49
 
44
50
  - [is--wrapper](./is--wrapper.md) — コンテンツ幅ラッパー(`isContainer` と併用可)
45
- - [l--flow](./l--flow.md) — 記事コンテンツ向けフローレイアウト
46
- - [l--box](./l--box.md) — 汎用ボックス
51
+ - [l--flow](../primitives/l--flow.md) — 記事コンテンツ向けフローレイアウト
52
+ - [l--box](../primitives/l--box.md) — 汎用ボックス
@@ -6,8 +6,8 @@
6
6
 
7
7
  - クラス名: `is--layer`
8
8
  - コンポーネント: `<Layer>`
9
- - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/primitives/trait/_layer.scss
10
- - ドキュメント(人間向け): https://lism-css.com/docs/primitives/is--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
11
11
 
12
12
  ## 使い方
13
13
 
@@ -66,6 +66,6 @@
66
66
 
67
67
  ## 関連プリミティブ
68
68
 
69
- - [l--frame](./l--frame.md) — `isLayer` 併用でメディア背景のレイヤー化
70
- - [l--grid](./l--grid.md) — `ga="1/1"` で position を使わずに重ね配置する代替パターン
71
- - [l--center](./l--center.md) — レイヤー内のコンテンツ中央寄せ
69
+ - [l--frame](../primitives/l--frame.md) — `isLayer` 併用でメディア背景のレイヤー化
70
+ - [l--grid](../primitives/l--grid.md) — `ga="1/1"` で position を使わずに重ね配置する代替パターン
71
+ - [l--center](../primitives/l--center.md) — レイヤー内のコンテンツ中央寄せ
@@ -6,8 +6,8 @@
6
6
 
7
7
  - クラス名: `is--wrapper`
8
8
  - コンポーネント: `<Wrapper>`
9
- - SCSSソース: https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/primitives/trait/_wrapper.scss
10
- - ドキュメント(人間向け): https://lism-css.com/docs/primitives/is--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
11
11
 
12
12
  ## 使い方
13
13
 
@@ -15,10 +15,10 @@
15
15
 
16
16
  | 指定 | 出力 |
17
17
  |------|------|
18
- | `isWrapper` | `.is--wrapper` |
19
- | `isWrapper="s"` | `.is--wrapper .-contentSize:s` |
20
- | `isWrapper="l"` | `.is--wrapper .-contentSize:l` |
21
- | `isWrapper="20rem"`(任意値) | `.is--wrapper` + `style="--contentSize: 20rem"` |
18
+ | `isWrapper` | `is--wrapper` |
19
+ | `isWrapper="s"` | `is--wrapper -contentSize:s` |
20
+ | `isWrapper="l"` | `is--wrapper -contentSize:l` |
21
+ | `isWrapper="20rem"`(任意値) | `is--wrapper` + `style="--contentSize: 20rem"` |
22
22
 
23
23
  ## 専用Props
24
24
 
@@ -83,5 +83,5 @@
83
83
  ## 関連プリミティブ
84
84
 
85
85
  - [is--container](./is--container.md) — コンテナクエリ基準(`isContainer` と併用可)
86
- - [l--flow](./l--flow.md) — 記事フローレイアウト(`layout="flow"` で結合)
87
- - [l--box](./l--box.md) — 汎用ボックス
86
+ - [l--flow](../primitives/l--flow.md) — 記事フローレイアウト(`layout="flow"` で結合)
87
+ - [l--box](../primitives/l--box.md) — 汎用ボックス
@@ -0,0 +1,77 @@
1
+ # Trait クラス
2
+
3
+ Lism CSS では、要素に対して宣言的に「役割」や「機能」を付与するクラス群を **Trait クラス**(`is--` / `has--`)として定義します。これらは `@layer lism-trait` に属します。
4
+
5
+
6
+ ## TOC
7
+
8
+ - [プレフィックス一覧](#プレフィックス一覧)
9
+ - [`is--` Trait(役割宣言)](#is-- trait役割宣言)
10
+ - [`has--` Trait(機能付与)](#has-- trait機能付与)
11
+
12
+ [詳細](https://lism-css.com/docs/trait-class.md)
13
+
14
+ ---
15
+
16
+ ## プレフィックス一覧
17
+
18
+ | プレフィックス | 種類 | レイヤー | 役割 |
19
+ |--------------|------|---------|------|
20
+ | `is--` | Trait(役割宣言) | `lism-trait` | 要素に「〜である」という役割・存在を宣言する |
21
+ | `has--` | Trait(機能付与) | `lism-trait` | 要素に「〜を持つ」という単一機能を付与する。CSS 変数でカスタマイズ可能 |
22
+
23
+ 併用ルールおよび `is--` / `has--` の判定軸は [css-rules.md](./css-rules.md#プレフィックスとクラス分類) を参照してください。
24
+
25
+
26
+ ## `is--` Trait(役割宣言)
27
+
28
+ 要素に**役割・存在の宣言**を付与するクラスです。他の Primitive / Component と自由に組み合わせられます。
29
+
30
+ | クラス | 用途 |
31
+ |--------|------|
32
+ | `is--container` | コンテナクエリの基準要素を定義する(`container-type: inline-size`を付与する)。Lism のレスポンシブ機能の判定基準となるラッパーに付与する |
33
+ | `is--wrapper` | 直下の子要素のコンテンツ幅を一括で制限する。`-contentSize:s` / `-contentSize:l` で事前定義したプリセットサイズを指定可能(デフォルト: `--sz--m`)。セクション・ヘッダー・フッター・記事コンテンツなどで、共通したコンテンツ幅を使用する |
34
+ | `is--layer` | 親要素全体に被さる絶対配置レイヤー(`position: absolute; inset: 0;`)。背景画像・カラーオーバーレイ・フィルターレイヤー・コンテンツ等を重ねて表示する |
35
+ | `is--boxLink` | ボックス全体をクリッカブルなリンク領域にする。自身を`a`タグにして利用するか、もしくは自身を`div`にして内部の`a`タグに`is--coverLink`を付与して使う |
36
+ | `is--coverLink` | 親要素全体に被さるクリック領域を持つリンク(`::before` を `inset: 0` で広げる)。`is--boxLink` と併用する |
37
+ | `is--skipFlow` | `l--flow` 直下で使用し、次の兄弟要素のフロー余白をゼロにする。`l--flow`の中にあるが`position:absolute`にしたい要素などに使用する |
38
+ | `is--side` | `l--withSide` 直下で使用し、サイド側の要素であることを示す |
39
+
40
+ Lism コンポーネントでは `isContainer`, `isLayer` 等の Props として利用できます(例: `<Lism isContainer>`)。
41
+
42
+ 詳細は以下の個別ドキュメントを参照してください:
43
+ - [is--container](./trait-class/is--container.md)
44
+ - [is--wrapper](./trait-class/is--wrapper.md)
45
+ - [is--layer](./trait-class/is--layer.md)
46
+ - [is--boxLink](./trait-class/is--boxLink.md)
47
+
48
+
49
+ ## `has--` Trait(機能付与)
50
+
51
+ 要素に**単一機能の trait を付与**するクラスです。CSS 変数によりカスタマイズポイントを提供します。
52
+
53
+ | クラス | 用途 | 主な CSS 変数 |
54
+ |--------|------|--------------|
55
+ | `has--transition` | transition プロパティをまとめてセット。主に hoverクラス(`-hov:*`)と組み合わせて使用 | `--transitionProps`, `--duration`, `--ease`, `--delay`(グローバル上書きは `--transition-duration`) |
56
+ | `has--gutter` | コンテンツの左右に統一した余白(gutter)を設定する | `--gutter-size`(デフォルト `var(--s30)`) |
57
+ | `has--snap` | `scroll-snap-` 系プロパティを CSS 変数経由でセットできるようにする | `--snapType`, `--snapAlign` 等 |
58
+ | `has--mask` | `--maskImg` 変数と組み合わせて、要素自身にマスクを適用する | `--maskImg`, `--maskPos`(`50%`), `--maskSize`(`contain`), `--maskRepeat`(`no-repeat`) |
59
+
60
+ Lism コンポーネントでは `hasTransition`, `hasGutter`, `hasSnap`, `hasMask` という Props として利用できます(例: `<Lism hasTransition>`)。
61
+
62
+ 詳細は以下の個別ドキュメントを参照してください:
63
+ - [has--transition](./trait-class/has--transition.md)
64
+ - [has--gutter](./trait-class/has--gutter.md)
65
+ - [has--snap](./trait-class/has--snap.md)
66
+ - [has--mask](./trait-class/has--mask.md)
67
+
68
+
69
+ ## `is--` と `has--` の判断軸
70
+
71
+ | | `is--` | `has--` |
72
+ |---|---|---|
73
+ | 意味 | 〜である(役割・存在の宣言) | 〜を持つ(機能の付与) |
74
+ | CSS 変数 | 必須ではない | 必須(カスタマイズポイント) |
75
+
76
+ - その要素が **何であるか**(役割)を表すなら → `is--`
77
+ - その要素に **どんな機能を持たせるか**(カスタマイズポイント付き)なら → `has--`
@@ -16,7 +16,7 @@ Lism コンポーネントでの `util` prop による指定方法は [component
16
16
  - [Opt-in ユーティリティ](#opt-in-ユーティリティ)
17
17
  - [ユーザー定義のユーティリティクラス](#ユーザー定義のユーティリティクラス)
18
18
 
19
- [詳細](https://lism-css.com/docs/utility-class/)
19
+ [詳細](https://lism-css.com/docs/utility-class.md)
20
20
 
21
21
  ---
22
22
 
@@ -26,12 +26,12 @@ Lism コンポーネントでの `util` prop による指定方法は [component
26
26
 
27
27
  | クラス | 用途 | ソースファイル |
28
28
  |--------|------|---------------|
29
- | `u--trim` | ハーフレディングのネガティブマージンでテキスト上下の余白を詰める | [`_trimHL.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_trimHL.scss) |
30
- | `u--trimChildren` | 子要素すべてにハーフレディングトリムを適用(`img`, `figure`, `button` は除外) | [`_trimHL.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_trimHL.scss) |
29
+ | `u--trim` | ハーフレディングのネガティブマージンでテキスト上下の余白を詰める | [`_trim.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_trim.scss) |
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) |
32
- | `u--collapseGrid` | Grid / Flex の子要素間に `box-shadow` で境界線を表現する | [`_itemDivider.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_itemDivider.scss) |
33
- | `u--srOnly` | スクリーンリーダー専用(視覚的に非表示)。`clip-path: inset(50%)` で実装 | [`_hidden.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_hidden.scss) |
34
- | `u--snap` | スクロールスナップコンテナ。`--snapType`, `--snapAlign`, `--snapStop` で制御 | [`_snap.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_snap.scss) |
32
+ | `u--divide` | Grid / Flex の子要素**間**にのみ `box-shadow` で区切り線を表示する | [`_divide.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_divide.scss) |
33
+ | `u--cells` | Grid / Flex の各子要素を `box-shadow` で枠囲みし、table セル風に表示する | [`_divide.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_divide.scss) |
34
+ | `u--srOnly` | スクリーンリーダー専用(視覚的に非表示)。`clip-path: inset(50%)` で実装 | [`_srOnly.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_srOnly.scss) |
35
35
  | `u--clipText` | テキストで背景をクリッピング(`background-clip: text`) | [`_clipText.scss`](https://raw.githubusercontent.com/lism-css/lism-css/main/packages/lism-css/src/scss/utility/_clipText.scss) |
36
36
 
37
37
 
@@ -44,8 +44,8 @@ Lism コンポーネントでの `util` prop による指定方法は [component
44
44
  <!-- u--trim: テキスト余白の詰め -->
45
45
  <p class="u--trim">テキスト...</p>
46
46
 
47
- <!-- u--collapseGrid: グリッド子要素間の境界線 -->
48
- <div class="l--grid u--collapseGrid" style="--gtc: 1fr 1fr">
47
+ <!-- u--divide: グリッド子要素間の区切り線 -->
48
+ <div class="l--grid u--divide" style="--gtc: 1fr 1fr">
49
49
  <div>A</div>
50
50
  <div>B</div>
51
51
  </div>
@@ -55,7 +55,7 @@ Lism コンポーネントでの `util` prop による指定方法は [component
55
55
  // JSX での使用(className で指定)
56
56
  <Lism className="u--cbox" keycolor="red" bd p="20">...</Lism>
57
57
  <Text className="u--trim">テキスト...</Text>
58
- <Grid className="u--collapseGrid" gtc="1fr 1fr">...</Grid>
58
+ <Grid className="u--divide" gtc="1fr 1fr">...</Grid>
59
59
  ```
60
60
 
61
61
 
package/dist/data/meta.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const meta = {
2
- generatedAt: '2026-04-17',
3
- sourceCommit: '38761f59',
2
+ generatedAt: '2026-04-27',
3
+ sourceCommit: '09525769',
4
4
  docsVersion: '0.1.0',
5
5
  };
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
4
4
  const __dirname = dirname(fileURLToPath(import.meta.url));
5
5
  // スキル Markdown の正本を直接参照(開発・テスト時)
6
6
  // npm パッケージとして利用される場合は dist/data/guides/ にフォールバック
7
- const skillsDir = resolve(__dirname, '..', '..', '..', '..', '.claude', 'skills', 'lism-css-guide');
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
10
  const cache = new Map();
@@ -97,7 +97,8 @@ export function searchDocs(entries, query, options) {
97
97
  /**
98
98
  * `sourcePath`(実 MDX ファイルの相対パス)を公開 URL のスラッグに変換する。
99
99
  *
100
- * - `primitives/` 配下のみファイル名の casing を保持(CSS クラス名と URL を一致させるための例外)
100
+ * - `primitives/` / `trait-class/` 配下のみファイル名の casing を保持
101
+ * (CSS クラス名と URL を一致させるための例外)
101
102
  * - それ以外は全て小文字化(Astro content collections の `generateId` と揃える)
102
103
  *
103
104
  * IMPORTANT: `apps/docs/src/lib/contentSlug.ts` の `toContentSlug` と必ず同じロジックに保つこと。
@@ -105,11 +106,13 @@ export function searchDocs(entries, query, options) {
105
106
  * apps/docs 側を変更した場合は必ずここも合わせて更新する。
106
107
  *
107
108
  * 例:
108
- * `primitives/l--tileGrid.mdx` → `primitives/l--tileGrid`
109
- * `core-components/Group.mdx` → `core-components/group`
110
- * `ui/DummyText.mdx` → `ui/dummytext`
109
+ * `primitives/l--tileGrid.mdx` → `primitives/l--tileGrid`
110
+ * `trait-class/is--boxLink.mdx` → `trait-class/is--boxLink`
111
+ * `core-components/Group.mdx` → `core-components/group`
112
+ * `ui/DummyText.mdx` → `ui/dummytext`
111
113
  */
114
+ const PRESERVE_CASE_PREFIXES = ['primitives/', 'trait-class/'];
112
115
  function sourcePathToUrlSlug(sourcePath) {
113
116
  const withoutExt = sourcePath.replace(/\.mdx$/, '');
114
- return withoutExt.startsWith('primitives/') ? withoutExt : withoutExt.toLowerCase();
117
+ return PRESERVE_CASE_PREFIXES.some((prefix) => withoutExt.startsWith(prefix)) ? withoutExt : withoutExt.toLowerCase();
115
118
  }
@@ -23,9 +23,10 @@ function parsePrimitiveHeading(md) {
23
23
  return null;
24
24
  return { className: match[1], componentName: match[2] };
25
25
  }
26
+ const ALIAS_SOURCE_DIRS = ['primitives/', 'trait-class/'];
26
27
  let classAliasMap = null;
27
28
  let componentAliasMap = null;
28
- /** primitives/*.md を走査して、クラス名由来 / React コンポーネント名由来の alias map を構築する(遅延初期化・キャッシュ)。
29
+ /** primitives/ および trait-class/ 配下の *.md を走査して、クラス名由来 / React コンポーネント名由来の alias map を構築する(遅延初期化・キャッシュ)。
29
30
  * angle-bracket 形式の問い合わせには componentAliasMap のみを照合し、
30
31
  * クラス専用プリミティブへの false positive を避けるために分離している。 */
31
32
  function buildAliasMaps() {
@@ -34,7 +35,7 @@ function buildAliasMaps() {
34
35
  const classMap = new Map();
35
36
  const componentMap = new Map();
36
37
  for (const filename of getGuideFilenames()) {
37
- if (!filename.startsWith('primitives/'))
38
+ if (!ALIAS_SOURCE_DIRS.some((dir) => filename.startsWith(dir)))
38
39
  continue;
39
40
  const parsed = parsePrimitiveHeading(loadMarkdown(filename));
40
41
  if (!parsed)
@@ -136,7 +137,7 @@ export function registerGetComponent(server) {
136
137
  for (const [key, file] of map) {
137
138
  if (key.includes(normalizedKey) && !seenFiles.has(file)) {
138
139
  seenFiles.add(file);
139
- moduleCandidates.push(file.replace(/^primitives\//, '').replace(/\.md$/, ''));
140
+ moduleCandidates.push(file.replace(new RegExp(`^(${ALIAS_SOURCE_DIRS.join('|')})`), '').replace(/\.md$/, ''));
140
141
  }
141
142
  }
142
143
  }
@@ -14,11 +14,18 @@ const GUIDE_TOPICS = {
14
14
  label: 'UI components (Accordion, Modal, Tabs, Button, etc.)',
15
15
  },
16
16
  'base-styles': { file: 'base-styles.md', label: 'Base styling, reset CSS, HTML element styles' },
17
- 'set-class': { file: 'set-class.md', label: 'Set classes (set--plain, set--shadow, set--hov, etc.)' },
18
- 'primitive-class': { file: 'primitive-class.md', label: 'Primitive class prefixes (is--, l--, a--) and Component class (c--)' },
17
+ 'set-class': { file: 'set-class.md', label: 'Set classes (set--plain, set--var:bxsh, set--var:hov, etc.)' },
18
+ 'primitive-class': {
19
+ file: 'primitive-class.md',
20
+ label: 'Primitive class prefixes (is--, l--, a--) and Component class (c--), with column-layout primitive selection guide',
21
+ },
19
22
  'utility-class': { file: 'utility-class.md', label: 'Utility classes (u--trim, u--cbox, etc.)' },
20
23
  'css-rules': { file: 'css-rules.md', label: 'CSS methodology, layer structure, naming conventions' },
21
24
  responsive: { file: 'prop-responsive.md', label: 'Responsive design, breakpoints, container queries' },
25
+ antipatterns: {
26
+ file: 'antipatterns.md',
27
+ label: 'AI code-generation antipatterns: token typos, prop type mistakes, layout choice errors, responsive omissions',
28
+ },
22
29
  };
23
30
  const TOPIC_DESCRIPTION = Object.entries(GUIDE_TOPICS)
24
31
  .map(([key, { label }]) => `- ${key}: ${label}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lism-css/mcp",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "MCP server for lism-css documentation and API reference.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "license": "MIT",
24
24
  "scripts": {
25
25
  "format": "prettier --write . --ignore-path ../../.prettierignore",
26
- "build": "tsc -p tsconfig.build.json && cp src/data/docs-index.json dist/data/ && rm -rf dist/data/guides && cp -r ../../.claude/skills/lism-css-guide dist/data/guides",
26
+ "build": "tsc -p tsconfig.build.json && cp src/data/docs-index.json dist/data/ && rm -rf dist/data/guides && cp -r ../../skills/lism-css-guide dist/data/guides",
27
27
  "dev": "tsc --watch",
28
28
  "test": "vitest run"
29
29
  }