-
Notifications
You must be signed in to change notification settings - Fork 13.3k
feat(range): support dynamic type #28006
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6e93d0a
feat(range): add dynamic type support for ios
liamdebeasi d6af915
test(range): add screenshot test
liamdebeasi ab79c04
feat(range): add dynamic type support for md
liamdebeasi 5b8fad6
fix(range): pin transition is correct on ios
liamdebeasi f9a7f75
chore(): add updated snapshots
Ionitron 8aa87e1
lint
liamdebeasi d8767a9
Merge branch 'FW-4438' of https://github.com/ionic-team/ionic-framewo…
liamdebeasi aee5685
Add comments
liamdebeasi e7836e0
cleanup
liamdebeasi 57aec80
Merge branch 'FW-4146' into FW-4438
liamdebeasi a25fd15
chore(): add updated snapshots
Ionitron 3aaf6ad
fix screenshot
liamdebeasi 286bec1
chore(): add updated snapshots
Ionitron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,18 +16,24 @@ | |
| --height: #{$range-md-slider-height}; | ||
| --pin-background: #{ion-color(primary, base)}; | ||
| --pin-color: #{ion-color(primary, contrast)}; | ||
|
|
||
| // TODO FW-2997 Apply this to the start/end slots, and the native wrapper | ||
| font-size: $range-md-pin-font-size; | ||
| } | ||
|
|
||
| ::slotted([slot="label"]), .label-text { | ||
| // TODO FW-2997 Remove this | ||
| :host(.legacy-range) ::slotted([slot="label"]) { | ||
| font-size: initial; | ||
| } | ||
|
|
||
| :host(:not(.legacy-range)) ::slotted(:not(ion-icon)[slot="start"]), | ||
| :host(:not(.legacy-range)) ::slotted(:not(ion-icon)[slot="end"]), | ||
| :host(:not(.legacy-range)) .native-wrapper { | ||
| font-size: $range-md-pin-font-size; | ||
| } | ||
|
|
||
| // TODO FW-2997 remove this | ||
| :host(.legacy-range) { | ||
| @include padding($range-md-padding-vertical, $range-md-padding-horizontal); | ||
|
|
||
| font-size: $range-md-pin-font-size; | ||
| } | ||
|
|
||
| :host(.ion-color) .range-bar { | ||
|
|
@@ -53,7 +59,7 @@ | |
| } | ||
|
|
||
| :host(.range-has-pin) { | ||
| @include padding($range-md-padding-vertical + $range-md-pin-font-size + $range-md-pin-padding-vertical, null, null, null); | ||
| @include padding($range-md-pin-dimension, null, null, null); | ||
|
Contributor
Author
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. The existing padding did not account for the new pin size which is why I changed it here |
||
| } | ||
|
|
||
| .range-bar-active { | ||
|
|
@@ -117,21 +123,30 @@ | |
| @include border-radius(50%); | ||
| @include transform(translate3d(0, 0, 0), scale(.01)); | ||
|
|
||
| display: inline-block; | ||
| position: relative; | ||
| display: flex; | ||
|
|
||
| min-width: 28px; | ||
| height: 28px; | ||
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| /** | ||
| * The dimensions of the range need | ||
| * to scale with the size of the text | ||
| * which is why we use dynamic dimensions here. | ||
| */ | ||
| width: $range-md-pin-dimension; | ||
| height: $range-md-pin-dimension; | ||
|
|
||
| transition: transform 120ms ease, background 120ms ease; | ||
|
|
||
| background: var(--pin-background); | ||
| color: var(--pin-color); | ||
|
|
||
| text-align: center; | ||
|
|
||
| &::before { | ||
| @include position(3px, null, null, 50%); | ||
| /** | ||
| * The -1px here moves the ::before | ||
| * psuedo-element down to create a uniform pin shape. | ||
| */ | ||
| @include position(null, null, -1px, 50%); | ||
| @include margin-horizontal(-13px, null); | ||
|
|
||
| @include multi-dir() { | ||
|
|
@@ -160,9 +175,14 @@ | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Move the pin up by its full height | ||
| * plus a few pixels so the tip is above | ||
| * (but not touching) the knob. | ||
| */ | ||
| .range-knob-pressed .range-pin, | ||
| .range-knob-handle.ion-focused .range-pin { | ||
| @include transform(translate3d(0, -24px, 0), scale(1)); | ||
| transform: translate3d(0, calc(-100% + 4px), 0) scale(1); | ||
| } | ||
|
|
||
| @media (any-hover: hover) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-22 Bytes
(99%)
...11y/range.e2e.ts-snapshots/range-focus-with-pin-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...11y/range.e2e.ts-snapshots/range-focus-with-pin-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+157 Bytes
(110%)
...a11y/range.e2e.ts-snapshots/range-focus-with-pin-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
...11y/range.e2e.ts-snapshots/range-focus-with-pin-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
...a11y/range.e2e.ts-snapshots/range-focus-with-pin-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.89 KB
...ge/test/a11y/range.e2e.ts-snapshots/range-scale-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.76 KB
...e/test/a11y/range.e2e.ts-snapshots/range-scale-ios-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.96 KB
...ge/test/a11y/range.e2e.ts-snapshots/range-scale-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.61 KB
...nge/test/a11y/range.e2e.ts-snapshots/range-scale-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10 KB
...ge/test/a11y/range.e2e.ts-snapshots/range-scale-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.79 KB
...nge/test/a11y/range.e2e.ts-snapshots/range-scale-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11 Bytes
(100%)
...nge/test/basic/range.e2e.ts-snapshots/range-pin-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
...nge/test/basic/range.e2e.ts-snapshots/range-pin-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+133 Bytes
(100%)
...ange/test/basic/range.e2e.ts-snapshots/range-pin-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
...nge/test/basic/range.e2e.ts-snapshots/range-pin-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
...ange/test/basic/range.e2e.ts-snapshots/range-pin-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...11y/range.e2e.ts-snapshots/range-focus-with-pin-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...11y/range.e2e.ts-snapshots/range-focus-with-pin-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+97 Bytes
(100%)
...a11y/range.e2e.ts-snapshots/range-focus-with-pin-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-62 Bytes
(98%)
...11y/range.e2e.ts-snapshots/range-focus-with-pin-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12 Bytes
(100%)
...a11y/range.e2e.ts-snapshots/range-focus-with-pin-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.