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
{{ message }}
Repository navigation
Problems mixing-in rulesets defined using & combinator #1270
The answer was to use extends. These are in 1.4.0 beta.
It is unfortunately a limittation of the way mixins work that it would be difficult to compare to parts, e.g. &-success is evaluated after mixins are calculated.
I believe I found the issue you are talking about. Is it #1248 ?
In any event, I don't think the extend functionality, as currently implement, fixes this problem. Suppose we update the sample above to use extend, like so:
I've run into that problem just recently while delivering more nested rules for bootstrap 3.0.0-wip (labels component), removed the short name combination in the end and im awaiting for merge. Removed because that &-name combination didnt work and i really want to use bootstrap classes as mixins in my Less mastersheet instead writing ton of classes in my html markup. Other thing im interested is a ability to make loops - can anyone point me anywhere if thats something that is/will be supported?
Activity
lukeapage commentedon Apr 15, 2013
we had this bug before but I can't find it.
The answer was to use extends. These are in 1.4.0 beta.
It is unfortunately a limittation of the way mixins work that it would be difficult to compare to parts, e.g.
&-successis evaluated after mixins are calculated.tcjr commentedon Apr 15, 2013
I believe I found the issue you are talking about. Is it #1248 ?
In any event, I don't think the extend functionality, as currently implement, fixes this problem. Suppose we update the sample above to use extend, like so:
.label { &-success { background-color: blue; } } .mySuccessLabel:extend(.label-success) { }This produces no rules for
.mySuccessLabel.Isn't this a bug? If not, then is there any workaround besides not using the & combinator in the original file?
lukeapage commentedon Apr 16, 2013
hrmm, your right.. I know why.. its because it treats it as
ArturKwiatkowski commentedon Apr 24, 2013
I've run into that problem just recently while delivering more nested rules for bootstrap 3.0.0-wip (labels component), removed the short name combination in the end and im awaiting for merge. Removed because that &-name combination didnt work and i really want to use bootstrap classes as mixins in my Less mastersheet instead writing ton of classes in my html markup. Other thing im interested is a ability to make loops - can anyone point me anywhere if thats something that is/will be supported?
lukeapage commentedon Apr 25, 2013
@Fowowski #1267 (comment)
lukeapage commentedon Jun 14, 2013
duplicate of #1196