/**
 * Convert a font size to a dynamic font size.
 * Fonts that participate in Dynamic Type should use
 * dynamic font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param unit (optional) - The unit to convert to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a maximum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a minimum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * maximum and minimum font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
   * A heuristic that applies CSS to mobile
   * viewports (i.e. phones, not tablets).
   *
   * Usage:
   * @include mobile-viewport() {
   *   :host {
   *     background-color: blue;
   *   }
   * }
   */
:host {
  --container-height: 24px;
  --container-width: 44px;
  --container-padding: 2px;
  --container-border-radius: var(--cpsl-border-radius-switch);
  --container-background-color-default: var(--cpsl-color-switch-surface-default);
  --container-background-color-checked: var(--cpsl-color-switch-surface-checked);
  --thumb-size: calc(var(--container-height) - var(--container-padding) * 2);
  --thumb-border-radius: var(--cpsl-border-radius-switch);
  --thumb-background-color-default: var(--cpsl-color-switch-thumb-default);
  --thumb-background-color-checked: var(--cpsl-color-switch-thumb-checked);
  display: block;
  position: relative;
  height: var(--container-height);
  width: var(--container-width);
  cursor: pointer;
}

input {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0px;
  opacity: 0;
}

span.container {
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: var(--container-padding);
  border-radius: var(--container-border-radius);
  background: var(--container-background-color-default);
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.08) inset;
  transition: all 0.15s ease-in-out;
}
span.container.checked {
  background: var(--container-background-color-checked);
  box-shadow: none;
}

span.thumb {
  display: inline-block;
  position: relative;
  background: var(--thumb-background-color-default);
  box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.1);
  height: var(--thumb-size);
  width: var(--thumb-size);
  border-radius: var(--thumb-border-radius);
  transform: translateX(0);
  left: 0;
  transition: all 0.15s ease-in-out;
}
span.thumb.checked {
  background: var(--thumb-background-color-checked);
  left: 100%;
  transform: translateX(-100%);
}