首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在代码行中使用多个:不在scss中

在代码行中使用多个:不在scss中
EN

Stack Overflow用户
提问于 2019-01-04 17:25:14
回答 1查看 32关注 0票数 0

也许这是一个愚蠢的问题,但我如何才能打破这行代码(用很多:not),这样它就不会那么长了:

代码语言:javascript
运行
复制
input {
  &:not(.ant-calendar-input):not(.ant-time-picker-panel-input):not(.ant-calendar-picker-input):not(.ant-time-picker-input) {
    width: 100%;
    height: 100px;
  }

我试过了,但不起作用:

代码语言:javascript
运行
复制
input {
  &:not(.ant-calendar-input),
  &:not(.ant-time-picker-panel-input),
  &:not(.ant-calendar-picker-input),
  &:not(.ant-time-picker-input) {
    width: 100%;
    height: 100px;
  }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-04 17:32:54

您的原始SCSS相当于以下SCSS:

代码语言:javascript
运行
复制
input {
  &:not(.ant-calendar-input) {
    &:not(.ant-time-picker-panel-input) {
      &:not(.ant-calendar-picker-input) {
        &:not(.ant-time-picker-input) {
          width: 100%;
          height: 100px;
        }
      }
    }
  }
}

这看起来更像SASS:

代码语言:javascript
运行
复制
input
  &:not(.ant-calendar-input)
    &:not(.ant-time-picker-panel-input)
      &:not(.ant-calendar-picker-input)
        &:not(.ant-time-picker-input)
          width: 100%
          height: 100px
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54036118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档