|
| 1 | +import type { ColorPalette, ColorTheme } from '@patternfly/pfe-core'; |
| 2 | + |
1 | 3 | import { LitElement, html, svg } from 'lit'; |
2 | 4 | import { customElement, property, state } from 'lit/decorators.js'; |
3 | 5 |
|
4 | 6 | import { ComposedEvent } from '@patternfly/pfe-core'; |
5 | | -import { pfelement, bound, initializer } from '@patternfly/pfe-core/decorators.js'; |
6 | 7 | import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js'; |
7 | 8 | import { Logger } from '@patternfly/pfe-core/controllers/logger.js'; |
| 9 | +import { |
| 10 | + bound, |
| 11 | + colorContextConsumer, |
| 12 | + colorContextProvider, |
| 13 | + deprecation, |
| 14 | + initializer, |
| 15 | + pfelement, |
| 16 | +} from '@patternfly/pfe-core/decorators.js'; |
8 | 17 |
|
9 | 18 | import style from './pfe-cta.scss'; |
10 | 19 |
|
@@ -87,8 +96,23 @@ export class PfeCta extends LitElement { |
87 | 96 | */ |
88 | 97 | @property({ reflect: true }) priority?: 'primary'|'secondary'; |
89 | 98 |
|
90 | | - /** Color */ |
91 | | - @property({ reflect: true }) color?: 'accent'|'base'|'complement'|'lightest'; |
| 99 | + /** |
| 100 | + * Sets color palette, which affects the element's styles as well as descendants' color theme. |
| 101 | + * Overrides parent color context. |
| 102 | + * Your theme will influence these colors so check there first if you are seeing inconsistencies. |
| 103 | + * See [CSS Custom Properties](#css-custom-properties) for default values |
| 104 | + */ |
| 105 | + @colorContextProvider() |
| 106 | + @property({ reflect: true, attribute: 'color-palette' }) colorPalette?: ColorPalette; |
| 107 | + |
| 108 | + /** @deprecated use `color-palette` */ |
| 109 | + @deprecation({ alias: 'colorPalette', attribute: 'color' }) color?: ColorPalette; |
| 110 | + |
| 111 | + /** |
| 112 | + * Sets color theme based on parent context |
| 113 | + */ |
| 114 | + @colorContextConsumer() |
| 115 | + @property({ reflect: true }) on?: ColorTheme; |
92 | 116 |
|
93 | 117 | /** |
94 | 118 | * `priority="secondary"` has a `wind` variant (`variant="wind"`) that can be applied to change the style of the secondary call-to-action. |
|
0 commit comments