mixins - Using a LESS variable as a property instead of a value -
i've made following 2 mixins:
.responsive_color(@color, @response_color, @speed: 0.1s){ color: @color; .transition(color, @speed); &:hover, &:active, &:focus{ color: @response_color; } } .responsive_background(@color, @response_color, @speed: 0.1s){ background-color: @color; .transition(background-color, @speed); &:hover, &:active, &:focus{ background-color: @response_color; } }
since these 2 identical want combine them this:
.responsive(@property, @color, @response_color, @speed: 0.1s){ @property: @color; .transition(@property, @speed); &:hover, &:active, &:focus{ @property: @response_color; } }
while doesn't cause errors in less parser (php class) ignored. i've tried @{property} , '@{property}' both of these cause errors.
does know how can output @property parsed? or trying isn't possible?
a similar question has been answered here may you. particular feature isn't in less.js framework (yet), can possibly around little hack, outlined here:
Comments
Post a Comment