Forum Feature requests

RGB colors: support space separated syntax

RemkoNolten
I was wowndering: Is it possible to support the 'newer' CSS syntax for defining RGB colors (as defined in CSS Colors Level 4, see also https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb):

rgb(r g b / a)


We use CSS-variables to theme our white-labeled product and using this syntax you can basically combine a separately defined alpha channel together with a color from an existing CSS variable.

:root {
  --color-red: 255 0 0 
}

.element-with-opactiy {
  background-color: rgb(var(--color-red) / 0.5)
}


During my testing, I noticed that Prince doesn't understand the space separated syntax, let alone using it in combination with CSS-variables. Is this a possible feature to add in the future?
mikeday
We will look into this.
wangp
The latest build now supports the css-color-4 syntax for rgb()/rgba() and hsl()/hsla(), not including 'none' components.