I'm using grommet-ui with webpack and react. How do I set my own color options.
Is there a way to use my own custom colors/color schemes in place of predefined colors like colorIndex="neutral-1".
I'm using grommet-ui with webpack and react. How do I set my own color options.
Is there a way to use my own custom colors/color schemes in place of predefined colors like colorIndex="neutral-1".
Yes, there is a way to override them, but it is currently not documented. I would start checking the colors here:
https://github.com/grommet/grommet/blob/master/src/scss/grommet-core/_settings.color.scss
For example,
neutral-1
is used from this array$brand-neutral-colors: (#5d0cfb, #7026ff, #767676) !default;
In your
index.scss
you can replace that (!default allows replacement):$brand-neutral-colors: (#333333, #7026ff, #767676)
We are working on adding documentation for custom theme variables.
Check the pre-packed themes from https://github.com/grommet/grommet/tree/master/src/js/themes and choose the one that's closest to your goal
Then write your own, but only the parts you want to change
Roll your complete theme by merging the pre-packed with your prefs like so:
Notice that some of the lines are failed experiments trying to overcome the flaky docs.
This exports a
recipesTheme
module to be used in the render method of App or whatever:There is this tool https://grommet-theme-builder.netlify.com/ that you can use to somehow see the effect of your changes.