PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

issue with var on multiline

Open Ruud68 opened this issue 4 years ago • 1 comments

Hi, having an issue with vars that are 'styled' on multiple lines (on latest commit dd jan 10, 2022):

This works correct:

:root {
	--my-color: 255, 0, 0;
	--my-opacity: 210;
}

body {
	background-color: rgba(var(--my-color), var(--my-opacity)) !important;
}

it renders to:

:root {
	--my-color: 255, 0, 0;
	--my-opacity: 210;
}

body {
	background-color: rgba(var(--my-color), var(--my-opacity)) !important;
}

but this doesn't work correct:

:root {
	--my-color: 255, 0, 0;
	--my-opacity: 210;
}

body {
	background-color: rgba(
		var(--my-color),
		var(--my-opacity)
	) !important;
}

it renders to:

:root {
        --my-color: 255, 0, 0;
        --my-opacity: 210;
}

body {}

This is only the case when using vars, as the following is styled the same and works correct:

:root {
	--my-color: 255, 0, 0;
	--my-opacity: 210;
}

body {
	background-color: rgba(
		255,
		234,
		231,
		210
	) !important;
}

this renders to:

:root {
        --my-color: 255, 0, 0;
        --my-opacity: 210;
}

body {
        background-color: rgba(255, 234, 231, 210) !important;
}

Ruud68 avatar Jan 13 '22 09:01 Ruud68

Fixed by #202

raxbg avatar Sep 20 '22 04:09 raxbg