Skip to content

Selector optimization #100

@karthikv

Description

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions