mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
59
dist/css/ionic.css
vendored
59
dist/css/ionic.css
vendored
@ -3911,31 +3911,27 @@ input[type="checkbox"][readonly] {
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block; }
|
display: inline-block; }
|
||||||
|
|
||||||
.toggle input[type="checkbox"] {
|
/* hide the actual input checkbox */
|
||||||
/* set the actual checkbox input to have a width/height */
|
.toggle input {
|
||||||
/* but hide its appearance, then use :after to style it */
|
display: none; }
|
||||||
|
|
||||||
|
/* the track appearance when the toggle is "off" */
|
||||||
|
.toggle .track {
|
||||||
|
display: inline-block;
|
||||||
|
box-sizing: border-box;
|
||||||
width: 54px;
|
width: 54px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border: 0;
|
border: solid 2px #e5e5e5;
|
||||||
background: transparent;
|
border-radius: 20px;
|
||||||
-webkit-appearance: none;
|
background-color: #e5e5e5;
|
||||||
/* the track appearance when the toggle is "off" */ }
|
content: ' ';
|
||||||
.toggle input[type="checkbox"]:after {
|
cursor: pointer;
|
||||||
display: inline-block;
|
transition-timing-function: ease-in-out;
|
||||||
box-sizing: border-box;
|
transition-duration: 0.1s;
|
||||||
width: 100%;
|
transition-property: background-color, border; }
|
||||||
height: 100%;
|
|
||||||
border: solid 2px #e5e5e5;
|
|
||||||
border-radius: 20px;
|
|
||||||
background-color: #e5e5e5;
|
|
||||||
content: ' ';
|
|
||||||
cursor: pointer;
|
|
||||||
transition-timing-function: ease-in-out;
|
|
||||||
transition-duration: 0.1s;
|
|
||||||
transition-property: background-color, border; }
|
|
||||||
|
|
||||||
/* the handle (circle) thats inside the toggle's track area */
|
/* the handle (circle) thats inside the toggle's track area */
|
||||||
/* also the appearance when the handle is "off" */
|
/* also the handle's appearance when it is "off" */
|
||||||
.toggle .handle {
|
.toggle .handle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
@ -3945,25 +3941,26 @@ input[type="checkbox"][readonly] {
|
|||||||
height: 28px;
|
height: 28px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
transition: -webkit-transform 0.1s ease-in-out;
|
-webkit-transition: 0.1s ease-in-out;
|
||||||
|
transition: 0.1s ease-in-out;
|
||||||
/* used to create a larger (but hidden) hit area to slide the handle */ }
|
/* used to create a larger (but hidden) hit area to slide the handle */ }
|
||||||
.toggle .handle:before {
|
.toggle .handle:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -2px;
|
top: -4px;
|
||||||
left: -16px;
|
left: -22px;
|
||||||
display: table;
|
padding: 19px 35px;
|
||||||
padding: 17px 30px;
|
|
||||||
content: " "; }
|
content: " "; }
|
||||||
|
|
||||||
/* The track when the toggle is "on" */
|
/* the track when the toggle is "on" */
|
||||||
.toggle input:checked:after {
|
.toggle input:checked + .track {
|
||||||
border-color: #4a87ee;
|
border-color: #4a87ee;
|
||||||
background-color: #4a87ee; }
|
background-color: #4a87ee; }
|
||||||
|
|
||||||
/* the handle when the toggle is "on" */
|
/* the handle when the toggle is "on" */
|
||||||
.toggle input:checked + .handle {
|
.toggle input:checked + .track .handle {
|
||||||
background-color: white;
|
-webkit-transform: translate(22px, 0);
|
||||||
-webkit-transform: translate3d(22px, 0, 0); }
|
transform: translate(22px, 0);
|
||||||
|
background-color: white; }
|
||||||
|
|
||||||
/* make sure list item content have enough padding on right to fit the toggle */
|
/* make sure list item content have enough padding on right to fit the toggle */
|
||||||
.item-toggle .item-content {
|
.item-toggle .item-content {
|
||||||
|
|||||||
2
dist/js/ionic-angular.js
vendored
2
dist/js/ionic-angular.js
vendored
@ -1351,7 +1351,7 @@ angular.module('ionic.ui.toggle', [])
|
|||||||
replace: true,
|
replace: true,
|
||||||
require: '?ngModel',
|
require: '?ngModel',
|
||||||
scope: true,
|
scope: true,
|
||||||
template: '<div class="toggle"><input type="checkbox"><div class="handle"></div></div>',
|
template: '<div class="toggle"><input type="checkbox"><div class="track"><div class="handle"></div></div></div>',
|
||||||
|
|
||||||
link: function($scope, $element, $attr, ngModel) {
|
link: function($scope, $element, $attr, ngModel) {
|
||||||
var checkbox, handle;
|
var checkbox, handle;
|
||||||
|
|||||||
2
js/ext/angular/src/directive/ionicToggle.js
vendored
2
js/ext/angular/src/directive/ionicToggle.js
vendored
@ -8,7 +8,7 @@ angular.module('ionic.ui.toggle', [])
|
|||||||
replace: true,
|
replace: true,
|
||||||
require: '?ngModel',
|
require: '?ngModel',
|
||||||
scope: true,
|
scope: true,
|
||||||
template: '<div class="toggle"><input type="checkbox"><div class="handle"></div></div>',
|
template: '<div class="toggle"><input type="checkbox"><div class="track"><div class="handle"></div></div></div>',
|
||||||
|
|
||||||
link: function($scope, $element, $attr, ngModel) {
|
link: function($scope, $element, $attr, ngModel) {
|
||||||
var checkbox, handle;
|
var checkbox, handle;
|
||||||
|
|||||||
@ -197,6 +197,13 @@
|
|||||||
// CSS3 PROPERTIES
|
// CSS3 PROPERTIES
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
// Appearance
|
||||||
|
@mixin appearance($val) {
|
||||||
|
-webkit-appearance: $val;
|
||||||
|
-moz-appearance: $val;
|
||||||
|
appearance: $val;
|
||||||
|
}
|
||||||
|
|
||||||
// Border Radius
|
// Border Radius
|
||||||
@mixin border-radius($radius) {
|
@mixin border-radius($radius) {
|
||||||
-webkit-border-radius: $radius;
|
-webkit-border-radius: $radius;
|
||||||
|
|||||||
@ -8,35 +8,30 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle input[type="checkbox"] {
|
/* hide the actual input checkbox */
|
||||||
/* set the actual checkbox input to have a width/height */
|
.toggle input {
|
||||||
/* but hide its appearance, then use :after to style it */
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the track appearance when the toggle is "off" */
|
||||||
|
.toggle .track {
|
||||||
|
display: inline-block;
|
||||||
|
box-sizing: border-box;
|
||||||
width: $toggle-width;
|
width: $toggle-width;
|
||||||
height: $toggle-height;
|
height: $toggle-height;
|
||||||
border: 0;
|
border: solid $toggle-border-width $toggle-off-border-color;
|
||||||
background: transparent;
|
border-radius: $toggle-border-radius;
|
||||||
-webkit-appearance: none;
|
background-color: $toggle-off-bg-color;
|
||||||
|
content: ' ';
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
/* the track appearance when the toggle is "off" */
|
transition-timing-function: ease-in-out;
|
||||||
&:after {
|
transition-duration: $toggle-transition-duration;
|
||||||
display: inline-block;
|
transition-property: background-color, border;
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: solid $toggle-border-width $toggle-off-border-color;
|
|
||||||
border-radius: $toggle-border-radius;
|
|
||||||
background-color: $toggle-off-bg-color;
|
|
||||||
content: ' ';
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
transition-timing-function: ease-in-out;
|
|
||||||
transition-duration: $toggle-transition-duration;
|
|
||||||
transition-property: background-color, border;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the handle (circle) thats inside the toggle's track area */
|
/* the handle (circle) thats inside the toggle's track area */
|
||||||
/* also the appearance when the handle is "off" */
|
/* also the handle's appearance when it is "off" */
|
||||||
.toggle .handle {
|
.toggle .handle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: $toggle-border-width;
|
top: $toggle-border-width;
|
||||||
@ -46,29 +41,28 @@
|
|||||||
height: $toggle-handle-height;
|
height: $toggle-handle-height;
|
||||||
border-radius: $toggle-handle-radius;
|
border-radius: $toggle-handle-radius;
|
||||||
background-color: $toggle-handle-off-bg-color;
|
background-color: $toggle-handle-off-bg-color;
|
||||||
transition: -webkit-transform $toggle-transition-duration ease-in-out;
|
@include transition($toggle-transition-duration ease-in-out);
|
||||||
|
|
||||||
/* used to create a larger (but hidden) hit area to slide the handle */
|
/* used to create a larger (but hidden) hit area to slide the handle */
|
||||||
&:before {
|
&:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -2px;
|
top: -4px;
|
||||||
left: ( ($toggle-handle-width / 2) * -1) - 2;
|
left: ( ($toggle-handle-width / 2) * -1) - 8;
|
||||||
display: table;
|
padding: ($toggle-handle-height / 2) + 5 ($toggle-handle-width + 7);
|
||||||
padding: ($toggle-handle-height / 2) + 3 ($toggle-handle-width + 2);
|
|
||||||
content: " ";
|
content: " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The track when the toggle is "on" */
|
/* the track when the toggle is "on" */
|
||||||
.toggle input:checked:after {
|
.toggle input:checked + .track {
|
||||||
border-color: $toggle-on-border-color;
|
border-color: $toggle-on-border-color;
|
||||||
background-color: $toggle-on-bg-color;
|
background-color: $toggle-on-bg-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the handle when the toggle is "on" */
|
/* the handle when the toggle is "on" */
|
||||||
.toggle input:checked + .handle {
|
.toggle input:checked + .track .handle {
|
||||||
|
@include translate($toggle-width - $toggle-handle-width - ($toggle-border-width * 2), 0);
|
||||||
background-color: $toggle-handle-on-bg-color;
|
background-color: $toggle-handle-on-bg-color;
|
||||||
-webkit-transform: translate3d( $toggle-width - $toggle-handle-width - ($toggle-border-width * 2) ,0,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure list item content have enough padding on right to fit the toggle */
|
/* make sure list item content have enough padding on right to fit the toggle */
|
||||||
|
|||||||
@ -22,7 +22,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input type="checkbox" checked>
|
<input type="checkbox" checked>
|
||||||
<div class="handle"></div>
|
<div class="track">
|
||||||
|
<div class="handle"></div>
|
||||||
|
</track>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="item item-toggle">
|
<li class="item item-toggle">
|
||||||
@ -31,7 +33,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input type="checkbox" checked>
|
<input type="checkbox" checked>
|
||||||
<div class="handle"></div>
|
<div class="track">
|
||||||
|
<div class="handle"></div>
|
||||||
|
</track>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="item item-toggle">
|
<li class="item item-toggle">
|
||||||
@ -40,7 +44,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input type="checkbox">
|
<input type="checkbox">
|
||||||
<div class="handle"></div>
|
<div class="track">
|
||||||
|
<div class="handle"></div>
|
||||||
|
</track>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="item item-toggle">
|
<li class="item item-toggle">
|
||||||
@ -49,7 +55,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input type="checkbox">
|
<input type="checkbox">
|
||||||
<div class="handle"></div>
|
<div class="track">
|
||||||
|
<div class="handle"></div>
|
||||||
|
</track>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="item item-toggle">
|
<li class="item item-toggle">
|
||||||
@ -58,7 +66,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input type="checkbox" checked>
|
<input type="checkbox" checked>
|
||||||
<div class="handle"></div>
|
<div class="track">
|
||||||
|
<div class="handle"></div>
|
||||||
|
</track>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="item item-toggle">
|
<li class="item item-toggle">
|
||||||
@ -67,7 +77,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<label class="toggle">
|
<label class="toggle">
|
||||||
<input type="checkbox">
|
<input type="checkbox">
|
||||||
<div class="handle"></div>
|
<div class="track">
|
||||||
|
<div class="handle"></div>
|
||||||
|
</track>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user