Skip to content
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

calc and minus px values showing as invalid when they are not #47

Closed
abursill opened this issue Feb 7, 2016 · 5 comments · Fixed by #49
Closed

calc and minus px values showing as invalid when they are not #47

abursill opened this issue Feb 7, 2016 · 5 comments · Fixed by #49
Assignees

Comments

@abursill
Copy link

abursill commented Feb 7, 2016

I am surprised nobody else has reported this yet but the validator is showing calc(25% - 4px); and margin-left -4px; values as invalid css when I am assured it is not invalid and it is just the validator that has not been updated in ages. Almost everyone on the planet using a certified wordpress theme the latest ones will be having this problem.

@sapphonie
Copy link

sapphonie commented Apr 19, 2016

Please fix this, I am also being affected by it.
Specifically, the validator fails to recognize that
calc(100% / 3)
is valid css. I get this error:
Value Error : width Parse Error calc(100% / 3)

@ylafon ylafon self-assigned this Apr 21, 2016
@ylafon ylafon mentioned this issue Apr 21, 2016
@abursill
Copy link
Author

So was this fixed or ignored and closed by admin

@ylafon
Copy link
Member

ylafon commented Apr 21, 2016

Fixed, see above PR link.

@sapphonie
Copy link

It doesn't seem to be fixed, https://jigsaw.w3.org/css-validator/validator?uri=thesqrtminus1.com&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en still gives me 3 errors, all related to calc()

@ylafon
Copy link
Member

ylafon commented Apr 25, 2016

From https://www.w3.org/TR/2015/CR-css-values-3-20150611/#calc-type-checking
[[[
A math expression has a resolved type
, which is one of <length>, <frequency>, <angle>, <time>, <number>, or <integer>. The resolved type must be valid for where the expression is placed; otherwise, the expression is invalid. The resolved type of the expression is determined by the types of the values it contains. <number-token>s are of type <number> or <integer>. A <dimension-token>’s type is given by its unit (cm is <length>, deg is <angle>, etc.). An attr() expression’s type is given by its <type-or-unit> argument.

If percentages are accepted in the context in which the expression is placed, a <percentage-token> has the type of the value that percentages are relative to; otherwise, a math expression containing percentages is invalid.
]]]

I read this as resolved type "percentage" is not allowed, which is the error you see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants