Repository navigation
Style Hirarchy
The different layers (in this order!) of the ReactUI are:
- Base/Core
- Components
- Themes
- Schemes
When using the ReactUI as a library the first two layers mentioned above are bundled into a file called "main.css" it is advised to import this file first into your index.js/tsx file like I did in this project.
The Base is the deepest layer of our hirarchy and is the first one to get overwritten. It's used as general styling, positioning and displaying. As we are using PrimeReact components (menus, tables, editors etc.), we are using one of their themes as a base for our component styling. We are using the "Saga Blue" theme. The different themes can be found at the PrimeReact Website.
If you do not like the PrimeReact theme we have chosen, you are able to change it, but only if you use the ReactUI directly and not as a library.
- Go to the index.scss
- Change the first PrimeReact import to the theme you like.
Example:
//@import '~primereact/resources/themes/saga-blue/theme.css';
@import '~primereact/resources/themes/luna-green/theme.css';This is the layer which gets imported after the PrimeReact theme so it will overwrite it. For most components there is a scss files which overwrites some of the properties set of the theme or adds new ones.
If you want to change the components style there are two ways depending on if you use the ReactUI as library or not.
If you use the ReactUI directly, you can simply go into the scss file of the component you'd like to change and change the scss/css rule there. But you should first check out if the rule is not overwritten by a layer above or it will not work.
If you use the ReactUI as a library, you should first check out which selector is being used, for the style you want to change in the dev console. Then you can change the style in your project's own css/scss file.
The themes are used to set the component sizes mostly by changing their paddings/margins sometimes also width and height properties. They overwrite the base's sizes.
The color-schemes are used to edit the components backgrounds, text-colors, borders etc. everything which has to do with colors. It overwrites the base's colors.
How to use your own color-schme/theme can be found here