o2r-project / o2r-UI

User interface for creating and examining Executable Research Compendia (ERC)
https://o2r.uni-muenster.de/
Apache License 2.0
3 stars 5 forks source link

Use theme provided by theme.js file and not css. #197

Open njakuschona opened 3 years ago

njakuschona commented 3 years ago

In the [theme.js] every used color should be written. (Primary, Seccondary, warning, success, error, ...) These colors should be used throughout the UI and imported from the Theme instead of setting them in the css files. For example in the check.css

success {
    color: #008643;
}

The theme of the color should be used instead.

How To:

  1. import the Theme to the check.js file import { useTheme } from '@material-ui/core/styles';
  2. use the Theme
    function Status(status) {
    const theme = useTheme();
    switch (status.status) {
        case 'success':
            return <span style={{"color": theme.palette.success.main}}>Success</span>
njakuschona commented 3 years ago

belongs to #191

nuest commented 3 years ago

See also first changes in #199

nuest commented 3 years ago

It's enough for now that for our OJS use case that the use can set the important theme values manually.