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

Interpolation variable in calc() function #786

Open
danny007in opened this issue Mar 21, 2023 · 5 comments
Open

Interpolation variable in calc() function #786

danny007in opened this issue Mar 21, 2023 · 5 comments
Labels
Help wanted 🙋 Help is needed New rule 👌 Ready to be created as a new rule

Comments

@danny007in
Copy link

Rule Example

Allow

 border-top: calc(#{$table-border-width} * 2) 

Disallow

 border-top: calc($table-border-width * 2) 

To solve twbs/bootstrap#38278

@danny007in danny007in changed the title Interpolation in calc() function variable Interpolation variable in calc() function Mar 21, 2023
@kristerkari
Copy link
Collaborator

@danny007in Maybe this could be a more generic rule, like disallowing interpolation in function call arguments?

@kristerkari kristerkari added Help wanted 🙋 Help is needed New rule 👌 Ready to be created as a new rule labels Mar 22, 2023
@danny007in
Copy link
Author

PR Created in #787

@kristerkari
Copy link
Collaborator

@danny007in Thanks! I just realized that you want the rule to do the opposite of what I was saying in my previous comment.

I'm still however thinking if there is a need for this kind of rule in stylelint-scss. It seems very specific to the problem with calc, and I'm wondering if this is a common problem at all?

The other option would be just to add a custom rule to the project in question (bootstrap) to catch this specific calc related problem.

@danny007in
Copy link
Author

@kristerkari to solve twbs/bootstrap#38278

@kristerkari
Copy link
Collaborator

@danny007in I already had a look at the problem that you are trying to solve, but I'm not sure that creating a new rule just for that would make sense.

What I was thinking is that https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/dollar-variable-no-missing-interpolation rule could be instead improved to handle calc() calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted 🙋 Help is needed New rule 👌 Ready to be created as a new rule
Development

No branches or pull requests

2 participants