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

Mixin Names: dash character and underscore character seem to be treated as equals #1549

Closed
tbremer opened this issue Dec 2, 2014 · 3 comments

Comments

@tbremer
Copy link

tbremer commented Dec 2, 2014

See the sassmeister link for a working example.

But essentially, these are treated as equals:

@mixin under_score {
  content: 'under_score';
}

html {
  @include under_score;
  @include under-score;
}

Is this purposeful?

@Snugug
Copy link

Snugug commented Dec 2, 2014

Yes, underscores and dashes are treated the same in both function and mixin names.

@stephnr
Copy link

stephnr commented Dec 2, 2014

👍 very interesting find

@nex3
Copy link
Contributor

nex3 commented Dec 3, 2014

Yes, this is purposeful. Back before 3.0, only underscores were allowed in identifiers. When we added support for hyphens to match CSS's syntax, we wanted it to be possible for code to remain compatible by continuing to use underscores but still be callable in the new, nicer-looking syntax so we made them equivalent.

@nex3 nex3 closed this as completed Dec 3, 2014
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

4 participants