Can I override a less-css function based on a class? -


for example html tag has class ie9. want define default function , override definition when ie9 class exists:

.word-break(){     word-break: break-word; }  .ie9 {     .word-break(){         word-break: break-all;     } }   div > p {     .word-break(); } 

this not work intended. nothing happens in ie9.

you need put selector inside mixin:

.word-break() {     .ie9 & {         word-break: break-all;     } } 

the & represents selector you're invoking mixin inside of.

if write .ie9 {, generate div > p .ie9, not want.
putting & last moves original selector later.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -