Selector optimization
Created by: karthikv
Even though nesting properties in LESS feels so natural, it often results in inefficient CSS that overuses the costly descendant selector, as shown below:
.topbar form input
.pagination ul li a
.topbar ul li ul li a
.tabs li a
Removing the superfluous descendants yields much more optimized—and simplified—CSS:
.topbar input
.pagination ul a /* or */ .pagination li a
.topbar ul ul a /* or */ .topbar li li a
.tabs a
Although these changes may make the LESS files a tad less intuitive, they are valuable when it comes to speed and will be of benefit to a large CSS framework such as this.