Skip to content

Fix IconButton styles for hover, focus, and pressed.#4498

Merged
jordandrako merged 6 commits intomicrosoft:masterfrom
jordandrako:hotfix/IconButton-states-background
Apr 10, 2018
Merged

Fix IconButton styles for hover, focus, and pressed.#4498
jordandrako merged 6 commits intomicrosoft:masterfrom
jordandrako:hotfix/IconButton-states-background

Conversation

@jordandrako
Copy link
Copy Markdown
Contributor

@jordandrako jordandrako commented Apr 9, 2018

Pull request checklist

Description of changes

Fix IconButton styles when hovered, and pressed.

Normal:
image

Hovered:
image

Pressed:
image

Focus:
image

Disabled:
image

rootHovered: {
color: theme.palette.themeDarker
color: theme.palette.themeDarker,
backgroundColor: theme.palette.neutralLighter,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are there semantic color slots we can use for these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah.
semanticColors.buttonBackground = palette.neutralLighter (the color Ben requested for Hovered state)
semanticColors.buttonBackgroundHovered = palette.neutralLight (the color Ben requested for Pressed state)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome--if that's the case, I'd think we should use those instead so IconButton can pick up themes moving forward. @betrue-final-final @phkuo for FYI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alright, I'll change all those over. Is there a semanticColor for palette.themePrimary or leave those alone in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Jahnp One more review?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Totally fair--duh. I must have missed the background portion. There doesn't seem to a perfect match--menuIcon seems like the next closest, but it feels wrong to apply "menu" to something that isn't in a menu.

@phkuo -- is this a case where we'd want to consider a new slot, or is it acceptable to stretch the usage of an existing slot, like using menuIcon for the foreground of an icon button?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are three possible ones I'd use: menuIcon, menuHeader, or link.
@mikewheaton Does palette.themePrimary need to be replaced in scenarios like this? Doesn't it get its value from the theme HOC too?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jordandrako both palette and semantic colors theme. If uncustomized, semantic colors will pick up an appropriate palette color.

Don't try to "stretch" the meaning of a semantic slot too far, we shouldn't use menu slots for buttons. We do need new color slots for "text buttons", buttons that aren't outlined.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alright, then I think we should leave the themePrimary uses alone since they're applied to the IconButton's foreground color. @Jahnp cool?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, as long as having a mix of semantic & palette colors is fine, that works for me.

@betrue-final-final
Copy link
Copy Markdown
Member

MenuIcon seems like a shortsighted color name. Should it be "commandIcon"?

@dzearing
Copy link
Copy Markdown
Member

@MLoughry just a heads up

@jordandrako jordandrako merged commit 18ee1a0 into microsoft:master Apr 10, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icon button has imperceptible interaction states

5 participants