Closed cdoublev closed 3 years ago
Merging #128 (dbf82a3) into master (b527ed7) will increase coverage by
0.38%
. The diff coverage is85.24%
.:exclamation: Current head dbf82a3 differs from pull request most recent head baf63bc. Consider uploading reports for the commit baf63bc to get more accurate results
@@ Coverage Diff @@
## master #128 +/- ##
==========================================
+ Coverage 37.39% 37.78% +0.38%
==========================================
Files 87 87
Lines 1182 1191 +9
Branches 227 234 +7
==========================================
+ Hits 442 450 +8
Misses 633 633
- Partials 107 108 +1
Impacted Files | Coverage Δ | |
---|---|---|
lib/parsers.js | 80.82% <85.24%> (+0.18%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b527ed7...baf63bc. Read the comment docs.
Superseded by #140.
115 adds basic support for uncomputed
calc ()
values, but only for those of type<dimension>
, ie. a<length-percentage>
like for thewidth
property, but not for those of type<length>
, like for theborder-width
property, or<percentage>
.This PR is only a draft, for several reasons.
There is no support for types that can be used in
calc
but which are nested within another type, such as an<angle>
or a<length-percentage>
(<color-stop>
) in a<gradient>
for thebackground-image
property.There is no support for
<hsla?()>
because its values are currently computed (see next point) to<rgba?()>
.Ideally,
calc
should be computed when possible (see #101 ) to conform to the specification and browsers behavior.Some recent language features are used like array destructuring, and other features like
var
. So I'm not sure of the targeted environments that should be supported.Latest and stable versions, I guess?
<rgba?()>
and<hsla?()>
should be able to support a space as a separator for values other than the alpha channel (note that it would complicate the task of their parser), and a/
to separate the latter.This draft provides support for properties directly receiving (ie. not nested in another type) a value of type
<integer>
,<number>
,<color>
(only<rgba? ()>
),<length>
,<percentage>
(font-stretch
is an example but its values are not parsed bycssstyle
),<angle>
(offset-rotate
is an example but same as<percentage>
).This draft also fixes the two following issues:
rgba()
, if the alpha value is not supplied (eg.rgba(0, 0, 0)
), it is currently considered as invalid, because the parser checks for 4 argumentsrgba(0, 0, 0, 50%)
orrgba(0%, 0%, 0%, 50%)
outputrgb(0, 0, 0)
because50
is not divided by 100