Skip to content

Add support for CSS round() with one unitless argument - #2436

Merged
nex3 merged 3 commits into
mainfrom
one-arg-round
Nov 15, 2024
Merged

nex3 merged 3 commits into
mainfrom
one-arg-round

Conversation

@nex3

@nex3 nex3 commented Nov 13, 2024

Copy link
Copy Markdown
Contributor

This also adds deprecation warnings for cases where a CSS calculation
is determined to need to mimic a global Sass function, to match the
global Sass function deprecation.

See sass/sass#3803
Closes #2433

See sass/sass-spec#2037

@nex3
nex3 requested a review from pamelalozano16 November 13, 2024 01:52
This also adds deprecation warnings for cases where a CSS calculation
is determined to need to mimic a global Sass function, to match the
global Sass function deprecation.

See sass/sass#3803
Closes #2433
Deprecation.globalBuiltin);
compatible = true;
}
if (compatible) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to just make compatible a const and return

return operator == CalculationOperator.plus
              ? left.plus(right)
              : left.minus(right);

either way? Since compatible is set to true if it's false.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compatible is only set to true if inLegacySassFunction != null && left.isComparableTo(right).

@nex3
nex3 merged commit 57a6853 into main Nov 15, 2024
@nex3
nex3 deleted the one-arg-round branch November 15, 2024 01:18
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

Successfully merging this pull request may close these issues.

Implement round() with no modulus

2 participants