Last updated
Last updated
Customize Berry with your theme. You can change the colors, the typography, and much more. Material-UI provides flexibility to change the style of the project in a single place and on top of it, we made it more centralize and consistent by proper file structure.
The whole theme can be configured from the folder ..\src\themes
. Theme initialization starts inindex.js
, where palette, typography, and component's overridable style exist.
As you can see colors for the theme came from the central location
import value from '../assets/scss/_themes-vars.module.scss';
You can check other settings like theme typography, palette, and components style override in the same folder. ..src\themes
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?
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
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
You can customize the typography used in the theme as well from the central place.
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:
This will apply to all places where you used Typography variant as h5
<Typography variant="h5"...>
We have provided a central location to override any default style of any component. All the overrides style exist in src\themes\compStyleOverride.js
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.
Defines core of theme. How theme is being set using Material-UI.