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

fix(button): focus state matches spec #467

Merged
merged 2 commits into from
Jun 2, 2016
Merged

Conversation

jelbourn
Copy link
Member

@jelbourn jelbourn commented May 19, 2016

R: @robertmesserle @kara

Also, @traviskaufman, could you verify that I'm interpreting the spec correctly here?

Closes #420

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 19, 2016
background-color: md-color($md-foreground, base, 0.12);
@include md-button-theme('background-color', 600);
&.md-button-focus:after {
// The button spec calls for focus on rasied buttons (and FABs) to be indicated with a
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: rasied => raised

bottom: 0;
right: 0;
content: '';
background-color: rgba(black, 0.12);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably want to include pointer-events: none. Not sure if it's fully necessary in our use-case, but it's possibly that the pseudo element can intercept click events without it.

Copy link
Member

@devversion devversion May 19, 2016

Choose a reason for hiding this comment

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

This color should be able to be picked from $md-foreground with the hue-key divider? But I see, it was previously already taken from the palettes. Maybe it's intentionally?

Copy link
Member Author

Choose a reason for hiding this comment

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

According to the spec, this shade should always be black 12% opacity regardless of theme.

Copy link
Contributor

Choose a reason for hiding this comment

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

The UX treatments LGTM. However this looks like it only applies to raised buttons. Flat buttons still seem to be styled using background color. Is the intent to style the two types of buttons using different strategies?

@jelbourn
Copy link
Member Author

@robertmesserle comments addressed

background-color: md-color($md-accent, 600);
// The focus shading for FABs needs to match the FAB's circular shape.
&.md-button-focus:after {
border-radius: 50%;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to use border-radius: inherit in the declaration above instead? This way it will also respect the border radii for normal flat + raised buttons.

@jelbourn
Copy link
Member Author

@kara I followed Travis' advice and unified the focus styles to all be done the same way. Can you take another look?

@kara
Copy link
Contributor

kara commented Jun 2, 2016

LGTM

@jelbourn jelbourn merged commit b24d321 into angular:master Jun 2, 2016
@jelbourn jelbourn deleted the fab-focus branch September 13, 2017 04:36
andrewseguin added a commit to andrewseguin/components that referenced this pull request Oct 15, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Focus indicators on md-fab is really subtle
6 participants