From 0a796d618f61f103174cb6fb64e93fa0ea7fb1e8 Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Tue, 17 Dec 2024 03:04:44 -0500 Subject: [PATCH] Badge appearances! --- docs/docs/components/badge.md | 37 +++++++++++++++++++++++++++++++++++ src/components/badge/badge.ts | 3 ++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/docs/docs/components/badge.md b/docs/docs/components/badge.md index 5f6001210..dd37b8558 100644 --- a/docs/docs/components/badge.md +++ b/docs/docs/components/badge.md @@ -22,6 +22,43 @@ Set the `variant` attribute to change the badge's variant. Danger ``` +### Appearance + +Use the `appearance` attribute to change the badge's visual appearance. + +```html {.example} +
+ Filled + Both + Tinted + Outlined +
+
+ Filled + Both + Tinted + Outlined +
+
+ Filled + Both + Tinted + Outlined +
+
+ Filled + Both + Tinted + Outlined +
+
+ Filled + Both + Tinted + Outlined +
+``` + ### Pill Badges Use the `pill` attribute to give badges rounded edges. diff --git a/src/components/badge/badge.ts b/src/components/badge/badge.ts index 16abe27a6..10c028e41 100644 --- a/src/components/badge/badge.ts +++ b/src/components/badge/badge.ts @@ -2,6 +2,7 @@ import { html } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import WebAwesomeElement from '../../internal/webawesome-element.js'; +import appearanceStyles from '../../styles/utilities/appearance.css'; import variantStyles from '../../styles/utilities/variants.css'; import styles from './badge.css'; @@ -24,7 +25,7 @@ import styles from './badge.css'; */ @customElement('wa-badge') export default class WaBadge extends WebAwesomeElement { - static shadowStyle = [variantStyles, styles]; + static shadowStyle = [variantStyles, appearanceStyles, styles]; /** The badge's theme variant. */ @property({ reflect: true }) variant: 'brand' | 'success' | 'neutral' | 'warning' | 'danger' = 'brand';