You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: theme-config.md
+18-10
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@ Customize Material-UI with your theme. You can change the colors, the typography
8
8
9
9
## Theme configuration
10
10
11
-
The Entire theme can be configured from the folder **`..\src\themes`** . Theme initialization starts in`index.js` , where palette, typography, and component's overridable style exist.
11
+
The Entire theme can be configured from the folder **`..\src\themes`** . Theme initialization starts in**`index.js`** , where palette, typography, and component's overridable style exist.
importvaluefrom'../assets/scss/_themes-vars.module.scss'; // central place for all colors
@@ -80,8 +81,9 @@ export function theme(customization) {
80
81
exportdefaulttheme;
81
82
82
83
```
84
+
{% endcode %}
83
85
84
-
As you can see colors for the theme came from the central location `import value from '../assets/scss/_themes-vars.module.scss';`
86
+
As you can see colors for the theme came from the central location ``**`import value from '../assets/scss/_themes-vars.module.scss';`**
85
87
86
88
```css
87
89
// Paper & Background Color
@@ -155,18 +157,19 @@ $textDarkTitle: #d7dcec;
155
157
156
158
```
157
159
158
-
You can check other settings like theme typography, palette, and components style override in the same folder. `..src\themes`
160
+
You can check other settings like theme typography, palette, and components style override in the same folder. **`..src\themes`**
159
161
160
162
### How to customize it?
161
163
162
-
You might come across questions like how to change a theme's primary color? How to change textbox or other components which can apply to an entire theme? etc.
164
+
You might come across questions like how to change a theme's **primary** color? How to change textbox or other components which can apply to an entire theme?
163
165
164
-
#### Customize theme Colors
166
+
#### Customize Theme Colors
165
167
166
168
To change the color of the theme, you can either apply color directly to `..src\theme\palatte.js`**or** defines a new variable in `..src\assets\scss\_themes-vars.module.scss` and replace it in `palatte.js`
167
169
168
-
For instance, you want to change color where `theme.palette.primary.light` is being used in a theme then, update following in `..src\themes\palatte.js`
170
+
For instance, if you want to change color where `theme.palette.primary.light` is being used in a theme then, update following in **`..src\themes\palatte.js`**
@@ -187,13 +190,15 @@ export function themePalatte(theme) {
187
190
}
188
191
189
192
```
193
+
{% endcode %}
190
194
191
-
#### Customize theme Typography
195
+
#### Customize Theme Typography
192
196
193
197
You can customize the typography used in the theme as well from the central place.
194
198
195
-
For instance, you want to change `font-weight` of the typography `h5` to `900` which is set `500` in theme. To do that, open `..src\themes\typography.js` and update as below:
199
+
For instance, If you want to change `font-weight` of the typography `h5` to `900`. To do that, open **`..src\themes\typography.js`** and update as below:
196
200
201
+
{% code title="typography.js" %}
197
202
```javascript
198
203
/**
199
204
* Typography used in theme
@@ -210,15 +215,17 @@ export function themeTypography(theme) {
210
215
}
211
216
212
217
```
218
+
{% endcode %}
213
219
214
-
This will apply to all places where you used Typography variant as `h5`
220
+
This will apply to all places where you used Typography variant as **`h5`**
215
221
216
222
**`<Typography variant="h5"...>`**
217
223
218
224
#### Customize MUI Component style
219
225
220
-
We provided a central location to override any default style of any component. All the overrides style exist in `src\themes\compStyleOverride.js`
226
+
We have provided a central location to override any default style of any component. All the overrides style exist in **`src\themes\compStyleOverride.js`**
@@ -249,6 +256,7 @@ export function componentStyleOverrides(theme) {
249
256
}
250
257
251
258
```
259
+
{% endcode %}
252
260
253
261
You can add default property for any MUI component and it will be applied everywhere. We emitted lines to view it better in the above code block but you can see many controls' styles override in the same file. Feel free to change it as per your need.
0 commit comments