Skip to content

Commit

Permalink
Drop empty unit restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
zoglo committed Mar 28, 2024
1 parent e1dc124 commit b85bd22
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/Compiler/FileCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,24 +579,14 @@ protected function isValidValue($varValue): array
}

// top,right,bottom,left / unit
if (array_key_exists('top', $varValue) && (!$varValue['unit'] || $varValue['top']==''))
if (array_key_exists('top', $varValue) && $varValue['top']=='')
{
if (strpos($varValue['top'], '$') === 0)
{
return [false, $varValue['top']];
}

return [false, ''];
}

// value / unit
if (array_key_exists('unit', $varValue) && !array_key_exists('top', $varValue) && (!$varValue['unit'] || $varValue['value']==''))
if (array_key_exists('unit', $varValue) && !array_key_exists('top', $varValue) && $varValue['value']=='')
{
if (strpos($varValue['value'], '$') === 0)
{
return [false, $varValue['value']];
}

return [false, ''];
}

Expand Down

0 comments on commit b85bd22

Please sign in to comment.