File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -740,7 +740,7 @@ protected function extractCustomProperties()
740740 // PHP only supports $this inside anonymous functions since 5.4
741741 $ minifier = $ this ;
742742 $ this ->registerPattern (
743- '/(?<=^|[;}])(--[^:;{}" \'\s]+)\s*:([^;{}]+)/m ' ,
743+ '/(?<=^|[;}])\s* (--[^:;{}" \'\s]+)\s*:([^;{}]+)/m ' ,
744744 function ($ match ) use ($ minifier ) {
745745 $ placeholder = '--custom- ' . count ($ minifier ->extracted ) . ':0 ' ;
746746 $ minifier ->extracted [$ placeholder ] = $ match [1 ] .': ' . trim ($ match [2 ]);
Original file line number Diff line number Diff line change @@ -832,6 +832,17 @@ public function dataProvider()
832832 ':root{--some-var:0px}.some-class{margin-left:calc(20px + var(--some-var))} ' ,
833833 );
834834
835+ // https://github.com/matthiasmullie/minify/issues/378
836+ $ tests [] = array (
837+ ':root {
838+ --some-var: 0px;
839+ }
840+ p {
841+ margin-left: calc(20px + var(--some-var));
842+ } ' ,
843+ ':root{--some-var:0px}p{margin-left:calc(20px + var(--some-var))} '
844+ );
845+
835846 return $ tests ;
836847 }
837848
You can’t perform that action at this time.
0 commit comments