- This topic has 3 replies, 3 voices, and was last updated 6 years, 3 months ago by
Sebastian.
Author | Posts |
---|---|
ddenev
January 2, 2019 at 8:42 am
|
Heads up! this post was created when Microthemer was at version 5. The current version is 7. Some references to the interface may be out of date. Happy New Year! Another one related to “calc()” – this time when I hover over the property to show its value, it’s shown as “NaNpx” (see the image below). The CSS is properly generated though and works fine, it’s just the actual value shown by MT that has a problem. The |
Sebastian
January 2, 2019 at 6:52 pm
|
Happy new year Drago! Thanks for bringing this to my attention. I’ve just released version 5.5.2.0 which fixes the NaNpx issue. I noticed some interesting behaviour though, which I think might be due to the way the browser calculates flex-basis and certain formulas. I entered your calc() style into the flex-basis field:
Now that the bug is fixed, the browser reports the computed value as a calc() value rather than a pixel value, which it does for other properties like padding-top:
The values in the calc() are different, although I think they are mathematically equivalent to the input. As I mentioned, I suspect this is a quirk of the browser. It can convert other calc() values for flex-basis to pixels, just not the formula you were trying. As far as I can see, it’s up to the browser to enhance support for this rather than being something I can fix at the MT end. But thought it worth mentioning. Cheers, |
ddenev
January 3, 2019 at 7:51 am
|
Hi Sebastian, Thank you for fixing this! Re the computed value – your observation is correct and what you see is expected and aligned with the CSS specification – the browser must report not the final computed value in units but the calc expression itself. Please check section “Why calc()?” in https://bitsofco.de/how-calc-works/ and then section 8.1.3 in https://drafts.csswg.org/css-values-3/#calc-notation, the latter contains some additional info as to why is that needed. Best regards, |
Sebastian
January 3, 2019 at 10:26 am
|
Aha, thanks for enlightening me! So flex-basis must be akin to background-position as explained in section 8.1.3. |