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

Improve unit strictness for function parameters #3374

Open
5 of 8 tasks
Tracked by #1734
nex3 opened this issue Aug 9, 2022 · 5 comments
Open
5 of 8 tasks
Tracked by #1734

Improve unit strictness for function parameters #3374

nex3 opened this issue Aug 9, 2022 · 5 comments
Assignees
Labels
blocked Waiting on another issue to be fixed enhancement New feature or request

Comments

@nex3
Copy link
Contributor

nex3 commented Aug 9, 2022

Deprecation

Removal


Currently, many notionally-unitless parameters to various color-manipulation functions isn't checked for units. This doesn't match our general desire to enforce units more strictly, and it can cause confusing messages like sass/dart-sass#1745. We should deprecate this and require the numbers to be unitless in Dart Sass 2.0.0.

Note that rgb, hsl, and hwb explicitly allow %-based alpha colors for historical reasons, which we don't intend to deprecate.

@nex3 nex3 added enhancement New feature or request requires deprecation Blocked on a deprecation cycle planned We would like to add this feature at some point labels Aug 9, 2022
@nex3 nex3 changed the title Forbid units for color function alpha parameters Forbid units for color function parameters Aug 9, 2022
@nex3 nex3 self-assigned this Aug 12, 2022
@nex3 nex3 changed the title Forbid units for color function parameters Forbid unused units for function parameters Aug 12, 2022
@nex3
Copy link
Contributor Author

nex3 commented Aug 12, 2022

Expanding this to cover functions beyond just colors—for example, list.nth() currently doesn't verify its index as unitless either.

@nex3 nex3 changed the title Forbid unused units for function parameters Improve unit strictness for function parameters Aug 13, 2022
@nex3
Copy link
Contributor Author

nex3 commented Aug 13, 2022

I'm expanding this again to support passing %s as $alpha for all color functions, since that's actually included in the CSS spec for the color functions it supports.

@nex3
Copy link
Contributor Author

nex3 commented Aug 19, 2022

Since this involves a relatively small breaking change, I'll give it a month for public comment.

@nex3 nex3 removed their assignment Aug 22, 2022
@nex3
Copy link
Contributor Author

nex3 commented Oct 28, 2022

This has had more than enough time to sit, so I'm going to get started on it.

@nex3 nex3 self-assigned this Oct 28, 2022
nex3 added a commit to sass/sass-spec that referenced this issue Oct 28, 2022
nex3 added a commit to sass/dart-sass that referenced this issue Oct 28, 2022
nex3 added a commit to sass/dart-sass that referenced this issue Oct 28, 2022
nex3 added a commit to sass/sass-site that referenced this issue Oct 28, 2022
This merges the color-units and random-with-units deprecation pages
into a single shared function-units page, updates the color-units
deprecations to reflect that Phase 2 has been enacted, and adds new
function unit deprecations.

See #511
See sass/sass#2904
See #662
See sass/sass#3374
nex3 added a commit to sass/sass-spec that referenced this issue Oct 28, 2022
nex3 added a commit to sass/sass-site that referenced this issue Oct 28, 2022
This merges the color-units and random-with-units deprecation pages
into a single shared function-units page, updates the color-units
deprecations to reflect that Phase 2 has been enacted, and adds new
function unit deprecations.

See #511
See sass/sass#2904
See #662
See sass/sass#3374
@nex3 nex3 added blocked Waiting on another issue to be fixed and removed planned We would like to add this feature at some point requires deprecation Blocked on a deprecation cycle labels Oct 28, 2022
nex3 added a commit that referenced this issue Oct 28, 2022
nex3 added a commit to sass/sass-site that referenced this issue Oct 28, 2022
This merges the color-units and random-with-units deprecation pages
into a single shared function-units page, updates the color-units
deprecations to reflect that Phase 2 has been enacted, and adds new
function unit deprecations.

See #511
See sass/sass#2904
See #662
See sass/sass#3374
@nex3
Copy link
Contributor Author

nex3 commented Mar 2, 2023

This is now waiting on Dart Sass 2.0.0

asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
This merges the color-units and random-with-units deprecation pages
into a single shared function-units page, updates the color-units
deprecations to reflect that Phase 2 has been enacted, and adds new
function unit deprecations.

See sass#511
See sass/sass#2904
See sass#662
See sass/sass#3374
asaf400 pushed a commit to asaf400/ass-site that referenced this issue Apr 18, 2024
This merges the color-units and random-with-units deprecation pages
into a single shared function-units page, updates the color-units
deprecations to reflect that Phase 2 has been enacted, and adds new
function unit deprecations.

See sass#511
See sass/sass#2904
See sass#662
See sass/sass#3374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on another issue to be fixed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant