-
Notifications
You must be signed in to change notification settings - Fork 106
[draft] fix: tied legacy pfe-cta css vars to the new color-context vars #2006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 814e5f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
I pushed some commits which fix up the context variables for CTA by explicitly defining them. Is is the prettiest code? No. However I'd prefer not to dwell on it, since I'm fixing to refactor this CSS at some point anyway. It would be nice to add some regression tests on this branch once we reach consensus (through manual testing) that it passes acceptance criteria. I haven't yet addressed the custom I tested this by running two separate dev servers, one with commit c10f678 checked out (i.e. before the context refactor) and one with this branch checked out. In these screenshots, the left hand side is the old, pre-refactor version, and the right hand side is the PR branch |
|
OK the issue with the Opposed:
In Favour:
We could take a compromise position and require You'll notice that one of the examples in the demo came with it's own
A fourth option would be to add escape hatches to Practically speaking...So, the practical options before us as I see them ATM are:
|
|
I think the compromise with |
|
Ok, taking @heyMP and @zeroedin 's comments into consideration, what I will do is:
There are a few other examples in the repo where |
compare this PR (https://deploy-preview-2006--patternfly-elements.netlify.app/components/cta/demo/) with an old version (https://deploy-preview-1989--patternfly-elements.netlify.app/components/cta/demo/) |
2646a51 to
814e5f8
Compare
bennypowers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less griping, tinker more!


Problem / Solution
This illustrates how to tie the legacy CSS vars for pfe-cta into the new color context controller
--pfe-context-background-color: var(--pfe-cta--BackgroundColor);The
_sharedStyles.scssgenerates all of the color-palette and priority overrides via css custom properties. Since the color context provider sets background-color and only background-color, we have to specifically use that custom property to override background-color.color-context.scssAlternatives
background-colordeclaration incolor-context.scssand put in the docs that you also have to implement the--pfe-context-background-colormanually.Related issues
Preview
Link(s) to demo page(s) where this element can be viewed:
What has changed and why
Testing instructions
Browser requirements
Your component should work in all of the following environments:
Ready-for-merge Checklist
Merging
Please squash when merging and ensure your commit message uses conventional commit formatting.
Be sure to share your updates with the [email protected] mailing list!