Nodebb调整紫色主题

该文指导如何在NodeBB的Slick主题中插入自定义CSS代码,以改变字体、链接、复选框、按钮等元素的颜色和样式,并添加了鼠标悬浮时的动画效果,增强了用户体验,特别是主副标题的交互动画。
摘要由CSDN通过智能技术生成

准备说明

在nodebb中仪表盘界面选择 管理-> 主题-> Slick theme
然后插入自定义css代码

CSS

//body
body{
    font-size: 16px;
}

a {
    color: #8e43b7;
    text-decoration: none;
}

a:focus,a:hover {
    color: #b8aade;
    text-decoration: none
}

a.permalink{
    color: #8e43b7;
}


//复选框
.checkbox input:checked+.input-helper:before {
    background-color: #8e43b7;
}

.checkbox input:checked+.input-helper:before, .radio input:checked+.input-helper:before {
    border-color: #8e43b7;
}


i:hover {
    //outline: 0!important;
    //-webkit-tap-highlight-color: transparent!important;
    color:#b8aade;
}

.category [component="category/topic"].unread .title a {
    color: #b8aade
}

.container-fluid>.navbar-collapse, .container-fluid>.navbar-header, .container>.navbar-collapse, .container>.navbar-header {
    margin-bottom: 20px;
}

.fa,.fab,.fad,.fal,.far,.fas {
    margin-right: 15px;
}

.breadcrumb {
    margin-top: 20px;
}

//title 

.form-control:focus {
    border-color: #b8aade;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgb(175, 154, 230,.6)
}


.load-bar .bar{
    background-color: #b8aade;
}

.bar:nth-child(1) {
    background-color: #b8aade;
    animation: loading 3s linear infinite;
}

#content {
    transition: opacity 150ms linear;
    margin-bottom: 20px;
    margin-top:20px
}

//编辑栏头
.pull-left {
    color: #bba7cf;
}

.btn.btn-primary a{
    color:#fff !important;
}

.topic .post-bar .tags a {
    color: #8e43b7;
}

.btn-primary {
    background-color: #8674d6!important;
    border-color: #b8aade!important;
}

.composer .mobile-navbar {
    background: #8674d6;
}

.btn-primary:hover {
    color: #fff;
    background-color: #8674d6;
    border-color: #b8aade;
}


.btn-primary.focus,.btn-primary:focus {
    color: #fff;
    background-color: #694a9f;
    border-color: #b8aade
}

.btn-primary:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #b8aade
}

.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary {
    color: #fff;
    background-color: #694a9f;
    border-color: #204d74
}

.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover {
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-primary .badge {
    color: #6656c1;
    background-color: #fff
}

.btn-success {
    color: #fff;
    background-color: #8674d6;
    border-color: #8674d6
}
//编辑栏头
.btn-primary {
    background-color: #8674d6;
    border-color: #b8aade;
}

.composer .mobile-navbar {
    background: #8674d6;
}

.btn-primary:hover {
    color: #fff;
    background-color: #8674d6;
    border-color: #b8aade;
}


.btn-primary.focus,.btn-primary:focus {
    color: #fff;
    background-color: #694a9f;
    border-color: #b8aade
}

.btn-primary:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #b8aade
}

.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary {
    color: #fff;
    background-color: #694a9f;
    border-color: #204d74
}

.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover {
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-primary .badge {
    color: #6656c1;
    background-color: #fff
}

.btn-success {
    color: #fff;
    background-color: #8674d6;
    border-color: #8674d6
}

.btn-success.focus,.btn-success:focus {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success {
    background-image: none
}

.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover {
    background-color: #8674d6;
    border-color: #694a9f
}


.btn-success.focus,.btn-success:focus {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover {
    color: #fff;
    background-color: #694a9f;
    border-color: #8674d6
}

.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success {
    background-image: none
}

.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover {
    background-color: #8674d6;
    border-color: #694a9f
}


//手机侧边栏
#menu a, #menu button {
    color: #9089b5;
}

.tag-list .tag-container a {
    color: #ffffff; 
    padding: 1px 3px;
    border-radius: 2px;
    border: 1px solid #9089b5;
    background-color:#694a9f
}

.nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover {
    color: #fff;
    background-color: #694a9f;
}
//label
.label-info {
    background-color: #694a9f;
}

//-------------------------主题颜色-------------------------


.tag-list .tag-container a:hover {
    color: #d3cef5;
}

.navbar-default #main-nav li>a:hover {
    border-bottom-color: #b8aade;
}

.navbar-default .navbar-brand {
    font-weight: bold;
    color: #6a5acd;
    font-size: 48px;
}


.navbar-default #main-nav .active>a {
    color: #6a5acd;
    background: 0 0;
}

.category .topics-header .header-title {
    border-bottom: 2px solid #6a5acd;
}

.categories .categories-header .header-title {
    border-bottom: 2px solid #6a5acd;
}


.categories .category-info .category-info-content .category-icon {
    color: #6a5acd;
}

.categories .category-info .subcategories .subcategory .subcategory-icon {
    color:#8674d6;
}

//-------------------------主题颜色-------------------------END

a.category-title{
  position: relative;
}

a.category-title::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background-color: #6a5acd;
    bottom: 0;
    left: 0;
    transform-origin: right;
    transform: scaleX(0);
    transition: transform .3s ease-in-out;
}

a.category-title:hover{
    color: #6a5acd;
}
//鼠标悬浮动画
a.category-title:hover::before {
  transform-origin: left;
  transform: scaleX(1);
}

a.subcategory-title {
  text-decoration: none;
  color: #6a5acd;
  font-weight: 700;
  position: relative;
}

a.subcategory-title::before {
  content: '';
  background-color: hsla(255,100%,80%,0.75);
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 3px;
  z-index: -1;
  transition: all .3s ease-in-out;
}

a.subcategory-title:hover{
    color: #6a5acd;
}

a.subcategory-title:hover::before {
  bottom: 0;
  height: 100%;
}

使用效果

  • 原版效果
    在这里插入图片描述
    纯静态页面

  • 紫色效果
    请添加图片描述

在主标题和副标题页加入了交互动画效果


分割线

上面的方法纯属犯蠢
详情请见 : https://github.com/pichalite/nodebb-theme-slick/blob/master/less/variables.less#L23
但是动画效果还是可以用参考的

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值