You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From this example, the .nav, the .nav > a, and .nav-sm > a are created multiple times which could lead to inheritance\ordering differences on different browsers. Should they be combined into a single .nav, .nav > a, and .nav-sm > a elements to be more explicit in the value & decrease the overall size of the CSS?
The text was updated successfully, but these errors were encountered:
jt000
changed the title
Should child elements be combined?
Should common LESS elements be combined in the CSS output?
Apr 23, 2016
See #930. In short: no, Less does not analyze outcoming CSS (except some trivial stuff) and thus cannot perform any optimization of that kind for free. Considering you can get these optimizations with clean-css, this feature is most likely to stay beyond Less scope.
are created multiple times which could lead to inheritance\ordering differences on different browsers.
No, no matter how many times .nav-sm > a appears in the output, inheritance/ordering remains the same in all conformant browsers.
Take the following example (repro'd with 2.5.3):
The above LESS creates the following CSS
From this example, the
.nav
, the.nav > a
, and.nav-sm > a
are created multiple times which could lead to inheritance\ordering differences on different browsers. Should they be combined into a single.nav
,.nav > a
, and.nav-sm > a
elements to be more explicit in the value & decrease the overall size of the CSS?The text was updated successfully, but these errors were encountered: