如何使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,所以不能直接修改源码编译。
请问有没有什么办法?
万分感谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
css重写覆盖了呀。你看看是哪个css属性生效产生的效果。
Bootstrap没用id加样式吧。那你就给出现渐变的元素加上id,然后对上面的css属性重写。