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

Support slider for web platforms (Experimental) #130

Merged
merged 3 commits into from
Mar 21, 2022

Conversation

softmarshmallow
Copy link
Member

@softmarshmallow softmarshmallow commented Mar 20, 2022

Support slider with native html el - <input type="range"/>

Screen.Recording.2022-03-21.at.4.09.04.PM.mov

Limitations

  • progress fill (value) color is not customizable by chrome & safari.
/**
 * There are no proper way to handle the progress color in Chome, Safari.
 * Moz supports the `-moz-range-progress`, `-moz-range-track`, but this is [not standard](https://developer.mozilla.org/en-US/docs/Web/CSS/::-moz-range-progress)
 *
 * We use this trick instead.
 * https://codepen.io/okayoon/pen/PMpmjp
 *
 * this only works with overflow: hidden, so we cannot show overflowing round thumb.
 *
 * we can also do it by using linear-gradient, [but this can't be done only by using css](https://codepen.io/duplich/pen/qjYQEZ).
 *
 * @returns
 */
function _aberation_support_progress_fill_dirty({ color }: { color: Color }) {
  if (color === undefined) {
    return;
  }
  return {
    "box-shadow": `-100vw 0 0 100vw ${css.color(color)}`,
  };
}

@vercel
Copy link

vercel bot commented Mar 20, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/grida/designto-codes/9zXdvM7Cg1TRNhFMYuSMS82hEVnu
✅ Preview: https://designto-codes-git-support-slider-grida.vercel.app

@softmarshmallow softmarshmallow changed the title [Draft] Support slider for web platforms Support slider for web platforms (Experimental) Mar 21, 2022
@softmarshmallow softmarshmallow marked this pull request as ready for review March 21, 2022 07:10
@softmarshmallow softmarshmallow merged commit 92b24f1 into staging Mar 21, 2022
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.

None yet

1 participant