Import color variables to my styles

You can define a separate js file colors.js, that consists of the colors object and export it.

export const COLORS = {
  white: '#fff',
  black: '#000',
  // your colors
}

Now import COLORS from the above fileimport {COLORS} from './<Path>/colors.js' in your respective file that uses the defined colors. And use it as shown below.

button: {
  color: COLORS.white,
  backgroundColor: COLORS.black
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)