Closed nex3 closed 4 months ago
Hello,
I updated to 1.77.0 and noticed this also affects mixins starting with double underscores such as @mixin __fubar()
and their @include __fubar()
.
If this is intended it should probably be mentioned in the documentation
We only had a couple of old mixins using the __
prefix to mark them as "private". No big deal as the warning in the console was very helpful.
Bye.
It was intended. Underscores and hyphens are equivalent in Sass identifiers. We assume users are familiar with that fact, but I understand it may not be obvious.
From the docs:
Mixin names, like all Sass identifiers, treat hyphens and underscores as identical. This means that
reset-list
andreset_list
both refer to the same mixin.
Thanks, indeed not so obvious :-) From this example with the inline hyphens and underscores, I had never deduced that this also applies to prefixes which most languages handle very differently -- except CSS and as I learned now, Sass. It's always these "little things" that cause confusion :-)
I think @WebMechanic is right that this is a bug. The spec is ambiguous here, and there's not a strong reason for us to forbid functions from being written and referenced with double leading underscores.
See #2197 See sass/sass#3854 See sass/sass-spec#1982 [skip sass-embedded]