-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(material/theming): revise customizing-component-styles #22466
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
docs(material/theming): revise customizing-component-styles #22466
Conversation
abd4797
to
9330875
Compare
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.
minor comments - lgtm overall!
[Angular documentation](https://angular.io/guide/component-styles#view-encapsulation). You may | ||
also wish to take a look at | ||
also wish to take a review | ||
[_The State of CSS in Angular_](https://blog.angular.io/the-state-of-css-in-angular-4a52d4bd2700) |
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.
We're probably due for an update on The State of CSS in Angular with these new changes, this article is a bit dated (both date and content).
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.
Yeah, we should probably update our guidance once we drop IE11 support and we can throw our weight behind css variables (and maybe constructible stylesheets will be a thing by then, too)
This change updates the customizing-component-styles doc to give more specific guidance on overriding component styles. In particular: * Much stronger language to make it clear that this is not supported or recommended. * Reorganize content such that topics have a bit more cohesion/flow * Call out that layout/positioning styles on host elements are the only safe styles to apply. * Emphasize the perils of overrides in general
9330875
to
a3a83c6
Compare
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.
Editing review; a few minor suggestions.
### Component host elements | ||
|
||
For any Angular Material component, you can safely define custom CSS for a component's host element | ||
that affect the positioning or layout of that component, such as `margin`, `position`, `top`, |
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.
that affect the positioning or layout of that component, such as `margin`, `position`, `top`, | |
that affects the positioning or layout of that component, such as `margin`, `position`, `top`, |
|
||
### Internal component elements | ||
|
||
Avoid any custom styles or overrides on internal elements within a Angular Material components. |
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.
Avoid any custom styles or overrides on internal elements within a Angular Material components. | |
Avoid any custom styles or overrides on internal elements within Angular Material components. |
Removed stray word.
[Angular documentation](https://angular.io/guide/component-styles#view-encapsulation). You may | ||
also wish to take a look at | ||
also wish to review |
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.
also wish to review | |
also want to review |
The developer documentation style guide says to avoid this term.
// Add this to your global stylesheet after your theme setup | ||
.myapp-no-padding-dialog .mat-dialog-container { | ||
padding: 0; | ||
// Add this to your global stylesheet after including theme mixins. |
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.
// Add this to your global stylesheet after including theme mixins. | |
// Add this to your global style sheet after including theme mixins. |
Two words
affect the elements explicitly defined in your template. To affect descendants of components used | ||
in your template, you can use one of the following approaches: | ||
|
||
1. Define custom styles in a global stylesheet declared in the `styles` array of your `angular.json` |
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.
1. Define custom styles in a global stylesheet declared in the `styles` array of your `angular.json` | |
1. Define custom styles in a global style sheet declared in the `styles` array of your `angular.json` |
Two words
Editing review completed; a few minor suggestions.
…On Fri, Apr 16, 2021 at 4:31 PM Jeremy Elbourn ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In guides/customizing-component-styles.md
<#22466 (comment)>:
> [Angular documentation](https://angular.io/guide/component-styles#view-encapsulation). You may
-also wish to take a look at
+also wish to take a review
[_The State of CSS in Angular_](https://blog.angular.io/the-state-of-css-in-angular-4a52d4bd2700)
Yeah, we should probably update our guidance once we drop IE11 support and
we can throw our weight behind css variables (and maybe constructible
stylesheets will be a thing by then, too)
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#22466 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR4DPGQN6GDL355BXMTE233TJDCGLANCNFSM422GSROQ>
.
--
*--Teri Glover--*
*Technical Editor*
|
This change updates the customizing-component-styles doc to give more specific guidance on overriding component styles. In particular: * Much stronger language to make it clear that this is not supported or recommended. * Reorganize content such that topics have a bit more cohesion/flow * Call out that layout/positioning styles on host elements are the only safe styles to apply. * Emphasize the perils of overrides in general (cherry picked from commit 52ac1e4)
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. |
This change updates the customizing-component-styles doc to give more
specific guidance on overriding component styles. In particular:
recommended.
safe styles to apply.