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

发布于 2022-09-04 07:25:20 字数 1129 浏览 12 评论 0

以下是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,所以不能直接修改源码编译。
请问有没有什么办法?
万分感谢!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好久不见√ 2022-09-11 07:25:20

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文