@@ -4,7 +4,13 @@ import { LitElement, html } from 'lit';
44import { customElement , property } from 'lit/decorators.js' ;
55import { classMap } from 'lit/directives/class-map.js' ;
66
7- import { colorContextConsumer , colorContextProvider , observed , pfelement } from '@patternfly/pfe-core/decorators.js' ;
7+ import {
8+ colorContextConsumer ,
9+ colorContextProvider ,
10+ deprecation ,
11+ observed ,
12+ pfelement
13+ } from '@patternfly/pfe-core/decorators.js' ;
814import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js' ;
915
1016import style from './pfe-card.scss' ;
@@ -30,6 +36,15 @@ import style from './pfe-card.scss';
3036 * @csspart body - The container for *body* content
3137 * @csspart footer - The container for *footer* content
3238 *
39+ *
40+ * @cssproperty {<color>} --pfe-theme--color--surface--lightest {@default `#ffffff`}
41+ * @cssproperty {<color>} --pfe-theme--color--surface--lighter {@default `#ececec`}
42+ * @cssproperty {<color>} --pfe-theme--color--surface--base {@default `#f0f0f0`}
43+ * @cssproperty {<color>} --pfe-theme--color--surface--darker {@default `#3c3f42`}
44+ * @cssproperty {<color>} --pfe-theme--color--surface--darkest {@default `#151515`}
45+ * @cssproperty {<color>} --pfe-theme--color--surface--accent {@default `#004080`}
46+ * @cssproperty {<color>} --pfe-theme--color--surface--complement {@default `#002952`}
47+ *
3348 * @cssproperty --pfe-band--BackgroundColor
3449 * Though using the `color` attribute is strongly recommended when setting the background color for the band, you can also use completely custom colors by updating the `--pfe-band--BackgroundColor` variable. If you update this value manually, you should also update the `--theme` context variable to invoke the right theme on it and it's child elements. Supported themes include: `light`, `dark`, and `saturated`.
3550 * @cssproperty --pfe-card--BackgroundPosition
@@ -64,21 +79,22 @@ export class PfeCard extends LitElement {
6479 @property ( { attribute : 'img-src' , reflect : true } ) imgSrc ?: string ;
6580
6681 /**
82+ * Sets color palette, which affects the element's styles as well as descendants' color theme.
83+ * Overrides parent color context.
6784 * Your theme will influence these colors so check there first if you are seeing inconsistencies.
85+ * See [CSS Custom Properties](#css-custom-properties) for default values
6886 *
69- * | Color | Hex Value |
70- * | ---------- | ---------------------------------------------------------------- |
71- * | lightest | <span class="color-preview" style="--bg:#ffffff"></span> #ffffff |
72- * | lighter | <span class="color-preview" style="--bg:#ececec"></span> #ececec |
73- * | default | <span class="color-preview" style="--bg:#dfdfdf"></span> #dfdfdf |
74- * | darker | <span class="color-preview" style="--bg:#464646"></span> #464646 |
75- * | darkest | <span class="color-preview" style="--bg:#131313"></span> #131313 |
76- * | accent | <span class="color-preview" style="--bg:#ee0000"></span> #ee0000 |
77- * | complement | <span class="color-preview" style="--bg:#0477a4"></span> #0477a4 |
87+ * Card always resets its context to `base`, unless explicitly provided with a `color-palette`.
7888 */
7989 @colorContextProvider ( )
80- @property ( { reflect : true , attribute : 'color-palette' } ) colorPalette : ColorPalette = 'base' ;
90+ @property ( { reflect : true , attribute : 'color-palette' } ) colorPalette ?: ColorPalette ;
91+
92+ /** @deprecated use `color-palette` */
93+ @deprecation ( { alias : 'colorPalette' , attribute : 'color' } ) color : ColorPalette = 'base' ;
8194
95+ /**
96+ * Sets color theme based on parent context
97+ */
8298 @colorContextConsumer ( )
8399 @property ( { reflect : true } ) on ?: ColorTheme ;
84100
0 commit comments