If I attempt to bind data to a CSS stylesheet for a web component within <style>
tags, the binding does not work. (All static CSS within that block works)
<html>
<body>
<element name='foo' constructor='FooElement' extends='div'>
<style>
div {
display: {{isVisible ? 'block' : 'none'}};
}
</style>
<template>
<div>Foobar</div>
</template>
<script type="application/dart" src="xfooelement.dart"></script>
</element>
</body>
</html>
If, however, I apply the style to the style attribute of a tag, it works as expected.
<html>
<body>
<element name='foo' constructor='FooElement' extends='div'>
<template>
<div style="display: {{isVisible ? 'block' : 'none'}}">Foobar</div>
</template>
<script type="application/dart" src="xfooelement.dart"></script>
</element>
</body>
</html>
This has obvious drawbacks.
Is there a way to use data binding on CSS properties in a stylesheet file or block?