| Index: third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
|
| diff --git a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
|
| index f8da18e7b0de6c59ef53948a9dc24bb3c5ed3c46..4c5b2fe3345d6cafbc7a1627f101b2305bc678f1 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
|
| +++ b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
|
| @@ -11,6 +11,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
| <link rel="import" href="../paper-styles/default-theme.html">
|
| <link rel="import" href="../paper-ripple/paper-ripple.html">
|
| <link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
|
| +<link rel="import" href="../iron-checked-element-behavior/iron-checked-element-behavior.html">
|
|
|
| <!--
|
| `paper-toggle-button` provides a ON/OFF switch that user can toggle the state
|
| @@ -29,9 +30,9 @@ Custom property | Description | Default
|
| `--paper-toggle-button-unchecked-bar-color` | Slider color when the input is not checked | `#000000`
|
| `--paper-toggle-button-unchecked-button-color` | Button color when the input is not checked | `--paper-grey-50`
|
| `--paper-toggle-button-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--dark-primary-color`
|
| -`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--google-green-500`
|
| -`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--google-green-500`
|
| -`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--google-green-500`
|
| +`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--default-primary-color`
|
| +`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--default-primary-color`
|
| +`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
|
| `--paper-toggle-button-unchecked-bar` | Mixin applied to the slider when the input is not checked | `{}`
|
| `--paper-toggle-button-unchecked-button` | Mixin applied to the slider button when the input is not checked | `{}`
|
| `--paper-toggle-button-checked-bar` | Mixin applied to the slider when the input is checked | `{}`
|
| @@ -44,10 +45,113 @@ Custom property | Description | Default
|
| -->
|
|
|
| </head><body><dom-module id="paper-toggle-button">
|
| + <template>
|
|
|
| - <link rel="import" type="css" href="paper-toggle-button.css">
|
| + <style>
|
| + :host {
|
| + display: inline-block;
|
| + }
|
|
|
| - <template>
|
| + :host([disabled]) {
|
| + pointer-events: none;
|
| + }
|
| +
|
| + :host(:focus) {
|
| + outline:none;
|
| + }
|
| +
|
| + :host .toggle-bar {
|
| + background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
|
| + @apply(--paper-toggle-button-unchecked-bar);
|
| + }
|
| +
|
| + :host .toggle-button {
|
| + background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
|
| + @apply(--paper-toggle-button-unchecked-button);
|
| + }
|
| +
|
| + :host([checked]) .toggle-bar {
|
| + background-color: var(--paper-toggle-button-checked-bar-color, --default-primary-color);
|
| + @apply(--paper-toggle-button-checked-bar);
|
| + }
|
| +
|
| + :host([checked]) .toggle-button {
|
| + background-color: var(--paper-toggle-button-checked-button-color, --default-primary-color);
|
| + @apply(--paper-toggle-button-checked-button);
|
| + }
|
| +
|
| + :host .toggle-ink {
|
| + color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
|
| + }
|
| +
|
| + :host([checked]) .toggle-ink {
|
| + color: var(--paper-toggle-button-checked-ink-color, --default-primary-color);
|
| + }
|
| +
|
| + /* ID selectors should not be overriden by users. */
|
| +
|
| + #toggleContainer {
|
| + position: relative;
|
| + width: 36px;
|
| + height: 14px;
|
| + }
|
| +
|
| + #toggleBar {
|
| + position: absolute;
|
| + height: 100%;
|
| + width: 100%;
|
| + border-radius: 8px;
|
| + pointer-events: none;
|
| + opacity: 0.4;
|
| + transition: background-color linear .08s;
|
| + }
|
| +
|
| + :host([checked]) #toggleBar {
|
| + opacity: 0.5;
|
| + }
|
| +
|
| + :host([disabled]) #toggleBar {
|
| + background-color: #000;
|
| + opacity: 0.12;
|
| + }
|
| +
|
| + #toggleButton {
|
| + position: absolute;
|
| + top: -3px;
|
| + height: 20px;
|
| + width: 20px;
|
| + border-radius: 50%;
|
| + box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6);
|
| + transition: -webkit-transform linear .08s, background-color linear .08s;
|
| + transition: transform linear .08s, background-color linear .08s;
|
| + will-change: transform;
|
| + }
|
| +
|
| + #toggleButton.dragging {
|
| + -webkit-transition: none;
|
| + transition: none;
|
| + }
|
| +
|
| + :host([checked]) #toggleButton {
|
| + -webkit-transform: translate(16px, 0);
|
| + transform: translate(16px, 0);
|
| + }
|
| +
|
| + :host([disabled]) #toggleButton {
|
| + background-color: #bdbdbd;
|
| + opacity: 1;
|
| + }
|
| +
|
| + #ink {
|
| + position: absolute;
|
| + top: -14px;
|
| + left: -14px;
|
| + width: 48px;
|
| + height: 48px;
|
| + opacity: 0.5;
|
| + pointer-events: none;
|
| + }
|
| + </style>
|
|
|
| <div id="toggleContainer">
|
| <div id="toggleBar" class="toggle-bar"></div>
|
|
|