Skip to content

Commit 229dc5e

Browse files
Josh Hallkara
Josh Hall
authored andcommitted
docs(theming): fix inconsistent theme variables (#4195)
1 parent 0b9b582 commit 229dc5e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

guides/theming.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ A custom theme file does two things:
5757
1. Imports the `mat-core()` sass mixin. This includes all common styles that are used by multiple
5858
components. **This should only be included once in your application.** If this mixin is included
5959
multiple times, your application will end up with multiple copies of these common styles.
60-
2. Defines a **theme** data structure as the composition of multiple palettes. This object can be
61-
created with either the `mat-light-theme` function or the `mat-dark-theme` function. The output of
60+
2. Defines a **theme** data structure as the composition of multiple palettes. This object can be
61+
created with either the `mat-light-theme` function or the `mat-dark-theme` function. The output of
6262
this function is then passed to the `angular-material-theme` mixin, which will output all of the
6363
corresponding styles for the theme.
6464

@@ -105,7 +105,7 @@ node-sass src/unicorn-app-theme.scss dist/unicorn-app-theme.css
105105
and then include the output file in your index.html.
106106

107107
The theme file **should not** be imported into other SCSS files. This will cause duplicate styles
108-
to be written into your CSS output. If you want to consume the theme definition object
108+
to be written into your CSS output. If you want to consume the theme definition object
109109
(e.g., `$candy-app-theme`) in other SCSS files, then the definition of the theme object should be
110110
broken into its own file, separate from the inclusion of the `mat-core` and
111111
`angular-material-theme` mixins.
@@ -119,8 +119,8 @@ styles will be subject to that component's [view encapsulation](https://angular.
119119
You can create multiple themes for your application by including the `angular-material-theme` mixin
120120
multiple times, where each inclusion is gated by an additional CSS class.
121121

122-
Remember to only ever include the `@mat-core` mixin only once; it should not be included for each
123-
theme.
122+
Remember to only ever include the `@mat-core` mixin only once; it should not be included for each
123+
theme.
124124

125125
##### Example of defining multiple themes:
126126
```scss
@@ -148,25 +148,25 @@ $dark-warn: mat-palette($mat-deep-orange);
148148
$dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn);
149149

150150
// Include the alternative theme styles inside of a block with a CSS class. You can make this
151-
// CSS class whatever you want. In this example, any component inside of an element with
152-
// `.unicorn-dark-theme` will be affected by this alternate dark theme instead of the default theme.
151+
// CSS class whatever you want. In this example, any component inside of an element with
152+
// `.unicorn-dark-theme` will be affected by this alternate dark theme instead of the default theme.
153153
.unicorn-dark-theme {
154154
@include angular-material-theme($dark-theme);
155155
}
156156
```
157157

158-
In the above example, any component inside of a parent with the `unicorn-dark-theme` class will use
158+
In the above example, any component inside of a parent with the `unicorn-dark-theme` class will use
159159
the dark theme, while other components will fall back to the default `$candy-app-theme`.
160160

161-
You can include as many themes as you like in this manner. You can also `@include` the
162-
`angular-material-theme` in separate files and then lazily load them based on an end-user
161+
You can include as many themes as you like in this manner. You can also `@include` the
162+
`angular-material-theme` in separate files and then lazily load them based on an end-user
163163
interaction (how to lazily load the CSS assets will vary based on your application).
164164

165165
It's important to remember, however, that the `mat-core` mixin should only ever be included _once_.
166166

167167
##### Multiple themes and overlay-based components
168168
Since certain components (e.g. menu, select, dialog, etc.) are inside of a global overlay container,
169-
an additional step is required for those components to be affected by the theme's css class selector
169+
an additional step is required for those components to be affected by the theme's css class selector
170170
(`.unicorn-dark-theme` in the example above).
171171

172172
To do this, you can specify a `themeClass` on the global overlay container. For the example above,
@@ -209,13 +209,13 @@ $candy-app-accent: mat-palette($mat-pink, A200, A100, A400);
209209
$candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent);
210210

211211
// Include the theme styles for only specified components.
212-
@include mat-core-theme($theme);
213-
@include mat-button-theme($theme);
214-
@include mat-checkbox-theme($theme);
212+
@include mat-core-theme($candy-app-theme);
213+
@include mat-button-theme($candy-app-theme);
214+
@include mat-checkbox-theme($candy-app-theme);
215215
```
216216

217217
### Theming your own components
218-
For more details about theming your own components,
218+
For more details about theming your own components,
219219
see [theming-your-components.md](./theming-your-components.md)
220220

221221
### Future work

0 commit comments

Comments
 (0)