Skip to content

Commit aa727a6

Browse files
committed
chore:
1 parent 3ce5483 commit aa727a6

File tree

6 files changed

+56
-18
lines changed

6 files changed

+56
-18
lines changed

docs/documentation-generation/01-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ slug: /doc-generation
99

1010
- [`docs-readme`: Documentation readme files formatted in markdown](./docs-readme.md)
1111
- [`docs-json`: Documentation data formatted in JSON](./docs-json.md)
12+
- [`docs-custom-elements-manifest`: Custom Elements Manifest (CEM) format](./docs-custom-elements-manifest.md)
1213
- [`docs-custom`: Custom documentation generation](./docs-custom.md)
1314
- [`docs-vscode`: Documentation generation for VS Code](./docs-vscode.md)
1415
- [`stats`: Stats about the compiled files](./docs-stats.md)

docs/documentation-generation/docs-custom-elements-manifest.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ Then you'd get the following in the JSON output:
7575
]
7676
```
7777

78-
## Slots
78+
## Slots and CSS Parts
7979

8080
If one of your Stencil components makes use of
8181
[slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) for
82-
rendering children you can document them by using the `@slot` JSDoc tag in the
83-
component's comment.
82+
rendering children or [CSS Parts](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) for styling,
83+
you can document them by using the `@slot` and `@part` JSDoc tags in the
84+
component's comments.
8485

8586
For instance, if you had a `my-button` component with a slot you might document
8687
it like so:
@@ -90,6 +91,8 @@ import { Component, h } from '@stencil/core';
9091

9192
/**
9293
* @slot buttonContent - Slot for the content of the button
94+
*
95+
* @part button - The button element
9396
*/
9497
@Component({
9598
tag: 'my-button',
@@ -98,7 +101,7 @@ import { Component, h } from '@stencil/core';
98101
})
99102
export class MyButton {
100103
render() {
101-
return <button><slot name="buttonContent"></slot></button>
104+
return <button part="button"><slot name="buttonContent"></slot></button>
102105
}
103106
}
104107
```
@@ -111,6 +114,12 @@ This would show up in the generated JSON file like so:
111114
"name": "buttonContent",
112115
"description": "Slot for the content of the button"
113116
}
117+
],
118+
"cssParts": [
119+
{
120+
"name": "button",
121+
"description": "The button element"
122+
}
114123
]
115124
```
116125

docs/documentation-generation/docs-json.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ latter you'll need to have the
153153
and configured.
154154
:::
155155

156-
## Slots
156+
## Slots and CSS Parts
157157

158158
If one of your Stencil components makes use of
159159
[slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) for
160-
rendering children you can document them by using the `@slot` JSDoc tag in the
161-
component's comment.
160+
rendering children or [CSS Parts](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) for styling,
161+
you can document them by using the `@slot` and `@part` JSDoc tags in the
162+
component's comments.
162163

163164
For instance, if you had a `my-button` component with a slot you might document
164165
it like so:
@@ -168,6 +169,8 @@ import { Component, h } from '@stencil/core';
168169

169170
/**
170171
* @slot buttonContent - Slot for the content of the button
172+
*
173+
* @part button - The button element
171174
*/
172175
@Component({
173176
tag: 'my-button',
@@ -176,7 +179,7 @@ import { Component, h } from '@stencil/core';
176179
})
177180
export class MyButton {
178181
render() {
179-
return <button><slot name="buttonContent"></slot></button>
182+
return <button part="button"><slot name="buttonContent"></slot></button>
180183
}
181184
}
182185
```
@@ -187,7 +190,13 @@ This would show up in the generated JSON file like so:
187190
"slots": [
188191
{
189192
"name": "buttonContent",
190-
"description": "Slot for the content of the button"
193+
"docs": "Slot for the content of the button"
194+
}
195+
],
196+
"parts": [
197+
{
198+
"name": "button",
199+
"docs": "The button element"
191200
}
192201
]
193202
```

versioned_docs/version-v4.42/documentation-generation/01-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ slug: /doc-generation
99

1010
- [`docs-readme`: Documentation readme files formatted in markdown](./docs-readme.md)
1111
- [`docs-json`: Documentation data formatted in JSON](./docs-json.md)
12+
- [`docs-custom-elements-manifest`: Custom Elements Manifest (CEM) format](./docs-custom-elements-manifest.md)
1213
- [`docs-custom`: Custom documentation generation](./docs-custom.md)
1314
- [`docs-vscode`: Documentation generation for VS Code](./docs-vscode.md)
1415
- [`stats`: Stats about the compiled files](./docs-stats.md)

versioned_docs/version-v4.42/documentation-generation/docs-custom-elements-manifest.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ Then you'd get the following in the JSON output:
7575
]
7676
```
7777

78-
## Slots
78+
## Slots and CSS Parts
7979

8080
If one of your Stencil components makes use of
8181
[slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) for
82-
rendering children you can document them by using the `@slot` JSDoc tag in the
83-
component's comment.
82+
rendering children or [CSS Parts](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) for styling,
83+
you can document them by using the `@slot` and `@part` JSDoc tags in the
84+
component's comments.
8485

8586
For instance, if you had a `my-button` component with a slot you might document
8687
it like so:
@@ -90,6 +91,8 @@ import { Component, h } from '@stencil/core';
9091

9192
/**
9293
* @slot buttonContent - Slot for the content of the button
94+
*
95+
* @part button - The button element
9396
*/
9497
@Component({
9598
tag: 'my-button',
@@ -98,7 +101,7 @@ import { Component, h } from '@stencil/core';
98101
})
99102
export class MyButton {
100103
render() {
101-
return <button><slot name="buttonContent"></slot></button>
104+
return <button part="button"><slot name="buttonContent"></slot></button>
102105
}
103106
}
104107
```
@@ -111,6 +114,12 @@ This would show up in the generated JSON file like so:
111114
"name": "buttonContent",
112115
"description": "Slot for the content of the button"
113116
}
117+
],
118+
"cssParts": [
119+
{
120+
"name": "button",
121+
"description": "The button element"
122+
}
114123
]
115124
```
116125

versioned_docs/version-v4.42/documentation-generation/docs-json.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ latter you'll need to have the
153153
and configured.
154154
:::
155155

156-
## Slots
156+
## Slots and CSS Parts
157157

158158
If one of your Stencil components makes use of
159159
[slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) for
160-
rendering children you can document them by using the `@slot` JSDoc tag in the
161-
component's comment.
160+
rendering children or [CSS Parts](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) for styling,
161+
you can document them by using the `@slot` and `@part` JSDoc tags in the
162+
component's comments.
162163

163164
For instance, if you had a `my-button` component with a slot you might document
164165
it like so:
@@ -168,6 +169,8 @@ import { Component, h } from '@stencil/core';
168169

169170
/**
170171
* @slot buttonContent - Slot for the content of the button
172+
*
173+
* @part button - The button element
171174
*/
172175
@Component({
173176
tag: 'my-button',
@@ -176,7 +179,7 @@ import { Component, h } from '@stencil/core';
176179
})
177180
export class MyButton {
178181
render() {
179-
return <button><slot name="buttonContent"></slot></button>
182+
return <button part="button"><slot name="buttonContent"></slot></button>
180183
}
181184
}
182185
```
@@ -187,7 +190,13 @@ This would show up in the generated JSON file like so:
187190
"slots": [
188191
{
189192
"name": "buttonContent",
190-
"description": "Slot for the content of the button"
193+
"docs": "Slot for the content of the button"
194+
}
195+
],
196+
"parts": [
197+
{
198+
"name": "button",
199+
"docs": "The button element"
191200
}
192201
]
193202
```

0 commit comments

Comments
 (0)