mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
toggle updates
This commit is contained in:
@ -1,11 +1,14 @@
|
|||||||
|
|
||||||
|
// Toggle
|
||||||
|
// -------------------------------
|
||||||
|
|
||||||
/* the overall container of the toggle */
|
/* the overall container of the toggle */
|
||||||
.toggle {
|
.toggle {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hide the actual checkbox */
|
/* hide the actual <input type="checkbox"> */
|
||||||
.toggle input {
|
.toggle input[type="checkbox"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,9 +24,9 @@
|
|||||||
background-color: $toggle-off-bg-color;
|
background-color: $toggle-off-bg-color;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
transition-property: background-color, border;
|
|
||||||
transition-duration: $toggle-transition-duration;
|
|
||||||
transition-timing-function: ease-in-out;
|
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 */
|
||||||
@ -40,11 +43,11 @@
|
|||||||
/* used to create a larger hit area to slide the handle */
|
/* used to create a larger hit area to slide the handle */
|
||||||
&:before {
|
&:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
content: " ";
|
top: -2px;
|
||||||
|
left: ( ($toggle-handle-width / 2) * -1) - 2;
|
||||||
display: table;
|
display: table;
|
||||||
left: ( ($toggle-handle-width / 2) * -1);
|
padding: ($toggle-handle-height / 2) + 3 ($toggle-handle-width + 2);
|
||||||
top: ( ($toggle-handle-height / 2) * -1) + 3;
|
content: " ";
|
||||||
padding: ($toggle-handle-height / 2) ($toggle-handle-width + 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,37 +5,36 @@
|
|||||||
|
|
||||||
<!-- Sets initial viewport load and disables zooming -->
|
<!-- Sets initial viewport load and disables zooming -->
|
||||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link href="../dist/ionicons.css" rel="stylesheet">
|
<link href="../dist/css/ionic.css" rel="stylesheet">
|
||||||
<link href="../dist/ionic.css" rel="stylesheet">
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<section>
|
|
||||||
|
|
||||||
<header class="bar bar-header bar-dark">
|
<header class="bar bar-header bar-dark">
|
||||||
<h1 class="title">Input: Toggle</h1>
|
<h1 class="title">Input: Toggle</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<main class="content has-header">
|
<main class="content has-header">
|
||||||
|
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li class="list-item">
|
<li class="list-item">
|
||||||
Airplane Mode
|
Airplane Mode
|
||||||
<div class="toggle" id="airplaneMode">
|
<label class="toggle" id="airplaneMode">
|
||||||
<input type="checkbox" name="airplaneMode">
|
<input type="checkbox" name="airplaneMode">
|
||||||
<div class="track">
|
<div class="track">
|
||||||
<div class="handle"></div>
|
<div class="handle"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-item">
|
<li class="list-item">
|
||||||
Do Not Disturb
|
Do Not Disturb
|
||||||
<div class="toggle" id="doNotDisturb">
|
<label class="toggle" id="doNotDisturb">
|
||||||
<input type="checkbox" name="doNotDisturb" checked="checked">
|
<input type="checkbox" name="doNotDisturb" checked="checked">
|
||||||
<div class="track">
|
<div class="track">
|
||||||
<div class="handle"></div>
|
<div class="handle"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -54,11 +53,11 @@
|
|||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</section>
|
</div>
|
||||||
|
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||||
<script src="../dist/ionic.js"></script>
|
<script src="../dist/js/ionic.js"></script>
|
||||||
<script src="../dist/ionic-simple.js"></script>
|
<script src="../dist/js/ionic-simple.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<!-- for testing only -->
|
<!-- for testing only -->
|
||||||
|
|||||||
Reference in New Issue
Block a user