-
Notifications
You must be signed in to change notification settings - Fork 106
feat: pfe-button | Add large variant #1745 #1751
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
|
✔️ Deploy Preview for patternfly-elements ready! 🔨 Explore the source changes: d21d80d 🔍 Inspect the deploy log: https://app.netlify.com/sites/patternfly-elements/deploys/611d2f2fe0baae0008df5cef 😎 Browse the preview: https://deploy-preview-1751--patternfly-elements.netlify.app |
| BackgroundColor--hover: pfe-var(ui-accent--hover), | ||
| Color: pfe-var(ui-base--text), | ||
| FontSize: pfe-var(FontSize--md), | ||
| FontWeight: pfe-var(font-weight--normal), |
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.
Adding font-weight as an override since we are adding semi bold on large sizing
| expect(getComputedStyle(shadowBtn).getPropertyValue('padding')).to.equal('12px 24px'); | ||
| expect(getComputedStyle(shadowBtn).getPropertyValue('font-weight')).to.equal('600'); |
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.
checking the two specific property changes to the large variant.
| <pfe-band color="lightest"> | ||
| <header slot="pfe-band--header"> | ||
| <h2><pfe-button size="large"></h2> | ||
| </header> | ||
| <article> | ||
| <pfe-button size="large"> | ||
| <button>Primary</button> | ||
| </pfe-button> | ||
| <pfe-button variant="secondary" size="large"> | ||
| <button>Secondary</button> | ||
| </pfe-button> | ||
| <pfe-button variant="tertiary" size="large"> | ||
| <button>Tertiary</button> | ||
| </pfe-button> | ||
| <pfe-button variant="danger" size="large"> | ||
| <button>Danger</button> | ||
| </pfe-button> | ||
| <pfe-button variant="control" size="large"> | ||
| <button>Control</button> | ||
| </pfe-button> | ||
| </article> | ||
| </pfe-band> | ||
|
|
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.
Updating the demo page with the new size variant.
|
|
||
| | Theme hook | Default value | Region | | ||
| | --- | --- | --- | | ||
| | `--pfe-button--BackgroundColor` | var(--pfe-theme--color--ui-accent, #06c) | N/A | | ||
| | `--pfe-button--Color` | var(--pfe-theme--color--ui-base--text, #fff) | N/A | | ||
| | `--pfe-button--FontSize` | var(--pf-global--FontSize--md, 1rem) | N/A | | ||
| | `--pfe-button--FontWeight` | var(--pfe-theme--font-weight--normal, 400) | N/A | | ||
| | `--pfe-button--Padding` | calc(var(--pfe-theme--container-padding, 1rem) / 2) var(--pfe-theme--container-padding, 1rem) | N/A | | ||
| | `--pfe-button--BorderRadius` | var(--pfe-theme--surface--border-radius, 3px) | N/A | | ||
| | `--pfe-button--LineHeight` | var(--pfe-theme--line-height, 1.5) | N/A | | ||
| | `--pfe-button__after--Border` | var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor, transparent) | `after` | | ||
| | `--pfe-button--BackgroundColor--hover` | var(--pfe-theme--color--ui-accent--hover, #004080) | N/A | | ||
| | `--pfe-button__after--Border--hover` | var(--pfe-theme--ui--border-width, 1px) var(--pfe-theme--ui--border-style, solid) var(--pfe-button__after--BorderColor--hover, transparent) | `after` | | ||
| | `--pfe-button--FontWeight--large` | var(--pfe-theme--font-weight--semi-bold, 600) | N/A | | ||
| | `--pfe-button--Padding--large` | 12px 24px | N/A | |
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.
documenting the styling hooks.
| size: { | ||
| title: "Size", | ||
| type: String, | ||
| values: ["medium", "large"], | ||
| }, |
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.
"medium" is the default size if undefined. I've documented that above.
| const denyAttributeElement = ` | ||
| <pfe-button> | ||
| <button style="background: red;">Button</button> | ||
| </pfe-button> | ||
| `; |
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.
The React test runner freaks out over this inline styling attribute. JSX assumes that you are passing a properties object to the styles attribute specifically. Because, of course it does. :)
| /** | ||
| * @todo denyAttributeElement throws errors in React. We should an option to skip running | ||
| * tests in certain environments. | ||
| */ | ||
| // it("should not accept any deny list attributes from the light dom button", async () => { | ||
| // const el = await createFixture(denyAttributeElement); | ||
| // const shadowBtn = el.shadowRoot.querySelector("button"); | ||
| // expect(shadowBtn.hasAttribute("style")).to.be.false; | ||
| // }); |
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.
Commenting this test out for now.
kylebuch8
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.
Lawn: Green. 👍 Tomatoes: Moldy. 👎
Related issues
Preview
Link(s) to demo page(s) where this element can be viewed:
Testing instructions
<pfe-button size="large">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 patternfly-elements-contribute@redhat.com mailing list!