3 ms·
This only polyfills some of these features in the most superficial way. To polyfill some of these features according to spec., you need to do it in the browser
by JimDabell 13y ago
This only polyfills some of these features in the most superficial way. To polyfill some of these features according to spec., you need to do it in the browser.
For example:
<!DOCTYPE html>
<title>CSS Variable Test</title>
<style>
head {
display: block;
var-mycolor: blue;
}
:root {
var-mycolor: red;
}
title {
display: block;
color: var(mycolor);
}
</style>
If I load that document in a browser that supports CSS variables, the title will be blue. But if I run it through Myth, it drops the blue rule and makes the title red. This is because CSS variables are inherited throughout the document and can be overridden at any time. The calculated value of the CSS property that uses the variable depends on the document structure.
Likewise with calc() - if you multiply values like in their example, it works, but if you try to add two values of different units (e.g. 2em + 30%), it silently falls back to requiring browser support for calc().
This might be useful in narrow circumstances, but it should have big warning signs because it doesn't come close to being a proper polyfill.
- dgreensp 13y agoAha, yes. This is pretty damning.