Skip to content

🧐[问题] CSS Modules下 antd-style应该怎么嵌套样式? #184

Open
@wangchaoHeart

Description

@wangchaoHeart

🧐 问题描述

CSS Modules下 antd-style应该怎么嵌套样式, 应该怎么写?

💻 示例代码

// js

import styles from 'index.less'
export default()=>{
  return <div className={styles.wrap}>
          <div className={styles.title}> 我是wrap下的标题的标题</div>
          <div className={styles.box}>
            <div className={styles.title}>
              我是box下的标题
            </div>
          </div>
        </div>
}

// index.less

.wrap {
  .title {
    color: red;
  }

  .box {
      .title {
        color: blue;
      }
  }
}

上面是我的业务代码,如果想转换成 antd-style的createStyles,应该怎么实现?

🚑 其他信息

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions