eliace/ergo-js

View on GitHub
css/widgets/basic/icon.less

Summary

Maintainability
Test Coverage



.icon {
  cursor: inherit;
  display: inline-block;
  line-height: 1;



  &.button {
    cursor: pointer;
  }



  &.giant { font-size: 8em; }
  &.huge { font-size: 6em; }

  &.large { font-size: 3em; }
  &.medium { font-size: 1.5em; }
  &.small { font-size: 1em; }
  &.tiny { font-size: 0.7143em; }


//  .mix-text-types();
}



.icon.action, .action .icon {
    pointer-events: auto;
    cursor: pointer;
}





.contextual.icon, .contextual .icon {//, a.icon {
  color: #000;
  opacity: 0.3;
  text-shadow: 0 1px 0 #fff;
  background: none;
  border: none;
}

//a.icon:hover, a.icon:active,
.contextual.icon:hover, .contextual.icon:active,
.contextual .icon:hover, .contextual .icon:active {
  color: #000;
  opacity: 0.5;
  background: none;
  box-shadow: none;
}



//.inverted a.icon,
.inverted .icon.contextual {
  color: #f0f0f0;
  text-shadow: 0 1px 0 #000;
}



.icon.circular {
  border-style: solid;
  border-width: 1px;
  height: 2em;//1.714em;//1.5rem;
  line-height: 1.857;//1.571;//1.3rem;
  text-align: center;
  width: 2em;//1.714em;//1.5rem;
}


.icon.label {
  width: auto;
}

.icon.button {
  width: auto;  
}




.has-icon {

  position: relative;

  &.at-left > .icon.before,
  &.at-right > .icon.after,
  &.at-left > .icon.left,
  &.at-right > .icon.right {
//  > .spinner,
//  &.left > .spinner.left,
//  &.right > .spinner.right {
    position: absolute;
    right: 0;
    width: 2.286em;
    line-height: 1.42857;//20px;
    height: 100%;
    text-align: center;
//    pointer-events: none;
  //  cursor: default;
//    color: @text-color;
    top: 0;
  /*  opacity: 0.5;*/

    &:before,
    &:after {
      position: absolute;
      top: 50%;
      line-height: 1;
      margin-top: -0.5em;//-10px;
      width: 100%;
      left: 0;
    }

    &.spinner:before,
    &.spinner:after {
//      width: 16px;
//      height: 16px;
      line-height: 1;
      top: 50%;
      margin-top: -0.5em;
      left: 50%;
      margin-left: -0.5em;
    }


    &.caret:before,
    &.caret:after {
      margin-top: -1px;
      margin-left: -4px;
      width: 0;
      left: 50%;
    }



  }






  // > .content,
  // &.right > .content {
  //   padding-right: 32px;
  // }


  &.at-left {
    padding-left: 2.286em;

  }

  &.at-left > .icon.before,
  &.at-left > .left {
    left: 0;
    right: auto;
  }


  &.at-right {
    padding-right: 2.286em;
  }


  &.medium {
    &.at-left {
      padding-left: 3.429em;
    }
    &.at-right {
      padding-right: 3.429em;
    }

    > .icon.left,
    > .icon.right {
      font-size: 1.5rem;
    }
  }




  // FIXME
  > .icon.action {
    pointer-events: auto;
  }

}



.icon.muted {
  color: rgba(0,0,0,0.5);
}