html - Less :hover not overwriting :before color -


i have link :before pseudo class.

i'm trying style content grey, red on hover, using less. however, can't find combination of code both default color , hover color work.

code pen: http://codepen.io/niahc/pen/zvnapj

less code:

.icon-support:before {   content: "acvzssd"; }  .help {   .icon-support {     &:before {       color: grey;     }     &:hover,     &:focus,     &:active {       color: red !important;     }   } } 

html:

<a class="help" href="#">   <span class="icon-support"></span> </a> 

to work, need specify style on ::before pseudoelement instead of on element itself, final less code this:

.icon-support::before {   content: "acvzssd"; }  .help {   .icon-support {     &::before {       color: grey;     }     &:hover::before, /*   <-- change "before" here */     &:focus::before, /*   <-- , here */     &:active::before { /* <-- , here */       color: red;     }   } } 

fixed codepen: http://codepen.io/maxlaumeister/pen/xwgzjq


and here live demo using compiled css:

.icon-support::before {    content: "acvzssd";  }  .help .icon-support::before {    color: grey;  }  .help .icon-support:hover::before,  .help .icon-support:focus::before,  .help .icon-support:active::before {    color: red;  }
<a class="help" href="#">    <span class="icon-support"></span>  </a>


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -