mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
- Updates Material Design toggle background & box-shadow to match spec - Adds the following variables: --handle-box-shadow, --handle-height, --handle-max-height, --handle-transition, --handle-width, --handle-spacing - Improves customization of toggle by inheriting properties where possible and auto-adjusting the handle height and position based on the width and height of the toggle Closes #19868, closes #20474
78 lines
3.1 KiB
SCSS
78 lines
3.1 KiB
SCSS
@import "../../themes/ionic.globals.ios";
|
|
@import "../item/item.ios.vars";
|
|
|
|
// iOS Toggle
|
|
// --------------------------------------------------
|
|
|
|
/// @prop - Width of the toggle
|
|
$toggle-ios-width: 51px !default;
|
|
|
|
/// @prop - Height of the toggle
|
|
$toggle-ios-height: 32px !default;
|
|
|
|
/// @prop - Border width of the toggle
|
|
$toggle-ios-border-width: 2px !default;
|
|
|
|
/// @prop - Border radius of the toggle
|
|
$toggle-ios-border-radius: $toggle-ios-height / 2 !default;
|
|
|
|
/// @prop - Background color of the unchecked toggle
|
|
$toggle-ios-background-color-off: rgba($text-color-rgb, .088) !default;
|
|
|
|
/// @prop - Background color of the checked toggle
|
|
$toggle-ios-background-color-on: ion-color(primary, base) !default;
|
|
|
|
/// @prop - Width of the toggle handle
|
|
$toggle-ios-handle-width: calc(#{$toggle-ios-height} - (#{$toggle-ios-border-width} * 2)) !default;
|
|
|
|
/// @prop - Height of the toggle handle
|
|
$toggle-ios-handle-height: $toggle-ios-handle-width !default;
|
|
|
|
/// @prop - Max height of the toggle handle
|
|
$toggle-ios-handle-max-height: calc(100% - (var(--handle-spacing) * 2)) !default;
|
|
|
|
/// @prop - Border radius of the toggle handle
|
|
$toggle-ios-handle-border-radius: $toggle-ios-width / 2 !default;
|
|
|
|
/// @prop - Box shadow of the toggle handle
|
|
$toggle-ios-handle-box-shadow: 0 3px 12px rgba(0, 0, 0, .16), 0 3px 1px rgba(0, 0, 0, .1) !default;
|
|
|
|
/// @prop - Background color of the toggle handle
|
|
$toggle-ios-handle-background-color: #ffffff !default;
|
|
|
|
/// @prop - Margin of the toggle handle
|
|
$toggle-ios-media-margin: 0 !default;
|
|
|
|
/// @prop - Transition duration of the toggle icon
|
|
$toggle-ios-transition-duration: 300ms !default;
|
|
|
|
/// @prop - Transition of the toggle icon
|
|
$toggle-ios-transition: transform $toggle-ios-transition-duration, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms, right 110ms ease-in-out 80ms !default;
|
|
|
|
/// @prop - Opacity of the disabled toggle
|
|
$toggle-ios-disabled-opacity: .3 !default;
|
|
|
|
/// @prop - Padding top of the toggle positioned on the start in an item
|
|
$toggle-ios-item-start-padding-top: 6px !default;
|
|
|
|
/// @prop - Padding end of the toggle positioned on the start in an item
|
|
$toggle-ios-item-start-padding-end: 16px !default;
|
|
|
|
/// @prop - Padding bottom of the toggle positioned on the start in an item
|
|
$toggle-ios-item-start-padding-bottom: 5px !default;
|
|
|
|
/// @prop - Padding start of the toggle positioned on the start in an item
|
|
$toggle-ios-item-start-padding-start: 0 !default;
|
|
|
|
/// @prop - Padding top of the toggle positioned on the end in an item
|
|
$toggle-ios-item-end-padding-top: 6px !default;
|
|
|
|
/// @prop - Padding end of the toggle positioned on the end in an item
|
|
$toggle-ios-item-end-padding-end: ($item-ios-padding-end / 2) !default;
|
|
|
|
/// @prop - Padding bottom of the toggle positioned on the end in an item
|
|
$toggle-ios-item-end-padding-bottom: 5px !default;
|
|
|
|
/// @prop - Padding start of the toggle positioned on the end in an item
|
|
$toggle-ios-item-end-padding-start: $item-ios-padding-start !default;
|