From c6d3669c5d9a40477618cb736febd50167a99d30 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Mon, 18 Apr 2022 14:58:44 -0400 Subject: [PATCH 1/2] fix(cta): remove color context provider --- elements/pfe-cta/demo/pfe-cta.html | 86 +++++++++++++++--------------- elements/pfe-cta/pfe-cta.scss | 6 +-- elements/pfe-cta/pfe-cta.ts | 16 +----- 3 files changed, 48 insertions(+), 60 deletions(-) diff --git a/elements/pfe-cta/demo/pfe-cta.html b/elements/pfe-cta/demo/pfe-cta.html index 705c50b0e3..e2e8f2170f 100644 --- a/elements/pfe-cta/demo/pfe-cta.html +++ b/elements/pfe-cta/demo/pfe-cta.html @@ -25,24 +25,24 @@

No color-palette attribute

-

color-palette="base"

+

color="base"

-

color-palette="accent"

+

color="accent"

@@ -65,25 +65,25 @@

No color-palette attribute

-

color-palette="base"

+

color="base"

-

color-palette="accent"

+

color="accent"

@@ -107,24 +107,24 @@

No color-palette attribute

-

color-palette="base"

+

color="base"

-

color-palette="accent"

+

color="accent"

@@ -173,8 +173,8 @@

Color responsive

Color override

- Primary accent - Secondary accent + Primary accent + Secondary accent Primary lightest Secondary + wind variant
@@ -196,11 +196,11 @@

Color responsive

Color override

- Primary accent - Secondary accent - Primary complement - Secondary complement - Primary lightest + Primary accent + Secondary accent + Primary complement + Secondary complement + Primary lightest Secondary + wind variant
diff --git a/elements/pfe-cta/pfe-cta.scss b/elements/pfe-cta/pfe-cta.scss index 86a41dda5c..5532d7d143 100644 --- a/elements/pfe-cta/pfe-cta.scss +++ b/elements/pfe-cta/pfe-cta.scss @@ -159,7 +159,7 @@ // Primary omitted because it already uses the accent color -:host([priority="secondary"][color-palette="accent"]) { +:host([priority="secondary"][color="accent"]) { @include pfe-print-local($secondary-accent); } @@ -167,11 +167,11 @@ /// COLOR=BASE /// =========================================================================== -:host([priority="primary"][color-palette="base"]) { +:host([priority="primary"][color="base"]) { @include pfe-print-local($primary-base); } -:host([priority="secondary"][color-palette="base"]) { +:host([priority="secondary"][color="base"]) { @include pfe-print-local($secondary-base); } diff --git a/elements/pfe-cta/pfe-cta.ts b/elements/pfe-cta/pfe-cta.ts index c9309d259b..5ab907f785 100644 --- a/elements/pfe-cta/pfe-cta.ts +++ b/elements/pfe-cta/pfe-cta.ts @@ -9,8 +9,6 @@ import { Logger } from '@patternfly/pfe-core/controllers/logger.js'; import { bound, colorContextConsumer, - colorContextProvider, - deprecation, initializer, pfelement, } from '@patternfly/pfe-core/decorators.js'; @@ -96,24 +94,14 @@ export class PfeCta extends LitElement { */ @property({ reflect: true }) priority?: 'primary'|'secondary'; - /** - * Sets color palette, which affects the element's styles as well as descendants' color theme. - * Overrides parent color context. - * Your theme will influence these colors so check there first if you are seeing inconsistencies. - * See [CSS Custom Properties](#css-custom-properties) for default values - */ - @colorContextProvider() - @property({ reflect: true, attribute: 'color-palette' }) colorPalette?: ColorPalette; - - /** @deprecated use `color-palette` */ - @deprecation({ alias: 'colorPalette', attribute: 'color' }) color?: ColorPalette; - /** * Sets color theme based on parent context */ @colorContextConsumer() @property({ reflect: true }) on?: ColorTheme; + @property({ reflect: true, attribute: 'color' }) color?: 'accent' | 'base' | null; + /** * `priority="secondary"` has a `wind` variant (`variant="wind"`) that can be applied to change the style of the secondary call-to-action. * From e8bef3ba51ee24bec9b0fd508414ea221117b136 Mon Sep 17 00:00:00 2001 From: Steven Spriggs Date: Mon, 18 Apr 2022 15:01:33 -0400 Subject: [PATCH 2/2] chore(cta): add changeset --- .changeset/wet-masks-hear.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wet-masks-hear.md diff --git a/.changeset/wet-masks-hear.md b/.changeset/wet-masks-hear.md new file mode 100644 index 0000000000..d66a86320c --- /dev/null +++ b/.changeset/wet-masks-hear.md @@ -0,0 +1,5 @@ +--- +"@patternfly/pfe-cta": patch +--- + +Removes color context provider, reverting back to color attribute