-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(material/toolbar): minor doc fixes #29227
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
Conversation
| "file":"toolbar-multirow-example.css", | ||
| "region":"toolbar-position-content-style"}) --> | ||
|
|
||
| ### Theming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this doc comment be updated as well since that generates what is on the API tab? https://github.com/angular/components/blob/main/src/material/toolbar/toolbar.ts#L49.
Maybe something like: /** Palette color of the toolbar. Not recommended in M3, for more information see https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants. */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes definitely - I'm thinking we'll have one single PR that goes around to update all color inputs with some consistent message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If color is not supported in MD3 or not recommended, then why keep using it in the angular material page? Its misguiding. (Also, I personally am against toolbar not having a pallete color, I find it hostile to how a business wants to present its brand.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in #28805 (comment) I made a comment of how to adapt theme colors to the toolbar.
Option 1:
@mixin app-theme($theme, $type: "light") {
@if $type == "light" {
@include mat.all-component-themes($theme);
.mat-toolbar {
--mat-toolbar-container-text-color: #{mat.get-theme-color(
$theme,
primary,
100
)};
--mat-toolbar-container-background-color: #{mat.get-theme-color(
$theme,
primary
)};
--mdc-icon-button-icon-color: #{mat.get-theme-color(
$theme,
primary,
100
)};
}
} @else {
@include mat.all-component-colors($theme);
.mat-toolbar {
--mat-toolbar-container-text-color: #{mat.get-theme-color(
$theme,
primary
)};
--mat-toolbar-container-background-color: #{mat.get-theme-color(
$theme,
primary
)};
--mdc-icon-button-icon-color: #{mat.get-theme-color($theme, primary, 20)};
}
}
}
html {
// .app-light-theme (default)
@include app-theme($app-light-theme, "light");
.app-dark-theme {
@include app-theme($app-dark-theme, "dark");
}
@media (prefers-color-scheme: light) {
.app-auto-theme {
@include app-theme($app-light-theme, "light");
}
}
@media (prefers-color-scheme: dark) {
.app-auto-theme {
@include app-theme($app-dark-theme, "dark");
}
}
}
Option 2:
@mixin app-theme($theme, $type: "light") {
@if $type == "light" {
@include mat.all-component-themes($theme);
.mat-toolbar {
background: mat.get-theme-color($theme, primary);
.mat-mdc-icon-button {
color: mat.get-theme-color($theme, primary, 100);
}
}
} @else {
@include mat.all-component-colors($theme);
.mat-toolbar {
background: mat.get-theme-color($theme, primary);
.mat-mdc-icon-button {
color: mat.get-theme-color($theme, primary, 20);
}
}
}
}
html {
// .app-light-theme (default)
@include app-theme($app-light-theme, "light");
.app-dark-theme {
@include app-theme($app-dark-theme, "dark");
}
@media (prefers-color-scheme: light) {
.app-auto-theme {
@include app-theme($app-light-theme, "light");
}
}
@media (prefers-color-scheme: dark) {
.app-auto-theme {
@include app-theme($app-dark-theme, "dark");
}
}
}
Any Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I empathize with wanting color in the toolbar - we also think it looks better for branding. However, we're beholden to the spec and designers here, and our goal is to match their direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reply. I understand, is the Angular Material page be updated to adhere to the specs? As it is it, I believe it contributes to the confusion.
(cherry picked from commit b4d01dc)
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.