Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #100
Closed
Open
Issue created Aug 26, 2011 by Administrator@rootContributor

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.

Assignee
Assign to
Time tracking