I want to create a riotjs tag to whom some style or css class can be added directly in HTML page. And I also can set some style attributes dynamically from tag script;
For Example;
<my-tag class="some class" attr1="" attr2="" />
<my-tag>
<script>
if(opts.attr1) //set some style to my-tag
</script>
</my-tag>
I can achieve it by creating a HTML tag string with dynamic properties and insert as HTML to root. But I don't want to add additional child tag just for styling.
What about something like this. You pass some options to the tag, and then change the style classes dynamically. Check the example http://plnkr.co/edit/ZuPMFFBIuDPSeawsEkPX?p=preview