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

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -