next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.34k stars 420 forks source link

求助:如何修改文章计数的样式 #798

Open gapplef opened 1 month ago

gapplef commented 1 month ago

Issue Checklist

Other Information

请问怎样能将文章计数的样式改回旧版,需要修改什么部分?新版的对我而言太突兀、不和谐了。 Untitled

welcome[bot] commented 1 month ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

stevenjoezhang commented 1 month ago

可以修改这个地方: https://github.com/next-theme/hexo-theme-next/blob/524c3693f21b7fd3d3ee75e7e614afe7217a0d7e/source/css/_common/components/pages/categories.styl#L22

gapplef commented 1 month ago

感谢,我参考代码的修改记录用以下代码恢复了原版

  .category-list-item {
    margin: 5px 10px;
  }

  .category-list-count {

    color: $grey;

    &::before {
      content: ' (';
    }

    &::after {
      content: ') ';
    }
    font-size: $font-size-base;
  }

请问如果要在_data下修改,是需要添加什么?

gapplef commented 1 week ago

不清楚是否是最佳选择,不过在_data/styles.styl中加入以下代码实现了修改

.category-all-page .category-list-count {
    badge() {all: unset;}
    badge()

    color: $grey;

    &::before {
      content: ' (';
    }

    &::after {
      content: ') ';
    }
    font-size: $font-size-base;
    /*badge();*/
}