tbela99 / css

A CSS parser and minifier and sourcemap generator written in PHP
Other
14 stars 1 forks source link

Calc #42

Closed Cruglk closed 3 years ago

Cruglk commented 3 years ago

@tbela99, Thanks for the previous edits! ...Here We Go Again...

Now "calc":

$test = 'div[data-elem-id="1587819338886"] { color: #000000; z-index: 5; top: calc(50vh - 375px + 325px); left: calc(50% - 600px + 26px); width: 610px; background: red;}';

Result:

div[data-elem-id="1587819338886"] {
 color: #000;
 z-index: 5;
 top: calc(50vh- 375px+325px);
 left: calc(50%- 600px+26px);
 width: 610px;
 background: red
}

Correct:

div[data-elem-id="1587819338886"] {
    color: #000000;
    z-index: 5;
    top: calc(50vh - 375px + 325px);
    left: calc(50% - 600px + 26px);
    width: 610px;
    background: red;
}
tbela99 commented 3 years ago

the issue has been fixed.

Thanks

Cruglk commented 3 years ago

@tbela99, Thanks! But not sure if this is fixed. Now is:

top: calc(50vh-375px+325px);
left: calc(50%-600px+26px);

It should be with spaces.

top: calc(50vh - 375px + 325px);
left: calc(50% - 600px + 26px);

img-2020-09-01-07-23-08

img-2020-09-01-07-22-58

tbela99 commented 3 years ago

it should be good now. sorry I missed few tests the last time

Cruglk commented 3 years ago

@tbela99 Thanks! But still can't download version for PHP < 7.4: https://ci.appveyor.com/project/tbela99/css/builds/34957043

tbela99 commented 3 years ago

that is the automated test bot for PHP < 7.4. Not sure why it does not download php56. I will reopen the issue and add more test cases. You can run the test locally if you have the repo on your hard drive

tbela99 commented 3 years ago

I checked older tests for that branch and they also failed to run. I will try to fix that

Cruglk commented 3 years ago

@tbela99 Found another problem. This time with font and variables. Code like:

$test = '
:root {
    --default-font-size: 11px
}
.test {
    overflow-x: hidden;
    font: 400 var(--default-font-size) \'Trebuchet MS\', sans-serif;
    color: var(--color-default)
}
';

Problem is this:

    var(--default-font-size)

Like example, Its ok:

    font: 400 10px Verdana;
Cruglk commented 3 years ago

houldn't it be 'Trebuchet MS' instead of 'Trebuchet MS'?

The problem is only in brackets.

2

1

Also:

font: 400 16px Verdana;

After parse:

font: 16px Verdana;

Missing "400". 3

tbela99 commented 3 years ago

I mean't there should be no \\' around Trebuchet MS but the \ got stripped

tbela99 commented 3 years ago

I have fixed the issues you mentioned here. I don't have the time to investigate the issue with automated test for php5.6 branch. I can successfully run the test locally.

Thanks for reporting those issues

tbela99 commented 3 years ago

if you want to run the tests from your cli, go to the test folder and type ./runtest.sh