File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6,27 +6,28 @@ class CssLength
6
6
{
7
7
/**
8
8
* Array of valid css length units.
9
- * Should be pre-sorted so no earlier length is contained within a latter (eg. 'in' within 'vmin').
9
+ * Should be pre-sorted by unit text length so no earlier length can be
10
+ * contained within a latter (eg. 'in' within 'vmin').
10
11
*
11
12
* @var string[]
12
13
*/
13
14
protected static $ units = [
15
+ 'vmax ' ,
14
16
'vmin ' ,
17
+ 'rem ' ,
15
18
'px ' ,
16
- '% ' ,
17
19
'pt ' ,
18
20
'cm ' ,
19
21
'mm ' ,
20
- 'q ' ,
21
22
'in ' ,
22
23
'pc ' ,
23
24
'em ' ,
24
- 'rem ' ,
25
25
'ex ' ,
26
26
'ch ' ,
27
27
'vw ' ,
28
28
'vh ' ,
29
- 'vmax '
29
+ '% ' ,
30
+ 'q ' ,
30
31
];
31
32
32
33
/**
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public function test_getUnit()
42
42
$ this ->assertEquals ('vmin ' , (new CssLength ('40vmin ' ))->getUnit ());
43
43
$ this ->assertEquals ('q ' , (new CssLength ('50Q ' ))->getUnit ());
44
44
$ this ->assertEquals ('' , (new CssLength ('50GB ' ))->getUnit ());
45
+ $ this ->assertEquals ('rem ' , (new CssLength ('44.5435rem ' ))->getUnit ());
45
46
}
46
47
47
48
}
You can’t perform that action at this time.
0 commit comments