-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(range): updating the range pin to always be visible when enabled for ionic theme #29988
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 20 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7e0dd91
First commit
OS-pedrolourenco 4b36e73
Finishing range styling
OS-pedrolourenco c65e3c9
Fixing lint issue
OS-pedrolourenco 06408d8
CR
OS-pedrolourenco 3152425
Merge branch 'next' into ROU-11323
OS-pedrolourenco 6004d45
CR + QA
OS-pedrolourenco 4db25bf
Fixing lint issue
OS-pedrolourenco 5300f3b
Merge branch 'next' into ROU-11323
OS-pedrolourenco 2ada43c
Updating the range pin to always be visible when enabled for the ioni…
OS-pedrolourenco e55f83d
CR
OS-pedrolourenco c2aede0
Merge branch 'next' into ROU-11323
OS-pedrolourenco 1129d9a
Merge branch 'ROU-11323' into ROU-11324
OS-pedrolourenco f27239a
Fixing one css issue caused by previous CR
OS-pedrolourenco 1a9493b
Fixing snapshot tests
OS-pedrolourenco b543e1f
Merge branch 'next' into ROU-11323
OS-pedrolourenco db3239a
Removing unnecessary import
OS-pedrolourenco d602f02
Merge branch 'ROU-11323' into ROU-11324
OS-pedrolourenco e3423a0
Fixing lint issues
OS-pedrolourenco 00541de
Fixing build issue
OS-pedrolourenco 7918734
Updating snapshot tests
OS-pedrolourenco a74024a
CR
OS-pedrolourenco eb17aa4
Merge branch 'next' into ROU-11323
OS-pedrolourenco bc373d5
Merge branch 'ROU-11323' into ROU-11324
OS-pedrolourenco 69c327c
CR
OS-pedrolourenco 10f6745
Fix broken snapshot tests
OS-pedrolourenco b0586fd
Merge branch 'ROU-11323' into ROU-11324
OS-pedrolourenco e82a68a
Fix broken snapshot tests
OS-pedrolourenco a6c3b8d
Fix lint issue
OS-pedrolourenco 44b8f4b
Merge branch 'next' into ROU-11323
OS-pedrolourenco c033d7c
Merge branch 'refs/heads/ROU-11323' into ROU-11324
OS-pedrolourenco 80cada6
CR - Revert percentage injection for ionic theme
OS-pedrolourenco e3363cf
Updating snapshot tests
OS-pedrolourenco 9c31e5e
Merge branch 'next' into ROU-11324
OS-pedrolourenco a25504e
Fix lint issue
OS-pedrolourenco 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,201 @@ | ||
| @use "../../themes/ionic/ionic.globals.scss" as globals; | ||
| @import "./range.common"; | ||
|
|
||
| // Ionic Range | ||
| // -------------------------------------------------- | ||
|
|
||
| :host { | ||
| --knob-border-radius: 50%; | ||
| --knob-background: #{globals.$ion-primitives-base-white}; | ||
| --knob-box-shadow: 0; | ||
| --knob-size: 22px; | ||
| --knob-handle-size: #{globals.$ion-scale-1000}; | ||
| --bar-height: #{globals.$ion-scale-200}; | ||
| --bar-background: #{globals.$ion-primitives-neutral-100}; | ||
| --bar-background-active: #{globals.ion-color(primary, base)}; | ||
| --bar-border-radius: #{globals.$ion-border-radius-400}; | ||
| --height: 42px; | ||
|
|
||
| @include globals.typography(globals.$ion-body-md-regular); | ||
|
|
||
| z-index: globals.$ion-z-index-100; | ||
| } | ||
|
|
||
| :host(.range-item-start-adjustment) { | ||
| @include padding(null, null, null, globals.$ion-space-600); | ||
| } | ||
|
|
||
| :host(.range-item-end-adjustment) { | ||
| @include padding(null, globals.$ion-space-600, null, null); | ||
| } | ||
|
|
||
| :host(.ion-color) .range-bar-active, | ||
| :host(.ion-color) .range-tick-active { | ||
| background: globals.current-color(base); | ||
| } | ||
|
|
||
| ::slotted(ion-icon[slot]) { | ||
| font-size: globals.$ion-font-size-600; | ||
| } | ||
|
|
||
| ::slotted([slot="start"]) { | ||
| @include margin(0, 16px, 0, 0); | ||
| } | ||
|
|
||
| ::slotted([slot="end"]) { | ||
| @include margin(0, 0, 0, 16px); | ||
| } | ||
|
|
||
| ::slotted([slot="label"]) { | ||
| max-width: globals.$ion-scale-5000; | ||
| } | ||
|
|
||
| :host(.range-has-pin:not(.range-label-placement-stacked)) { | ||
| /** | ||
| * The pin should not overlap any elements that are | ||
| * above the range. By adding padding to the top of the | ||
| * range, it provides a buffer for the pin to move into | ||
| * when it is pressed. | ||
| * | ||
| * The padding is not included when the label is stacked | ||
| * because the pin is below the label. | ||
| * It still requires a buffer to prevent the pin from | ||
| * overlapping the range. The buffer is added to the | ||
| * bottom of the range label instead of the host. | ||
| */ | ||
| @include padding(calc(globals.$ion-space-200 + globals.dynamic-font(12px)), null, null, null); | ||
| } | ||
|
|
||
| :host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper { | ||
| /** | ||
| * The pin should not overlap the stacked label. By adding | ||
| * margin to the bottom of the label, it provides a buffer | ||
| * for the pin to move into when it is pressed. | ||
| */ | ||
| @include margin(null, null, calc(globals.$ion-space-200 + globals.dynamic-font(12px)), null); | ||
| } | ||
|
|
||
| .range-bar-active { | ||
| bottom: 0; | ||
|
|
||
| width: auto; | ||
|
|
||
| background: var(--bar-background-active); | ||
|
|
||
| &.has-ticks { | ||
| @include border-radius(0); | ||
| @include margin(null, calc(-1 * globals.$ion-scale-100 * 0.5), null, calc(-1 * globals.$ion-scale-100 * 0.5)); | ||
| } | ||
| } | ||
|
|
||
| .range-tick { | ||
| @include margin-horizontal(calc(globals.$ion-scale-100 * -0.5), null); | ||
| @include border-radius(globals.$ion-border-radius-0); | ||
|
|
||
| position: absolute; | ||
| top: calc((42px * 0.5) - (globals.$ion-scale-300 * 0.5)); | ||
|
|
||
| width: globals.$ion-scale-100; | ||
| height: globals.$ion-scale-300; | ||
|
|
||
| background: globals.$ion-primitives-neutral-100; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| .range-tick-active { | ||
| background: var(--bar-background-active); | ||
| } | ||
|
|
||
| .range-pin { | ||
| @include padding(globals.$ion-space-300, globals.$ion-space-300, globals.$ion-space-300, globals.$ion-space-300); | ||
OS-pedrolourenco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| min-width: 28px; | ||
|
|
||
| transform: translate3d(0, calc(-100% + 11px), 0) scale(1); | ||
OS-pedrolourenco marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| background: transparent; | ||
|
|
||
| font-size: globals.dynamic-font(12px); | ||
|
|
||
| text-align: center; | ||
| } | ||
|
|
||
| .range-knob { | ||
| border-width: globals.$ion-border-size-025; | ||
| border-style: solid; | ||
| border-color: globals.ion-color(primary, base); | ||
| } | ||
|
|
||
| // Ionic Range: Disabled (based on iOS Range) | ||
| // -------------------------------------------------- | ||
| // When the range is disabled, the entire range, | ||
| // range label, any slotted labels, and any slotted | ||
| // icons need to receive the same opacity. | ||
|
|
||
| :host(.range-disabled) { | ||
| opacity: 0.3; | ||
| } | ||
|
|
||
| // Range Label Placement - Start | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.range-label-placement-start) .label-text-wrapper { | ||
| /** | ||
| * The margin between the label and | ||
| * the range should be on the end | ||
| * when the label sits at the start. | ||
| */ | ||
| @include margin(0, globals.$ion-space-400, 0, 0); | ||
| } | ||
|
|
||
| // Range Label Placement - End | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.range-label-placement-end) .label-text-wrapper { | ||
| /** | ||
| * The margin between the label and | ||
| * the range should be on the start | ||
| * when the label sits at the end. | ||
| */ | ||
| @include margin(0, 0, 0, globals.$ion-space-400); | ||
| } | ||
|
|
||
| // Range Label Placement - Fixed | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.range-label-placement-fixed) .label-text-wrapper { | ||
| /** | ||
| * The margin between the label and | ||
| * the range should be on the end | ||
| * when the label sits at the start. | ||
| */ | ||
| @include margin(0, globals.$ion-space-400, 0, 0); | ||
| } | ||
|
|
||
| // Range Label Placement - Stacked | ||
| // ---------------------------------------------------------------- | ||
|
|
||
| :host(.range-label-placement-stacked) .label-text-wrapper { | ||
| @include transform(scale(0.75)); | ||
|
|
||
| /** | ||
| * The margin between the label and | ||
| * the range should be on the bottom | ||
| * when the label sits on top. | ||
| */ | ||
| @include margin(null, 0, globals.$ion-space-400, 0); | ||
|
|
||
| /** | ||
| * Label text should not extend | ||
| * beyond the bounds of the range. | ||
| */ | ||
| max-width: calc(100% / 0.75); | ||
| } | ||
|
|
||
| :host(.in-item.range-label-placement-stacked) .label-text-wrapper { | ||
| @include margin(globals.$ion-space-250, null, globals.$ion-space-400, null); | ||
| } | ||
|
|
||
| :host(.in-item.range-label-placement-stacked) .native-wrapper { | ||
| @include margin(null, null, globals.$ion-space-0, null); | ||
| } | ||
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| @import "./range"; | ||
| @import "./range.native"; | ||
| @import "./range.ios.vars"; | ||
|
|
||
| // iOS Range | ||
|
|
||
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| @import "./range"; | ||
| @import "./range.native"; | ||
| @import "./range.md.vars"; | ||
|
|
||
| // Material Design Range | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Line 66 should be:
This will make it so the padding top is the height of the pin text + the space between the knob and pin text