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

less中使用if函数结果异常 #292

Open
berwin0415 opened this issue Jun 8, 2022 · 1 comment
Open

less中使用if函数结果异常 #292

berwin0415 opened this issue Jun 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@berwin0415
Copy link

在less文件中使用if函数进行条件判断,最后结果异常
代码

.max (@bool) {
    width: if(@bool, 520px, 100%);
}

.box {
    .max(true);

    .inner {
        .max(false);
    }
}
      <div className={styles.box}>
          <div className={styles.inner}>test</div>
      </div>

结果:
image
image

@otakustay
Copy link
Member

这个大概率是less-plugin-function的冲突,不是很好修,会很花时间。如果可以避开的话,建议先劈开,比如干脆css-in-js

@otakustay otakustay added the bug Something isn't working label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants