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

Units dropped from random() $limit #1890

Open
5 of 8 tasks
chriseppstein opened this issue Nov 10, 2015 · 8 comments
Open
5 of 8 tasks

Units dropped from random() $limit #1890

chriseppstein opened this issue Nov 10, 2015 · 8 comments
Assignees
Labels
blocked Waiting on another issue to be fixed bug Something isn't working proposal accepted A full proposal for this feature has been marked accepted requires deprecation Blocked on a deprecation cycle

Comments

@chriseppstein
Copy link

chriseppstein commented Nov 10, 2015

Deprecation

Final


(Original:)

The unit passed with the limit should be the unit on the returned value. Instead the unit is dropped and never considered nor is an error raised.

Step 1:
Deprecate passing units to random() as the $limit.

Step 2:
Make passing a unit to random() as the $limit an error.

Step 3:
Allow units to be passed in, returning them with the random result.

@jcutrell
Copy link

Is the desire to have random() be redefined to use random($limit, $unit), where $unit is optional?

@nex3 nex3 added bug Something isn't working requires deprecation Blocked on a deprecation cycle labels Apr 6, 2018
@nex3
Copy link
Contributor

nex3 commented Jun 16, 2022

@jcutrell No, the desire is to (ultimately) have math.random(10px) return a number with the unit px.

@Goodwine Goodwine self-assigned this Jul 19, 2022
@Goodwine Goodwine added the blocked Waiting on another issue to be fixed label Jul 22, 2022
@Goodwine
Copy link
Member

Blocking until feedback arrives from proposal

https://github.com/sass/sass/blob/main/proposal/random-with-units.md

@Goodwine
Copy link
Member

Updated main comment with:

Proposal

Deprecation

Final

@nex3
Copy link
Contributor

nex3 commented Jul 23, 2022

Now that the proposal has landed, we'll give this a month for public comment since it's a low-controversy breaking change.

@stof
Copy link
Contributor

stof commented Jul 26, 2022

@nex3 shouldn't this proposal be announced on the blog if you expect comments on it ?

@Goodwine
Copy link
Member

Per the contributing guidelines

Public comments are solicited for the feature, usually via a tweet from @SassCSS. If the feature is big enough, a blog post soliciting feedback may also be written

Assuming that because this enhancement/fix is small and uncontroversial it doesn't cross that threshold 🤔

@Goodwine Goodwine added the proposal accepted A full proposal for this feature has been marked accepted label Aug 17, 2022
@Goodwine
Copy link
Member

Deprecation added, now waiting on Dart 2.0.0 to implement spec

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 bug Something isn't working proposal accepted A full proposal for this feature has been marked accepted requires deprecation Blocked on a deprecation cycle
Projects
None yet
Development

No branches or pull requests

5 participants