grunt-dss
grunt-dss copied to clipboard
How to add state (class and pseudo-class) to markup.example ?
I think with custom parser for markup and template ? But after some research and testing I have not found a good solution ...
Thanks for any help :)
edit and it's probably a side effect of https://github.com/darcyclarke/grunt-dss/issues/15 ?
I did it with a small template change and some jquery. Not perfect, but easy and better than nothing:
{{#state}}
<div class="example state">
<div class="name">{{name}}</div>
<div class="item" data-state="{{escaped}}">
{{{../markup.example}}}
</div>
</div>
{{/state}}
$(function() {
$("div.example.state > div.item").each(function() {
var pseudoState = $(this).attr("data-state");
$(this).children().addClass(pseudoState);
})
});