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

Deprecation message replaces underscores with hyphens #2180

Closed
mikeybinns opened this issue Feb 20, 2024 · 2 comments · Fixed by #2185
Closed

Deprecation message replaces underscores with hyphens #2180

mikeybinns opened this issue Feb 20, 2024 · 2 comments · Fixed by #2185
Assignees
Labels
bug cosmetic Doesn't affects CSS semantics

Comments

@mikeybinns
Copy link

For some reason, when I see a deprecation message, the recommendation it provides replaces the underscores with hyphens, which then breaks the code. I'm not sure if this happens with the automatic migrator as I'm not using it.

image

Steps to recreate:

  1. set up a sass file, add 2 variables with underscores in the name
  2. divide one variable by another
  3. compile the sass to see the message

The projects I've seen this on use Gulp and Gulp Sass, with this package passed into gulp-sass.

@ntkme
Copy link
Contributor

ntkme commented Feb 20, 2024

Sass identifiers treat hyphens and underscores as identical. So, it should not break your code even if you apply it as is.

Technically, we can attempt to use source mapping to get the original input for variable name for recommendation, but it's only cosmetic.

@mikeybinns
Copy link
Author

Well I've learned something today. I still think it's worth fixing. I would wager there's a large amount of people who don't know that, and so it would be a source of confusion if there were mixed hyphens or underscores for the same variable name, as many other languages treat them differently.

It may also break certain intellisense plugins such as this one for VS Code which has over 1 million downloads. I understand that this is technically a bug in that extension, but I think it should still be considered due to its popularity.

I also personally prefer underscores to hyphens simply because with underscores, you can double click to select the whole variable name, where as with hyphens, it will only select part of that name.

@nex3 nex3 self-assigned this Feb 22, 2024
@nex3 nex3 added bug cosmetic Doesn't affects CSS semantics labels Feb 22, 2024
nex3 added a commit that referenced this issue Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cosmetic Doesn't affects CSS semantics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants