I am not that deep into web development but started learning Angular and CSS recently, now learning about css selectors and most of my directives for example has an ng-repeat/nested ng-repeats so i can just include the css classes inside the ng-repeat template, my questions are:
- Does Angular change the way you write your css, like for example avoiding selectors in the CSS?
- Any general tips on what to avoid in my CSS considering that the app I am working on is based on directives that I write by my own?
Here is an example :
before i turned my markup to a directive my css was like
.sidebar-menu > ul > li > a {
border-bottom: 1px solid #ffffff !important;
border-top: 1px solid #e7e7e7 !important;
color: #555555 !important;
}
and the markup is something like
<div class="sidebar-menu">
<ul>
<li><a></a><li>
<li><a></a><li>
<li><a></a><li>
</ul>
</div>
after changing it to a directive i removed the selectors
css
.linkc {
border-bottom: 1px solid #ffffff !important;
border-top: 1px solid #e7e7e7 !important;
color: #555555 !important;
}
directive template
<ul>
<li ng-repeat="item in items">
<a class="linkc"></a>
</li>
</ul>