I have written grunt uncss task to remove the unused css in my code. But its removing a lot of css which is being used in my code.
I guess the reason is, its not checking for css inside the directive 'my-directive'
Here is my index.html:
<div>
<span class="duplicate-text" ng-if="duplicateMode" ng-bind-template="{{'html.peopleeditor.duplicate.label'|property}}"></span>
</div>
<div class="peopleeditor col-xs-10 col-sm-10 col-md-10 col-lg-10" id="peopleeditorcontainer">
<my-directive controller="actionframework.controller" options="options"/>
</div>
Inside my index.css, i have some classes like:
.peopleeditor .form-horizontal .control-label,
.peopleeditor .form-horizontal .radio,
.peopleeditor .form-horizontal .checkbox,
.peopleeditor .form-horizontal .radio-inline,
.peopleeditor .form-horizontal .checkbox-inline {
margin-bottom: 0;
margin-top: 0;
}
.duplicate-text {
font-family: 'Roboto-Bold', sans-serif;
font-size: 12px;
}
On running grunt uncss task, many of the styles with .peopleeditor class is being removed. Is it because peopleeditor
classes will be applied to html tags inside 'my-directive'
. Is there any way to read the styling inside directive templates, so that grunt uncss task does not ignore this.