Title: CSS variable declaration throws error in customizer
Last modified: October 16, 2019

---

# CSS variable declaration throws error in customizer

 *  Resolved [nopewhy](https://wordpress.org/support/users/nopewhy/)
 * (@nopewhy)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/css-variable-declaration-throws-error-in-customizer/)
 * Hi,
 * I was trying to declare some custom color variables with `:root`, like this from
   an example from [Mozilla’s documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/:root):
 *     ```
       :root {
         --main-color: hotpink;
         --pane-padding: 5px 42px;
       }
       ```
   
 * Put said code in “Additional CSS” in the customizer, but it warns me and tells
   me that it
 * > expected RBRACE
 *  in every line with a variable/starting with `--`.
    Usually the customizer’s 
   warnings are correct and I forgot a curly bracket or a colon somewhere, but this
   time I guess it’s something else.
 * Is this a known bug? Is there a workaround or do I have to save my edits to my
   child theme’s style.css (which I’d like to avoid).
    I tried to google the problem
   but I didn’t find anything.
    -  This topic was modified 6 years, 7 months ago by [nopewhy](https://wordpress.org/support/users/nopewhy/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/css-variable-declaration-throws-error-in-customizer/#post-12036940)
 * Yes, this is known. The Code Mirror code that does the highlighting and checking
   needs to be updated for modern syntax. I think there is a core ticket for it 
   already.
 * [https://core.trac.wordpress.org/ticket/47434](https://core.trac.wordpress.org/ticket/47434)
   
   [https://core.trac.wordpress.org/ticket/44471](https://core.trac.wordpress.org/ticket/44471)
 *  Thread Starter [nopewhy](https://wordpress.org/support/users/nopewhy/)
 * (@nopewhy)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/css-variable-declaration-throws-error-in-customizer/#post-12037116)
 * Thank you, [@joyously](https://wordpress.org/support/users/joyously/), for pointing
   me to the relating tickets 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘CSS variable declaration throws error in customizer’ is closed to new
replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [root](https://wordpress.org/support/topic-tag/root/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [nopewhy](https://wordpress.org/support/users/nopewhy/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/css-variable-declaration-throws-error-in-customizer/#post-12037116)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
