-
Notifications
You must be signed in to change notification settings - Fork 1.3k
#1203 slider improving label positioning and width #1376
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
Changes from all commits
4a99df3
5bb05c4
de779d3
0bc31d8
f8fe790
3e9edd3
97974ff
f85bfe4
ba8d4d8
aee85c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,43 @@ governing permissions and limitations under the License. | |
|
||
user-select: none; | ||
touch-action: none; | ||
|
||
width: var(--spectrum-global-dimension-size-2400); | ||
min-inline-size: var(--spectrum-slider-min-width); | ||
|
||
|
||
&.spectrum-Slider--positionTop { | ||
display: inline-flex; | ||
flex-direction: column; | ||
width: var(--spectrum-component-single-line-width); | ||
|
||
.spectrum-Slider-controls { | ||
/* If the user overrides the width of the field, propagate to the inner component */ | ||
width: calc(100% - calc(var(--spectrum-slider-controls-margin)) * 2); | ||
} | ||
} | ||
|
||
/* The side label variant of Field is inline, and fills as much space as needed | ||
* by default. If an explicit width is set, then the field flexes to fill available space. */ | ||
&.spectrum-Slider--positionSide { | ||
display: inline-flex; | ||
align-items: center; | ||
width: auto; | ||
|
||
|
||
.spectrum-Slider-controls { | ||
flex: 1; | ||
width: var(--spectrum-component-single-line-width); | ||
} | ||
.spectrum-Slider-labelContainer { | ||
margin-inline-end: calc(var(--spectrum-slider-label-gap-x) / 2); | ||
} | ||
|
||
.spectrum-Slider-value { | ||
text-align: start; | ||
} | ||
|
||
} | ||
} | ||
|
||
.spectrum-Slider-controls { | ||
|
@@ -66,10 +103,9 @@ governing permissions and limitations under the License. | |
z-index: auto; | ||
|
||
min-block-size: var(--spectrum-slider-height); | ||
min-inline-size: var(--spectrum-slider-min-width); | ||
|
||
/* These calculations prevent the track from spilling outside of the control */ | ||
inline-size: calc(100% - calc(var(--spectrum-slider-controls-margin) * 2)); | ||
inline-size: calc(100% - calc(var(--spectrum-slider-controls-margin))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the default width is being specified on the wrapping div now, I think you can revert this change here and remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. danni/devon removed it |
||
margin-inline-start: var(--spectrum-slider-controls-margin); | ||
min-block-size: var(--spectrum-slider-height); | ||
|
||
|
@@ -304,7 +340,6 @@ governing permissions and limitations under the License. | |
|
||
inline-size: auto; | ||
|
||
padding-block-start: var(--spectrum-fieldlabel-padding-top); | ||
|
||
font-size: var(--spectrum-text-size-text-label); | ||
line-height: var(--spectrum-line-height-text-label); | ||
|
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.
I thought textfield had the min width on the input parent not the field and input parent parent.
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.
Yeah honestly I don't know which is right. I am going to bring it up with Spectrum because I don't think I was specific enough when I asked them originally.