Skip to content

Conversation

@kylebuch8
Copy link
Contributor

First pass at creating a button.

return true;
}

_parentObserverHandler(mutationList) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls to have code comment

background-color: #06c;
color: #fff;
font-size: 16px;
padding: 8px 16px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like this should be em, since it should be proportionate to the font size.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer we use the pfe-var and pfe-color functions and pull from the theme instead of hardcoding values 👍

Copy link
Contributor

@eyevana eyevana Jul 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@castastrophe I've updated as many variables as I could, but there were still a few I couldn't find or just didn't know how to use. For example, the red background color for the danger variant is #a30000, which maps to $pf-color-red-200 in_pf-colors.scss, but I couldn't figure out how to pull it into the component 😞. Also, in pfe-apply-broadcast(text), how can I specify that I want the fallback to be #151515 instead of #333333. I thought I could pass it as a second arg, but it screamed at me when I did.

color: #06c;

&:after {
border: 1px solid #06c;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS var for width and color?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wesruv I've added a var for color. Will this work? Or should I specify the width separately too?

$variables: (
  ...
  Border: 0,
  Border--after: 1px solid,
  BorderColor--after: transparent,
  BorderRadius: #{pfe-var(surface--border-radius)},
  ...
);

@kylebuch8 kylebuch8 changed the title feat: pfe-button component WIP feat: pfe-button component Jun 1, 2020
@coreyvickery
Copy link
Collaborator

@kylebuch8 @castastrophe Is further design support and/or documentation needed here?

@starryeyez024 starryeyez024 added the work in progress POC / Not ready for review label Jun 19, 2020
@coreyvickery
Copy link
Collaborator

We are good from the design side, we will be repurposing the same styles from PF.

@ajacobs21e
Copy link
Member

Is the button height 34px? That's what it looks like here https://deploy-preview-837--happy-galileo-ea79c4.netlify.app/elements/pfe-button/demo/
PF buttons and form inputs are both 36px

@castastrophe
Copy link
Contributor

Is the button height 34px? That's what it looks like here https://deploy-preview-837--happy-galileo-ea79c4.netlify.app/elements/pfe-button/demo/
PF buttons and form inputs are both 36px

@kylebuch8 Looking at the PF button styles here: https://www.patternfly.org/v4/documentation/react/components/button, it looks like we'll need to import or extend a few form spacing variables in our system since we don't have a 6px spacing variable at the moment. You'll also want to set the line-height for the button to 1.5. I can help with this if you like.

@castastrophe castastrophe added demo Updating demo pages docs Documentation updates functionality Functionality, typically pertaining to the JavaScript. styles An issue or PR pertaining only to CSS/Sass tests Related to testing tools Development and build tools labels Jul 14, 2020
Copy link
Contributor

@castastrophe castastrophe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! I went ahead and pushed up 2 simple commits - just cleaning up unneeded interpolation and moving the after identifier to a region rather than a modifier re: the BEM conventions.

@eyevana eyevana requested a review from castastrophe August 13, 2020 17:46
@castastrophe castastrophe removed the work in progress POC / Not ready for review label Aug 19, 2020
// set the _externalBtn, and initialize the component
_parentObserverHandler() {
if (!this._isValidLightDom()) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylebuch8
Just a comment, what happens if it was valid light DOM, but becomes invalid light DOM? Throw an error and maintain current state? Is that the right behavior in that circumstance, was thinking maybe it should get disabled?

Copy link
Contributor

@wesruv wesruv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a comment or two, but looks good to me code-wise!

@kylebuch8 kylebuch8 merged commit a56f268 into master Aug 20, 2020
@kylebuch8 kylebuch8 deleted the pfe-button branch August 20, 2020 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo Updating demo pages docs Documentation updates functionality Functionality, typically pertaining to the JavaScript. styles An issue or PR pertaining only to CSS/Sass tests Related to testing tools Development and build tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants