css - Element style according to other class with LESS -


i have part of less , html markup:

<div class="block">    <div class="post-image"></div>    <p></p> </div> 

and

  .post-image {     display: inline-block;     width: 35%; height: 80px;      &.photo {       width: 100%; height: 180px;     }   }    p {     width: 64%;     display: inline-block;      when (isstring .post-image.photo) {       width: 100%;   } 

i know wrong setup wanna know, there possible append paragraph (p) style photo width or class in less? thx help.

this not technically less thing, purely css construct situation (which, of course, less can build). here need less , resulting css snippet of html (the .post-image code have):

less

p {   width: 64%;   display: inline-block;    .post-image.photo + & {     width: 100%;   } } 

css

p {   width: 64%;   display: inline-block; } .post-image.photo + p {   width: 100%; } 

the second override first when .photo class added .post-image.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -