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): theme font color being overwritten #9771

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

devversion
Copy link
Member

@devversion devversion commented Feb 3, 2018

Updated version of #9536

  • Currently buttons with a background color (e.g. flat buttons, raised buttons, fabs) receive a font color by the theme. This font color is accidentally being overwritten by the normal button CSS that sets the color for every button to inherit. This can cause the text to be invisible in a dark theme. From now on, those buttons will no longer inherit the font color accidentally.

  • Normal buttons, stroked buttons and icon buttons will still inherit the font color, because it's wrong to assume that those buttons are always placed inside of containers with the default background color. Otherwise those buttons would be invisible in some containers with a different background color (e.g. in a themed toolbar).

  • Removes the SSR check for hasHostAttributes. This method is essential for the color of the buttons, and needs to run inside of SSR. (now possible with Domino anyway)

  • Cleans up the button theme while being at it.

Fixes #4614. Fixes #9231. Fixes #9634

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 3, 2018
@devversion devversion changed the title fix(button): no color set for flat, stroked and icon buttons fix(button): no color set for normal, stroked and icon buttons Feb 3, 2018
@devversion devversion force-pushed the fix/no-color-plain-buttons branch from 5f96312 to 1725324 Compare February 3, 2018 15:26
@devversion
Copy link
Member Author

@jelbourn I differentiated between normal and flat buttons, because before, the normal buttons have been called flat buttons.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, @mmalerba should look at the form-field bits

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Feb 7, 2018
Copy link
Contributor

@tinayuangao tinayuangao left a comment

Choose a reason for hiding this comment

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

LGTM

@devversion devversion added the target: patch This PR is targeted for the next patch release label Feb 8, 2018
@mmalerba mmalerba added presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged and removed action: merge The PR is ready for merge by the caretaker labels Feb 8, 2018
@mmalerba
Copy link
Contributor

mmalerba commented Feb 8, 2018

caretaker note: there's a number of broken screendiffs where the button color is wrong (black on dark themes, etc)

@devversion devversion force-pushed the fix/no-color-plain-buttons branch from f35a666 to f3b930b Compare February 10, 2018 11:12
@devversion devversion changed the title fix(button): no color set for normal, stroked and icon buttons fix(button): theme font color being overwritten Feb 10, 2018
* Currently buttons with a background color (e.g. flat buttons, raised buttons, fabs) receive a font color by the theme. This font color is accidentally being overwritten by the normal button CSS that sets the `color` for every button to `inherit`. This can cause the text to be invisible in a dark theme. From now on, those buttons will no longer inherit the font color accidentally.

* Normal buttons, stroked buttons and icon buttons will still inherit the font color, because it's wrong to assume that those buttons are always placed inside of containers with the default background color. Otherwise those buttons would be invisible in some containers with a different background color (e.g. in a  themed toolbar).

* Removes the SSR check for `hasHostAttributes`. This method is essential for the color of the buttons, and needs to run inside of SSR. (now possible with Domino anyway)

* Cleans up the button theme while being at it.

Fixes angular#4614. Fixes angular#9231. Fixes angular#9634
@devversion devversion force-pushed the fix/no-color-plain-buttons branch from f3b930b to 32b234e Compare February 10, 2018 11:14
@devversion
Copy link
Member Author

@jelbourn @mmalerba Updated to what we discussed on Slack.

@devversion devversion removed pr: lgtm presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged labels Feb 10, 2018
@devversion
Copy link
Member Author

Just a ping for review. As mentioned in the standup. This is pretty high priority IMO.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Feb 13, 2018
@devversion devversion added P2 The issue is important to a large percentage of users, with a workaround P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed P2 The issue is important to a large percentage of users, with a workaround labels Feb 19, 2018
@EreckGordon
Copy link

changes were approved a month ago, looks like CI failed because of rate limit exceeded or missing tokens, any idea when this will be merged?

@jelbourn jelbourn added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Mar 16, 2018
@andrewseguin andrewseguin merged commit c3a8d0c into angular:master Mar 19, 2018
@ilDon
Copy link

ilDon commented Apr 24, 2018

Has this been solved in 5.2.5? I'm still having this issue in 5.2.5..

@mmalerba
Copy link
Contributor

This is tagged as a release: major change, so it'll be in 6.0

@devversion devversion deleted the fix/no-color-plain-buttons branch April 24, 2018 17:25
@LoganDark
Copy link

If your font color is black in a dark theme, that's your problem, not the button's.

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: major This PR is targeted for the next major release
Projects
None yet
10 participants