index.less 1.94 KB
Newer Older
liang ce committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
@rate-prefix-cls: rc-rate;
@rate-star-color: #f5a623;
@font-size-base: 13px;

.@{rate-prefix-cls} {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 18px;
  display: inline-block;
  vertical-align: middle;
  font-weight: normal;
  font-style: normal;
  outline: none;

  &-disabled &-star {
    &:before,
    &-content:before {
      cursor: default;
    }
    &:hover {
      transform: scale(1);
    }
  }

  &-star {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s;
    color: #e9e9e9;
    cursor: pointer;
    line-height: 1.5;

    &-first,
    &-second {
      transition: all 0.3s;
    }

    &-focused,
    &:hover {
      transform: scale(1.1);
    }

    &-first {
      position: absolute;
      left: 0;
      top: 0;
      width: 50%;
      height: 100%;
      overflow: hidden;
      opacity: 0;
    }

    &-half &-first,
    &-half &-second {
      opacity: 1;
    }

    &-half &-first,
    &-full &-second {
      color: @rate-star-color;
    }

    &-half:hover &-first,
    &-full:hover &-second {
      color: tint(@rate-star-color, 30%);
    }
  }
}

@icon-url: '//at.alicdn.com/t/font_r5u29ls31bgldi';

@font-face {
  font-family: 'anticon';
  src: url('@{icon-url}.eot'); /* IE9*/
  src: url('@{icon-url}.eot?#iefix') format('embedded-opentype'),
    /* IE6-IE8 */ url('@{icon-url}.woff') format('woff'),
    /* chrome、firefox */ url('@{icon-url}.ttf') format('truetype'),
    /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{icon-url}.svg#iconfont')
      format('svg'); /* iOS 4.1- */
}

.anticon {
  font-style: normal;
  vertical-align: baseline;
  text-align: center;
  text-transform: none;
  line-height: 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  &:before {
    display: block;
    font-family: 'anticon' !important;
  }
}

.anticon-star:before {
  content: '\e660';
}