Sunday, 15 March 2015

less - LessCss selector interpolation with parent reference -



less - LessCss selector interpolation with parent reference -

i have problem, want utilize types of inputs number, url, email ... styled normal text... utilize them in file wanted create a selector interpolation manage this:

@inputs: ~"input[type=number], input[type=url], input[type=email], input[type=date], input[type=password], input[type=text]";

this works fine until want set them nesting...

so ..

#content { @{inputs} {width: 20%} }

will output:

#content input[type=number], input[type=url], ... {width: 20%}

but need this:

#content input[type=number], #content input[type=url], ... {width: 20%}

does have idea?

i found solution :) changed string interpolator:

@inputs: ~"input[type=number], input[type=url], input[type=email], input[type=date], input[type=password], input[type=text]";

to:

@inputs: ~"input[type=number]," + " &" ~"input[type=url]," + " &" ~"input[type=email]," + " &" ~"input[type=date]," + " &" ~"input[type=password]," + " &" ~"input[type=text]"; update:

this solution works in compiler: leafo.net/lessphp

less

No comments:

Post a Comment