Sakurairo主题DIY(1)——删除下划波浪线

发布于 2023-02-09  806 次阅读


在将主题从2.4版本更新到2.5版本后,发现主页的标题(如Display、Article等)下方出现了黄色的波浪线,但设置中并未找到取消的选项。

通过使用浏览器的开发者工具我们可以看到,类似的1级标题都被添加了文本修饰text-decoration属性,后面设置了下画波浪线以及颜色。

所以我们便可以进入wordpress的后台页面通过对css样式进行修改删除下划线,在后台的-外观>主题文件编辑器中我们可以找到相应的CSS文件,如下图:

找到如下的代码位置,并将定义text-decoration的行注释掉即可:

h1.fes-title {
  color: var(--theme-skin,#505050);
  font-size: 20px;
  font-weight: var(--global-font-weight,400);
  padding-bottom: 10px;
  padding-left: 3px;
  padding-right: 3px;
  margin-bottom: 30px;
  text-underline-offset: 10px;
  /*↓↓↓注释下面这行↓↓↓*/
  /*text-decoration: underline wavy var(--post_list_matching_color,#ffeeeB);*/
  /*↑↑↑注释上面这行↑↑↑*/
  transition: all 0.8s ease !important;
}

h1.main-title {
  color: var(--theme-skin,#505050);
  font-size: 20px;
  font-weight: var(--global-font-weight,400);
  padding-bottom: 10px;
  padding-left: 3px;
  padding-right: 3px;
  margin-bottom: 30px;
  text-underline-offset: 10px;
  /*↓↓↓注释下面这行↓↓↓*/
  /*text-decoration: underline wavy var(--post_list_matching_color,#ffeeeB);*/
  /*↑↑↑注释上面这行↑↑↑*/
  transition: all 0.8s ease !important;
}

当然,文本修饰的样式以及颜色也可在此处修改,如闪烁(据说已被弃用)、上划线、贯穿线条等,根据自己的需求进行相应的修改即可。