Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wangchaoHeart opened this issue Dec 17, 2024 · 0 comments
Open

Comments

@wangchaoHeart
Copy link

wangchaoHeart commented Dec 17, 2024

🧐 问题描述

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,应该怎么实现?

🚑 其他信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant