-
Notifications
You must be signed in to change notification settings - Fork 10
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
Simple CSS3 calc(100% - 10px) fails #68
Comments
I think you need to replace it by |
Thanks for replying. The code that you have suggested is not a valid CSS. You can check it using the official W3C validator at https://jigsaw.w3.org/css-validator/#validate_by_input+with_options Use something like the following code in the direct input field and click on the check button. The test will fail.
And if you redo the same test using the following, the following code, the test will pass.
|
My opinion about this issue is that LESS should not be in charge of evaluating the According the the W3C's recommendation, as long as the units are valid, they can be mixed and matched with no issue and the browser will figure out a way to compute a result. See their own example at https://www.w3.org/TR/css-values-3/#calc-notation I propose that the whole notion of When I was fiddling around with the flags, I have found myself with
|
This above is not css but less syntax. Less has an internal
to let the browser do the math .. you need to tell to the less parser not to use the internal
which will result in your css file to be :
Another post anwsers the calc() issue on the less.js repo : less/less.js#974 (comment)
Sometimes you need to calculate some stuff so the method can be useful. Hope this helps |
It does help a lot. Thank you so much. I went and did some research on my own after reading your answer and I have discovered that LESS "does not" have a calc() function. But it does have an interesting behaviour that makes it evaluate anything between parenthesis. So I went on and created the following:
which produces the following code after being compiled ...
It literally assumed that So the I think that this thread can now be closed. The answer you have provided will help me fix the issues in my LESS file. I will however create another issue for a possible minor bug I may have discovered. |
I guess the following error ...
... every time I used the following:
height: calc(100% - 146px);
The text was updated successfully, but these errors were encountered: