css - In LESS, is it possible to import one selector's content into another one? -


my goal import content: '\e826'; icon class selector in case content property changes in future.

.icon-hi:before {content: '\e826';}  .panel {     background: white;     .panel-title {         &:before {             @include .icon-hi;             text-align: center;             width: 20px;             height: 20px;         }     } } 

of course @import doesn't work that, there way?

for purpose of defining value in 1 place, should use variables:

@icon-hi: '\e826';  .icon-hi:before {content: @icon-hi;}  .panel {     background: white;     .panel-title {         &:before {             content: @icon-hi;             text-align: center;             width: 20px;             height: 20px;         }     } } 

you can 'import 1 selector another'. mixins do. these first 2 features in less documentation - http://lesscss.org/features/

a third option use extend feature: http://lesscss.org/features/#extend-feature


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -