Skip to content

Commit 8dff857

Browse files
committed
chore(migration-guides): add @cssprop to doc blocks
1 parent be3bb9d commit 8dff857

8 files changed

Lines changed: 47 additions & 1 deletion

File tree

2nd-gen/packages/swc/components/avatar/Avatar.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ import styles from './avatar.css';
3434
*
3535
* @example
3636
* <swc-avatar src="/path/to/image.jpg" alt="Jane Doe" outline></swc-avatar>
37+
*
38+
* @cssprop --swc-avatar-size - Size (inline and block) of the avatar.
39+
* @cssprop --swc-avatar-outline-color - Color of the avatar outline.
40+
* @cssprop --swc-avatar-outline-width - Width of the avatar outline.
41+
* @cssprop --swc-avatar-opacity-disabled - Opacity when the avatar is disabled.
3742
*/
3843
export class Avatar extends AvatarBase {
3944
public static override get styles(): CSSResultArray {

2nd-gen/packages/swc/components/badge/Badge.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ import styles from './badge.css';
4141
* <sp-icon-checkmark slot="icon"></sp-icon-checkmark>
4242
* Verified
4343
* </swc-badge>
44+
*
45+
* @cssprop --swc-badge-height - Minimum block size of the badge.
46+
* @cssprop --swc-badge-corner-radius - Corner radius of the badge.
47+
* @cssprop --swc-badge-gap - Gap between the icon and label.
48+
* @cssprop --swc-badge-padding-block - Block padding.
49+
* @cssprop --swc-badge-padding-inline - Inline padding.
50+
* @cssprop --swc-badge-padding-inline-start - Inline-start padding; overrides the start side of `--swc-badge-padding-inline`.
51+
* @cssprop --swc-badge-font-size - Font size of the label.
52+
* @cssprop --swc-badge-line-height - Line height of the label.
53+
* @cssprop --swc-badge-icon-size - Size of the icon in the icon slot.
54+
* @cssprop --swc-badge-label-icon-color - Color of the label text and icon.
55+
* @cssprop --swc-badge-background-color - Background color of the badge.
56+
* @cssprop --swc-badge-border-color - Border color; visible on the outline variant.
57+
* @cssprop --swc-badge-with-icon-padding-inline - Inline padding when the badge has both an icon and a label.
58+
* @cssprop --swc-badge-with-icon-only-padding-inline - Inline padding for icon-only badges.
59+
* @cssprop --swc-badge-with-icon-only-padding-block - Block padding for icon-only badges.
60+
* @cssprop --swc-badge-outline-background-color - Background color override for the outline variant.
61+
* @cssprop --swc-badge-outline-label-icon-color - Label and icon color override for the outline variant.
4462
*/
4563
export class Badge extends BadgeBase {
4664
// ────────────────────

2nd-gen/packages/swc/components/divider/Divider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import styles from './divider.css';
2222
* @element swc-divider
2323
* @status preview
2424
* @since 0.0.1
25+
*
26+
* @cssprop --swc-divider-background-color - Background color of the divider.
27+
* @cssprop --swc-divider-thickness - Thickness of the divider.
2528
*/
2629
export class Divider extends DividerBase {
2730
// ──────────────────────────────

2nd-gen/packages/swc/components/icon/Icon.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import styles from './icon.css';
3333
* import { Chevron100Icon } from './elements/Chevron100Icon.js';
3434
*
3535
* html`<swc-icon label="Expand">${Chevron100Icon()}</swc-icon>`;
36+
*
37+
* @cssprop --swc-icon-color - Color of the icon.
38+
* @cssprop --swc-icon-inline-size - Inline size of the icon.
39+
* @cssprop --swc-icon-block-size - Block size of the icon.
3640
*/
3741
export class Icon extends IconBase {
3842
// ──────────────────────────────

2nd-gen/packages/swc/components/progress-circle/ProgressCircle.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ import styles from './progress-circle.css';
4444
* <swc-progress-circle indeterminate label="Loading..."></swc-progress-circle>
4545
*
4646
* Light DOM children are not projected into the shadow tree. Use the `label` attribute or property, or `aria-label` / `aria-labelledby` on the host, for an accessible name.
47+
*
48+
* @cssprop --swc-progress-circle-size - Inline and block size of the circle.
49+
* @cssprop --swc-progress-circle-track-border-color - Color of the track (background ring).
50+
* @cssprop --swc-progress-circle-fill-border-color - Color of the fill (progress indicator).
51+
* @cssprop --swc-progress-circle-thickness - Stroke width of the circle rings.
4752
*/
4853
export class ProgressCircle extends ProgressCircleBase {
4954
// ────────────────────

2nd-gen/packages/swc/components/progress-circle/progress-circle.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
@media (forced-colors: active) {
104104
.swc-ProgressCircle {
105105
--swc-progress-circle-fill-border-color: Highlight;
106-
--swc-progress-circle-track-color: Canvas;
106+
--swc-progress-circle-track-border-color: Canvas;
107107

108108
@media (prefers-color-scheme: dark) {
109109
--swc-progress-circle-track-border-color: token("static-white-track-color");

2nd-gen/packages/swc/components/status-light/StatusLight.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ import styles from './status-light.css';
3838
*
3939
* @example
4040
* <swc-status-light variant="silver">Supported in Edge</swc-status-light>
41+
*
42+
* @cssprop --swc-statuslight-height - Minimum block size of the status light.
43+
* @cssprop --swc-statuslight-dot-size - Size of the indicator dot.
44+
* @cssprop --swc-statuslight-dot-color - Color of the indicator dot.
45+
* @cssprop --swc-statuslight-font-size - Font size of the label.
46+
* @cssprop --swc-statuslight-line-height - Line height of the label.
47+
* @cssprop --swc-statuslight-padding-block - Block padding.
48+
* @cssprop --swc-statuslight-top-to-dot - Distance from the block-start edge to the center of the dot.
49+
* @cssprop --swc-statuslight-text-to-visual - Gap between the dot and the label.
50+
* @cssprop --swc-statuslight-content-color - Color of the label text.
4151
*/
4252
export class StatusLight extends StatusLightBase {
4353
// ────────────────────

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export default defineConfig([
278278
'element', // Custom element tag name
279279
'slot', // Slot documentation
280280
'csspart', // CSS part documentation
281+
'cssprop', // CSS custom property documentation (shorthand)
281282
'cssproperty', // CSS custom property documentation
282283
'fires', // Event documentation
283284
'attr', // Attribute shorthand

0 commit comments

Comments
 (0)