Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

feat(theme): add contrast opacity values for all color types and hues #11376

Merged
merged 2 commits into from
Jul 1, 2020

Conversation

Splaktar
Copy link
Contributor

@Splaktar Splaktar commented Jul 20, 2018

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number:
N/A

What is the new behavior?

  • Add opacity keyword support (secondary, icon, disabled, hint, divider)
  • Deprecate documentation of foreground-* in favor of background-default-contrast-*
  • Allow foregroundPalette to override colors on default background and hues of equal contrast type

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This is based on @clshortfuse's PR #8872.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added the cla: no PR author needs to sign Google's CLA: https://opensource.google.com/docs/cla/ label Jul 20, 2018
@Splaktar Splaktar self-assigned this Jul 20, 2018
@Splaktar Splaktar added this to the 1.1.11 milestone Jul 20, 2018
@Splaktar Splaktar added a11y This issue is related to accessibility g3: reported The issue was reported by an internal or external product team. P1: urgent Urgent issues that should be addressed in the next minor or patch release. ui: theme needs: manual testing This issue or PR needs to have some manual testing and verification done labels Jul 20, 2018
@Splaktar
Copy link
Contributor Author

Splaktar commented Jul 20, 2018

TODO

  • Test basic features of md-colors
  • Test dark modes
  • Test demos of all components
  • Test if this fixes bug(input): placeholder text inside toolbar is difficult to read #7987
  • Look into dark mode issues with tab demos
  • Look into dark mode issues with button demos
  • Look into dark mode issues with bottom sheet demos
  • Look into dark mode issues with whiteframes (in whiteframe and custom chips demos)

Opened #11458 to track adding support for contrast parameter in md-colors.

@Splaktar
Copy link
Contributor Author

This PR alone doesn't fix #7987 but I've addressed that fix in PR #11378 which is layered on top of this branch.

@Splaktar Splaktar added in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs and removed needs: manual testing This issue or PR needs to have some manual testing and verification done labels Jul 20, 2018
@Splaktar
Copy link
Contributor Author

PR #11380 open for Bottom Sheet dark theme issues.

@Splaktar
Copy link
Contributor Author

Opened PR #11381 to address the various dark mode demo issues which don't appear to be related to this PR at all.

@clshortfuse
Copy link
Contributor

Looking good.

I don't have the time to review all these changes, but good to see my work not going to waste.

mmalerba pushed a commit that referenced this pull request Jul 26, 2018
<!-- 
Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed.
-->
## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Enhancement
[x] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?
Button, chips, whiteframe, and tabs demos are significantly broken in dark mode.
This makes testing theme or component changes in dark mode more difficult.
<!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. -->
Issue Number: 
Relates to #11376

## What is the new behavior?
- better support for dark mode in docs and demos
- style anchors to be more readable in dark mode
- fix site-toolbar in dark mode and remove unused styles
- fix supported browsers table in dark mode
- fix button, chips, tabs, whiteframe demos in dark mode

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
Splaktar added a commit that referenced this pull request Jul 31, 2018
<!-- 
Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed.
-->
## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Enhancement
[x] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?
Button, chips, whiteframe, and tabs demos are significantly broken in dark mode.
This makes testing theme or component changes in dark mode more difficult.
<!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. -->
Issue Number: 
Relates to #11376

## What is the new behavior?
- better support for dark mode in docs and demos
- style anchors to be more readable in dark mode
- fix site-toolbar in dark mode and remove unused styles
- fix supported browsers table in dark mode
- fix button, chips, tabs, whiteframe demos in dark mode

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
Splaktar added a commit that referenced this pull request Aug 2, 2018
<!-- 
Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed.
-->
## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Enhancement
[x] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?
Button, chips, whiteframe, and tabs demos are significantly broken in dark mode.
This makes testing theme or component changes in dark mode more difficult.
<!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. -->
Issue Number: 
Relates to #11376

## What is the new behavior?
- better support for dark mode in docs and demos
- style anchors to be more readable in dark mode
- fix site-toolbar in dark mode and remove unused styles
- fix supported browsers table in dark mode
- fix button, chips, tabs, whiteframe demos in dark mode

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch from a04cdd2 to 1484552 Compare September 25, 2018 23:08
@Splaktar Splaktar added type: enhancement pr: merge ready This PR is ready for a caretaker to review and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Sep 25, 2018
@Splaktar Splaktar modified the milestones: 1.1.11, 1.2.0 Oct 20, 2018
@Splaktar Splaktar removed the pr: merge ready This PR is ready for a caretaker to review label Oct 20, 2018
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch from 75b4b37 to 0fbf631 Compare August 26, 2019 16:55
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch from 0fbf631 to 90773f0 Compare August 26, 2019 16:59
Splaktar added a commit that referenced this pull request Aug 26, 2019
@Splaktar Splaktar added pr: merge ready This PR is ready for a caretaker to review and removed pr: presubmit-failures labels Jun 30, 2020
@Splaktar Splaktar requested a review from mmalerba June 30, 2020 00:46
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch from 90773f0 to a3cf860 Compare June 30, 2020 00:59
@Splaktar
Copy link
Contributor Author

Splaktar commented Jun 30, 2020

Rebased, squashed, and updated.

TODO:

  • Review how this could break existing apps and provide a BREAKING CHANGE: note in commit message if necessary
  • Determine if the Theming Guides need updates after these changes and whether that should be done in a separate PR

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

Add opacity keyword support (`secondary`, `icon`, `disabled`, `hint`, `divider`)
Deprecate documentation of `foreground-*` in favor of `background-default-contrast-*`
Allow `foregroundPallete` to override colors on default background and hues of equal contrast type
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch from a3cf860 to b294cf0 Compare June 30, 2020 23:07
@Splaktar Splaktar removed the request for review from mmalerba June 30, 2020 23:07
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch 2 times, most recently from 3b85682 to a9a8eca Compare June 30, 2020 23:37
@Splaktar
Copy link
Contributor Author

I don't believe that the changes to the internal mini-DSL for defining theme files in components should cause any breakages to apps built with the library.

There may be some impacts to angular/material-tools and we'll likely need to do a new release for it when we ship 1.2.0. This is tracked in angular/material-tools#46.

…lint issues

- fix lint warning of unnecessary escape in regex and missing colon
- resolve test failures after merge
- `md-colors` demos general cleanup and fix URLs and icons
- clarify how to map the old foreground expressions in theming docs
- update links to opacity requirements for icons
- clean up Theming implementation guide
@Splaktar Splaktar force-pushed the mdTheme-contrastOpacities branch from a9a8eca to a03aa2a Compare June 30, 2020 23:57
@Splaktar Splaktar merged commit 01917b3 into master Jul 1, 2020
@Splaktar Splaktar deleted the mdTheme-contrastOpacities branch July 1, 2020 00:14
Splaktar added a commit that referenced this pull request Jul 1, 2020
Splaktar added a commit that referenced this pull request Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility cla: no PR author needs to sign Google's CLA: https://opensource.google.com/docs/cla/ g3: reported The issue was reported by an internal or external product team. P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review type: enhancement ui: theme
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants