sabberworm / PHP-CSS-Parser

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS

Home Page:http://www.sabberworm.com/blog/2010/6/10/php-css-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue with var on multiline

Ruud68 opened this issue · comments

commented

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;
}
ezoic increase your site revenue