css - 如何使sass文件中的某条声明无效化?

查看:152
本文介绍了css - 如何使sass文件中的某条声明无效化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

以下是Bootstrap 4.0 sass源码中关于轮播carousel的一部分:

.carousel-control {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: $carousel-control-width;
  font-size: $carousel-control-font-size;
  color: $carousel-control-color;
  text-align: center;
  text-shadow: $carousel-text-shadow;
  opacity: $carousel-control-opacity;
  // We can't have this transition here because WebKit cancels the carousel
  // animation if you trip this while in the middle of another animation.

  // Set gradients for backgrounds
  &.left {
    @include gradient-x($start-color: rgba(0,0,0,.5), $end-color: rgba(0,0,0,.0001));////////////////////////////////////
  }
  &.right {
    right: 0;
    left: auto;
    @include gradient-x($start-color: rgba(0,0,0,.0001), $end-color: rgba(0,0,0,.5));///////////////////////////////////
  }

  // Hover/focus state
  @include hover-focus {
    color: $carousel-control-color;
    text-decoration: none;
    outline: 0;
    opacity: .9;
  }

其中加了注释的两行实现了轮播部分两侧的渐暗效果。
我在练习中,发现这个效果十分不必要,希望能使之无效化。
由于我一直使用外部服务器提供的CDN,所以不能直接修改源码编译。
请问有没有什么办法?
万分感谢!

解决方案

css重写覆盖了呀。你看看是哪个css属性生效产生的效果。
Bootstrap没用id加样式吧。那你就给出现渐变的元素加上id,然后对上面的css属性重写。

这篇关于css - 如何使sass文件中的某条声明无效化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆