Skip to content

Commit 1e97f93

Browse files
committed
fix(clipboard): makes clipboard a context consumer
1 parent f7c429d commit 1e97f93

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/context-controller-cavalcade.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
- Fixes animation timings in pfe-accordion on browsers which don't support `computedStyleMap`
6363
- Fixes context styles for slotted CTAs (provided `pfe.min.css` is loaded)
6464
- Restores reload-on-save function to dev server
65+
- Makes `pfe-clipboard` strictly a colour context consumer
6566

6667
### New Features:
6768

elements/pfe-clipboard/pfe-clipboard.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { LitElement, html } from 'lit';
22
import { customElement, property, state } from 'lit/decorators.js';
33

4-
import { ComposedEvent } from '@patternfly/pfe-core';
4+
import { ColorTheme, ComposedEvent } from '@patternfly/pfe-core';
55
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
6-
import { pfelement, bound, observed } from '@patternfly/pfe-core/decorators.js';
6+
import { pfelement, bound, observed, colorContextConsumer } from '@patternfly/pfe-core/decorators.js';
77
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';
88
import { Logger } from '@patternfly/pfe-core/controllers/logger.js';
99

@@ -86,6 +86,12 @@ export class PfeClipboard extends LitElement {
8686
*/
8787
@property({ type: Number, reflect: true, attribute: 'copied-duration' }) copiedDuration = 4;
8888

89+
/**
90+
* Sets color theme based on parent context
91+
*/
92+
@colorContextConsumer()
93+
@property({ reflect: true }) on?: ColorTheme;
94+
8995
/**
9096
* Specify when the button slot needs to be aria-disabled or not, coincides with button disabled * states.
9197
*/

0 commit comments

Comments
 (0)