-
Notifications
You must be signed in to change notification settings - Fork 4.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
RangeControl: Update the default marks styles to match the padding/margin control #67611
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -197 B (-0.01%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
Flaky tests detected in 25679e2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12184741165
|
I would support unifying on the left one for the immediate future, and then keep exploring visual enhancements to that, for example those tracked in #43412. But I believe @jameskoster had some designs too, so would love his thoughts. |
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.
This is looking good overall.
DataViews "preview size" in grid view.
Are there any changes to be made in dataviews, similarly to how we are removing CSS overrides in the spacing controls?
@media not ( prefers-reduced-motion ) { | ||
transition: left ease 0.1s; | ||
} |
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.
This animation introduces a subtle delay when dragging the thumb that can make the UI feel unresponsive. We could consider removing it for the time being, and focus this PR on updating the marks design.
(also, in the block editor "custom" version, this animation was only applied when the is-marked class is applied — just noting in case that was deliberate)
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.
The animation already exists in padding/margin so removing it could be seen as a regression in the behavior of the component.
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.
@jasmussen should we remove the animation or keep it?
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.
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.
Got it — I will then propose that we keep the animation only when the component is showing marks (like it was in the deleted code from packages/block-editor/src/components/spacing-sizes-control/style.scss
). I can open a PR for that
@media not ( prefers-reduced-motion ) { | ||
transition: width ease 0.1s; | ||
} |
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.
It looks like this animation is there to go hand in hand with the thumb's animation — we should remove it if we remove the thumb's animation.
(sidenote: animating the width
is not very performant, and can cause the UI to feel sluggish instead of polishing the animation).
If were to keep the animation around, we could add a comment to help future readers understand that the track and thumb animations go hand in hand.
No, they'll just inherit the new styles (they were using the old ones) |
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.
The mark labels feel a bit far now, how about something like 8px here:
diff --git a/packages/components/src/range-control/styles/range-control-styles.ts b/packages/components/src/range-control/styles/range-control-styles.ts
index 638ccde548..449ea488d2 100644
--- a/packages/components/src/range-control/styles/range-control-styles.ts
+++ b/packages/components/src/range-control/styles/range-control-styles.ts
@@ -167,7 +167,7 @@ export const MarkLabel = styled.span`
color: ${ COLORS.gray[ 300 ] };
font-size: 11px;
position: absolute;
- top: 22px;
+ top: 8px;
white-space: nowrap;
${ rtl( { left: 0 } ) };
Before | After |
---|---|
packages/components/src/range-control/styles/range-control-styles.ts
Outdated
Show resolved
Hide resolved
I think those are bigger changes that should be explored separately. Looking back I worry the design diverges from traditional range appearance a bit too much. |
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.
LGTM, thanks!
Let's ship unless I misunderstood @jameskoster comment about this PR. What I got from that comment is the he's concerned about the suggestions of this issue.
Discovered in #67544 (comment)
What?
Right now, in the code base we have two different styles for the range control
It seems the second one is kind of a random unintended addition and that we always wanted the former to be the default style for the marks. This PR updates the default style and removes the overrides.
Testing Instructions
This is used in only two places in Gutenberg right now, you can check both of them: