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
Post a Comment