-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Slider] Adjust css to match the specification #26632
Conversation
Details of bundle changes (experimental) @material-ui/core: parsed: +0.29% , gzip: +0.17% |
@siriwatknp Do you have thoughts about this comment #22782 (comment), on the "size"/"density" aspect of the change? |
@oliviertassinari with the new approach that I made, <Slider dense /> the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the new approach that I made, dense is not hard to add. If I understand you correctly, this is what you expect right?
@siriwatknp I was wondering about something in this order. Something that would make it 1. easier for developers to migrate from v4 to v5, to the new design spec (especially when working on high-density dashboards) 2. allow to cover a wider range of use cases.
"do we want to put it on top of the spec or not"?
I think so. There are multiple precedents from us doing it.
<Slider dense />
For the API. If we envision use cases for different sizes through customizations, then an enum size
prop would probably work better, otherwise dense
.
Something seems broken with your screenshots in the PR's description, they are not at the right scale 😁 . I would expect:
not:
(on macOS GitHub automatically detect that my screenshot at 2:1 and resize them correctly, I don't know how it does that)
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. @oliviertassinari do we document changes like this as Breaking changes? We are for sure breaking any customization as the styles are different.
Added to |
The only solution I know is to use macOS 😁. The docs don't help https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files. Things I could notice: vertical alignment issue on this demo https://deploy-preview-26632--material-ui.netlify.app/components/slider/#continuous-sliders: It's even easier to spot when in touch pointer mode: Regarding the discussion on the density/size problem. @mnajdova Did you have any thoughts? I'm pinging @danilo-leal too. |
Fixed. |
2 ways I see,
|
I would add a third option: #26632 (comment)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🔥
I have pushed two more polishes for the vertical slider
- it feels too crowded here:
https://deploy-preview-26632--material-ui.netlify.app/components/slider/#vertical-sliders
- I have fixed the transition on the vertical slider
d109d33
to
e407941
Compare
I have rebased on HEAD to fix the prettier issue. We were a week behind. It's safer too. |
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
e407941
to
33f34fa
Compare
BREAKING CHANGE
Rework the CSS to match the latest Material Design guidelines and make custom styles more intuitive. See documentation.
You can reduce the density of the slider, closer to v4 with the
size="small"
prop.Closes #20153
Preview: https://deploy-preview-26632--material-ui.netlify.app/components/slider/
adjustment based on material design spec
add
size="small"
and testadd MusicPlayer demo light & dark mode (to test customisation)
I use this opportunity to refactor the CSS approach due to these issues I experienced.
thumb
, as a result need to adjust thumb margin and track, rail radius.mark
to not aligned center.Goal
to have these experiences when customizing the slider.
root
andrail, track
should scalerail, track
inherit fromroot
, so developers only need to adjust border-radius at one place.thumb
should still be centeredthumb
's size(width, height) should make it still centered:before
so that it is easier to remove and not conflict with existing box-shadowResult
Default Slider
Customized Slider