https://sass-lang.com/documentation/breaking-changes/if-function/

In 2010, shortly after adding the boolean value type, Sass added the global if() function as a way to easily use booleans in a single expression without having to write out an entire @if rule. This function had the signature if($condition, $if-true, $if-false) and returned $if-true if $condition was truthy and $if-false otherwise.

At the time, browsers didn’t even support @media queries and we never imagined that CSS might support its own if() function someday. But fifteen years later, support for the CSS if() function began landing in browsers and we had to do so as well in order to remain fully CSS-compatible.

요약하자면, "우리가 if()함수를 전역으로 넣을 때까지만 해도 CSS에 if 함수가 도입될거라곤 상상도 못했어"

대안으로 제시하는 문법은 아직 사용하지 못하는 곳이 있을테니 당분간 @if and @else 규칙 쓰는게 나을듯.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://hackers.pub/ap/notes/019b01df-6b6a-7aa3-8401-ce852c2271a5 on your instance and quote it. (Note that quoting is not supported in Mastodon.)