Skip to content

consumption of CSS Variable #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
69a8271
add CssVariable type
ylafon Aug 29, 2021
a375dc4
hint for registering css variable
ylafon Aug 29, 2021
05c9bda
rewrote to avoid forcing raw number casting
ylafon Aug 29, 2021
ecb940f
prepare for partial analysis of css variable, when a single default i…
ylafon Aug 29, 2021
f312b03
regen
ylafon Aug 29, 2021
674906b
fix type when setting new exp
ylafon Aug 29, 2021
7fde8ee
accessor to get the default value when doing the extra check after pa…
ylafon Aug 29, 2021
9d9ca29
extract numerical value only when it is a true number
ylafon Aug 29, 2021
518f593
care for '--' identifier, see #298
ylafon Aug 30, 2021
d93aab4
regen
ylafon Aug 30, 2021
9a252a9
more genericity in treating type-indefinite values
ylafon Aug 30, 2021
e524b91
use variable instead of mitting results
ylafon Aug 30, 2021
14d8020
regen
ylafon Aug 30, 2021
3a7720f
add calc value using proper token to do variable marking action when …
ylafon Aug 30, 2021
46d552b
regen
ylafon Aug 30, 2021
ea7507d
mark the value as containing a variable during contruction
ylafon Aug 30, 2021
6db4bc9
more variable marking
ylafon Aug 30, 2021
af49485
regen
ylafon Aug 30, 2021
0925e82
most cases of meaningful var() appearance should be covered
ylafon Aug 30, 2021
32d81e1
care for specific test cases (where 0 is an acceptable value of a len…
ylafon Aug 30, 2021
2bdd71c
mark for color functions
ylafon Aug 30, 2021
dbe49ad
regen
ylafon Aug 30, 2021
ba696ac
take care of variable handling in the modern syntax of rgb and rgba f…
ylafon Aug 30, 2021
6f62279
typo...
ylafon Aug 30, 2021
38f8767
remove gray() per https://www.w3.org/TR/2020/WD-css-color-4-20201112/
ylafon Aug 30, 2021
ee3f0d7
regen
ylafon Aug 30, 2021
4cc5df5
remove gray() per https://www.w3.org/TR/2020/WD-css-color-4-20201112/
ylafon Aug 30, 2021
835d0d8
err msg for LAB
ylafon Aug 30, 2021
2a0621b
fix to LAB per https://www.w3.org/TR/2021/WD-css-color-4-20210601/#fu…
ylafon Aug 30, 2021
fb702e6
turn into a more generic message
ylafon Aug 30, 2021
2ccd18d
fix lch per https://www.w3.org/TR/2021/WD-css-color-4-20210601/#funcd…
ylafon Aug 30, 2021
66bf5d4
fix to HWB per https://www.w3.org/TR/2021/WD-css-color-4-20210601/#fu…
ylafon Aug 31, 2021
f004f8e
fix to HSL per https://www.w3.org/TR/2021/WD-css-color-4-20210601/#fu…
ylafon Aug 31, 2021
5a5e113
variable check at object creation that includes left hand side
ylafon Aug 31, 2021
4d877b1
don't throw when var() is used as it can expand as a sub-expression, …
ylafon Aug 31, 2021
3736cfb
don't throw when var() is used as it can expand as a sub-expression, …
ylafon Aug 31, 2021
e759eeb
don't throw when var() is used as it can expand as a sub-expression, …
ylafon Aug 31, 2021
cf8aa39
don't throw when var() is used as it can expand as a sub-expression, …
ylafon Aug 31, 2021
78c20e0
don't throw when var() is used as it can expand as a sub-expression, …
ylafon Aug 31, 2021
a7b785a
better handling or 'real' idents
ylafon Aug 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion org/w3c/css/parser/CssFouffa.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,9 @@ public CssProperty handleDeclaration(String property, CssExpression expression,
if (Util.onDebug) {
System.err.println("Creating " + property + ": " + expression);
}

if (property.startsWith("--")) {
// css variable
}
final CssValue lastValue = expression.getLastValue();

if (allowBackslash9Hack() && lastValue != null && lastValue.hasBackslash9Hack()) {
Expand Down
4 changes: 4 additions & 0 deletions org/w3c/css/parser/CssPropertyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ public synchronized CssProperty createProperty(ApplContext ac, AtRule atRule, St
throw new WarningParamException("vendor-extension", expression.toStringFromStart());
}

if (expression.hasCssVariable()) {
throw new WarningParamException("css-variable", expression.toStringFromStart());
}

if (ac.getTreatCssHacksAsWarnings() && expression.hasCssHack()) {
throw new WarningParamException("css-hack", expression.toStringFromStart());
}
Expand Down
Loading