[Vuejs]-Match color prop to browser colors/hex/rgb aswell as color vars

0๐Ÿ‘

โœ…

So an approach to fixing this as proposed by @vrugtehagel is to use fallbacks, I have done this for all my color related CSS values and it worked fine.

Example:
background-color: var(--${this.bgColor}, ${this.bgColor});

Bear in mind this will always prioritize the custom -- prefixed values if a normal value with the same name is valid.

Leave a comment