Skip to content
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

Buttons: addHoverStyle, addFocusStyle, addActiveStyle default props have no effect #632

Closed
afercia opened this issue Jun 29, 2018 · 1 comment · Fixed by #650
Closed
Assignees
Labels

Comments

@afercia
Copy link
Contributor

afercia commented Jun 29, 2018

Continuing the investigation on button while attempting to build a test page for buttons, see #631 ,I've noticed that after the changes in d63570b the default props for the buttons hover, focus, and active styles don't have any effect.

Previously, these styles used the colors from the color palette. Now, they use colors from the props, with some default values set as defaultProps. However, these defaultProps are set on the wrapping styling functions: they're not component so props won't work there.

See for example

export function addHoverStyle( component ) {
where props is undefined within that function.

Instead, these default props should be set on the Button component itself, or any other component that makes use of addHoverStyle(), addFocusStyle(), and addActiveStyle(). See for example the YoastButton which makes use of props in its addButtonStyles() function, but the textColor is set to the component itself:

As a consequence, all buttons that are intended to rely on the default props, don't display any style change for the hover, focus, and active states. For example, the "Edit snippet" button is supposed to change the following styles when hovered:

  • color (it works because it uses a color from $colors)
  • background (doesn't work, it's a prop)
  • border (doesn't work, it's a prop)

This is how it looks like on hover:

now

And this is how it's supposed to look like:

should

Note: this applies also to the LinkButton component, it should set the default props to BaseLinkButton.

Needs #649

This was referenced Jul 6, 2018
@afercia afercia added the queue label Jul 6, 2018
@afercia
Copy link
Contributor Author

afercia commented Jul 6, 2018

Moving to queue / dev because it needs to be fixed to properly implement #627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants