Title: Broken variables/rgb values
Last modified: August 4, 2025

---

# Broken variables/rgb values

 *  Resolved [aaron13223](https://wordpress.org/support/users/aaron13223/)
 * (@aaron13223)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/broken-variables-rgb-values/)
 * Hi There,
   I recently ran into a problem where the variables inside the optimized
   CSS files are broken.The original value is something like: `--pico-color: rgb(
   255 123 85);`
 * And after minification, it changes to: `--pico-color: #ff;`
 * Basically breaking that line and reverting the color on some elements to their
   inherited value.
 * Would you have an idea as to why this might be happening and if there’s anything
   we can do to fix this?
 * If I go in and edit the css files and give them hex color values instead of rgb,
   that fixes the problem temporarily however I would still like to use the the 
   rgb values….
 * Another interesting observation is that in the code below, only the last variable
   would be broken `--pico-color`
 *     ```wp-block-code
       .button-secondary {    --pico-background-color: rgb(255 123 85 / 10%);    --pico-border-color: rgb(255 123 85 / 10%);    --pico-color: rgb(255 123 85);    font-weight: 600;}
       ```
   
 * Let me know what you think and thanks a lot for your help!

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/broken-variables-rgb-values/#post-18584819)
 * Afraid that’s how [the integrated 3rd party CSS minifier](https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/)
   works, it seems [the 2 other lines do not match the regex (due to the `/ 10%`](https://regex101.com/r/DmrEq6/1)
   and hence are “protected” from the wrongful minification. hex instead of rgb 
   is one solution, another could be to add `/ 100%` to the `--pico-color` line 
   and lastly you could exclude the file that contains the CSS from being minified?
 * hope this helps,
    frank
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 months, 4 weeks ago](https://wordpress.org/support/topic/broken-variables-rgb-values/#post-18729737)
 * any news on this (old) subject [@aaron13223](https://wordpress.org/support/users/aaron13223/)?
   🙂
 *  Thread Starter [aaron13223](https://wordpress.org/support/users/aaron13223/)
 * (@aaron13223)
 * [4 months, 4 weeks ago](https://wordpress.org/support/topic/broken-variables-rgb-values/#post-18731327)
 * Hi [@optimizingmatters](https://wordpress.org/support/users/optimizingmatters/),
   
   I have now been using variables to update the rgb values and that does not cause
   issues. Thanks for your help.If possible, I would really appreciate it if in 
   the future the regex rules can be updated so this doesn’t happen. Regardless,
   thanks a lot for this great plugin:)

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbroken-variables-rgb-values%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [aaron13223](https://wordpress.org/support/users/aaron13223/)
 * Last activity: [4 months, 4 weeks ago](https://wordpress.org/support/topic/broken-variables-rgb-values/#post-18731327)
 * Status: resolved