post.styl 2.35 KB
Newer Older
caihaifei's avatar
caihaifei 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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
.post {
  &-header {
    position: relative;
    margin-bottom: 1rem;
    font-size: 1em;
    text-align: center;
  }

  &-title {
    margin: 0;
    color: var(--color-gray-950);
    cursor: auto;

    &__link {
      position: relative;
      color: var(--color-gray-800);
      break-word();

      &::before {
        content: '';
        visibility: hidden;
        position: absolute;
        right: 0;
        bottom: -4px;
        left: 0;
        height: 2px;
        background-color: var(--color-gray-800);
        transition: transform .2s ease-in-out;
        transform: scaleX(0);
      }

      &:hover {
        color: var(--color-gray-800);

        &::before {
          visibility: visible;
          transform: scaleX(1);
        }
      }
    }
  }

  &-meta {
    &-item {
      &:not(:first-child)::before {
        content: '•';
        margin: 0 .5rem;
        color: var(--color-gray-700);
      }

      &__icon,
      &__info,
      &__value {
        margin: 0 2px;
      }

      if (hexo-config('post_meta.created.enable')) {
        &--createtime {
          color: var(--color-gray-700);
        }
      }

      if (hexo-config('post_meta.updated.enable')) {
        &--updatetime {
          color: $post-update-color;
        }
      }

      if (hexo-config('post_meta.word_count.enable')) {
        &--wordcount {
          color: var(--color-gray-700);
        }
      }

      if (hexo-config('post_meta.reading_time.enable')) {
        &--readtime {
          color: $post-reading-time-color;
        }
      }

      if (hexo-config('busuanzi.post_pv.enable')) {
        &--visitors {
          color: $post-reading-count-color;
        }
      }
    }
  }

  if (hexo-config('post_widget.end_text.enable')) {
    &-ending {
      margin-bottom: 1rem;
    }
  }

  &-copyright {
    margin-bottom: 1rem;
  }

  if (hexo-config('post_widget.tags')) {
    &-tags {
      margin-bottom: 1rem;

      &-item {
        margin: 0 .5rem;

        &:hover {
          cursor: pointer;
        }

        &__icon,
        &__link {
          margin: .1rem;
          color: $post-tags-icon-color;
          transition: color .2s;

          ^[-1]:hover & {
            color: $orange-dark;
          }
        }
      }
    }
  }

  &-reward {
    margin-bottom: 1rem;
  }

  &-paginator {
    border-top: 1px solid var(--color-gray-250);
    padding-top: 1rem;
  }
}