<commit_before>//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

//-----------------------------
// Toggle
//-----------------------------

@import '../../globals/scss/vars';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/typography';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
@import '../form/form';

/// Toggle styles
/// @access private
/// @group toggle
@mixin toggle {
  .#{$prefix}--toggle {
    @include hidden;

    &:focus {
      outline: none;
    }
  }

  .#{$prefix}--toggle__label {
    @include type-style('label-01');

    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: $carbon--spacing-03 0;
  }

  .#{$prefix}--toggle__appearance {
    position: relative;
    width: carbon--rem(48px);
    height: carbon--rem(24px);

    // Toggle background oval
    &:before {
      position: absolute;
      display: block;
      content: '';
      background-color: $ui-04;
      cursor: pointer;
      box-sizing: border-box;
      height: carbon--rem(24px);
      width: carbon--rem(48px);
      border-radius: carbon--rem(15px);
      top: 0;
      will-change: box-shadow;
      box-shadow: 0 0 0 2px transparent;
      transition: box-shadow $duration--fast-01 motion(exit, productive),
        background-color $duration--fast-01 motion(exit, productive);
    }

    // Toggle circle
    &:after {
      box-sizing: border-box;
      position: absolute;
      display: block;
      cursor: pointer;
      left: carbon--rem(3px);
      top: carbon--rem(3px);
      width: carbon--rem(18px);
      height: carbon--rem(18px);
      background-color: $ui-03;
      border-radius: 50%;
      content: '';
      transition: transform $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle__check {
    fill: $ui-03;
    position: absolute;
    left: carbon--rem(6px);
    top: carbon--rem(6px);
    width: carbon--rem(6px);
    height: carbon--rem(5px);
    z-index: 1;
    transition: $duration--fast-01 motion(exit, productive);
    transform: scale(0.2);
  }

  .#{$prefix}--toggle__text--left,
  .#{$prefix}--toggle__text--right {
    @include type-style('body-short-01');
    position: relative;
    margin-left: $carbon--spacing-03;
  }

  .#{$prefix}--toggle__text--left {
    position: absolute;
    left: carbon--rem(48px);
  }

  .#{$prefix}--toggle:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left,
  .#{$prefix}--toggle:not(:checked)
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--right {
    visibility: hidden;
  }

  .#{$prefix}--toggle:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--right,
  .#{$prefix}--toggle:not(:checked)
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left {
    display: inline;
  }

  .#{$prefix}--toggle:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    &:before {
      background-color: $support-02;
    }

    &:after {
      background-color: $icon-03;
      transform: translateX(carbon--rem(24px));
    }
  }

  //----------------------------------------------
  // Focus
  // ---------------------------------------------
  .#{$prefix}--toggle + .#{$prefix}--toggle__label,
  .#{$prefix}--toggle + .#{$prefix}--toggle__label {
    .#{$prefix}--toggle__appearance:before {
      box-shadow: 0 0 0 2px transparent;
    }
  }
  .#{$prefix}--toggle:focus + .#{$prefix}--toggle__label,
  .#{$prefix}--toggle:active + .#{$prefix}--toggle__label {
    .#{$prefix}--toggle__appearance:before {
      box-shadow: 0 0 0 2px $focus;
    }
  }

  //----------------------------------------------
  // Disabled
  // ---------------------------------------------
  .#{$prefix}--toggle:disabled + .#{$prefix}--toggle__label {
    cursor: not-allowed;
  }

  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    &:before {
      background-color: $disabled-01;
    }

    &:after {
      background-color: $disabled-02;
    }

    &:before,
    &:after {
      cursor: not-allowed;
      transition: $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left,
  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--right {
    color: $disabled;
  }

  .#{$prefix}--toggle:disabled:active
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance:before {
    box-shadow: none;
  }

  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__check {
    fill: $disabled-02;
  }

  //----------------------------------------------
  // Small toggle
  // ---------------------------------------------

  .#{$prefix}--toggle--small
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    width: carbon--rem(32px);
    height: carbon--rem(16px);

    &:before {
      box-sizing: border-box;
      height: carbon--rem(16px);
      width: carbon--rem(32px);
      border-radius: 0.9375rem;
      top: 0;
    }

    &:after {
      width: carbon--rem(10px);
      height: carbon--rem(10px);
      top: carbon--rem(3px);
      left: carbon--rem(3px);
    }
  }

  .#{$prefix}--toggle--small:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__check {
    fill: $support-02;
    transform: scale(1) translateX(carbon--rem(16px));
  }

  .#{$prefix}--toggle--small
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left {
    left: carbon--rem(32px);
  }

  .#{$prefix}--toggle--small:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    &:after {
      margin-left: 0px;
      transform: translateX(carbon--rem(17px));
    }
  }

  // -----------------------------------------------------
  // new accessible toggle
  // TODO: deprecate styles above this line
  // -----------------------------------------------------

  .#{$prefix}--toggle-input {
    @include hidden;

    &:focus {
      outline: none;
    }
  }

  .#{$prefix}--toggle-input__label {
    @include type-style('label-01');
    color: $text-02;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
  }

  .#{$prefix}--toggle__switch {
    position: relative;
    display: flex;
    align-items: center;
    width: carbon--rem(48px);
    height: carbon--rem(24px);
    margin: $carbon--spacing-03 0;
    cursor: pointer;

    // Toggle background oval
    &::before {
      box-sizing: border-box;
      position: absolute;
      top: 0;
      display: block;
      width: carbon--rem(48px);
      height: carbon--rem(24px);
      border-radius: carbon--rem(15px);
      content: '';
      background-color: $ui-04;
      will-change: box-shadow;
      box-shadow: 0 0 0 2px transparent;
      transition: box-shadow $duration--fast-01 motion(exit, productive),
        background-color $duration--fast-01 motion(exit, productive);
    }

    // Toggle circle
    &::after {
      box-sizing: border-box;
      position: absolute;
      top: carbon--rem(3px);
      left: carbon--rem(3px);
      display: block;
      width: carbon--rem(18px);
      height: carbon--rem(18px);
      border-radius: 50%;
      background-color: $ui-03;
      content: '';
      transition: transform $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle__text--off,
  .#{$prefix}--toggle__text--on {
    position: absolute;
    margin-left: carbon--rem(56px);
    @include type-style('body-short-01');
    user-select: none;
  }

  //----------------------------------------------
  // Checked
  // ---------------------------------------------
  .#{$prefix}--toggle-input:checked
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch
    > .#{$prefix}--toggle__text--off,
  .#{$prefix}--toggle-input:not(:checked)
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch
    > .#{$prefix}--toggle__text--on {
    visibility: hidden;
  }

  .#{$prefix}--toggle-input:checked
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch {
    &::before {
      background-color: $support-02;
    }

    &::after {
      background-color: $icon-03;
      transform: translateX(carbon--rem(24px));
    }
  }

  //----------------------------------------------
  // Focus and active
  // ---------------------------------------------
  .#{$prefix}--toggle-input:focus
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch::before,
  .#{$prefix}--toggle-input:active
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch::before {
    box-shadow: 0 0 0 2px $focus;
  }

  //----------------------------------------------
  // Disabled
  // ---------------------------------------------
  .#{$prefix}--toggle-input:disabled + .#{$prefix}--toggle-input__label {
    cursor: not-allowed;
  }

  .#{$prefix}--toggle-input:disabled
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch {
    cursor: not-allowed;

    &::before {
      background-color: $disabled-01;
    }

    &::after {
      background-color: $disabled-02;
    }

    &::before,
    &::after {
      cursor: not-allowed;
      transition: $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle-input:disabled + .#{$prefix}--toggle-input__label {
    color: $disabled;<commit_msg>fix(toggle): update colors (#4038)<commit_after>//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

//-----------------------------
// Toggle
//-----------------------------

@import '../../globals/scss/vars';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/typography';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
@import '../form/form';

/// Toggle styles
/// @access private
/// @group toggle
@mixin toggle {
  .#{$prefix}--toggle {
    @include hidden;

    &:focus {
      outline: none;
    }
  }

  .#{$prefix}--toggle__label {
    @include type-style('label-01');

    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: $carbon--spacing-03 0;
  }

  .#{$prefix}--toggle__appearance {
    position: relative;
    width: carbon--rem(48px);
    height: carbon--rem(24px);

    // Toggle background oval
    &:before {
      position: absolute;
      display: block;
      content: '';
      background-color: $ui-04;
      cursor: pointer;
      box-sizing: border-box;
      height: carbon--rem(24px);
      width: carbon--rem(48px);
      border-radius: carbon--rem(15px);
      top: 0;
      will-change: box-shadow;
      // Corresponds to the double-border for focused state (`0 0 0 1px $ui-02, 0 0 0 3px $focus`)
      box-shadow: 0 0 0 1px transparent, 0 0 0 3px transparent;
      transition: box-shadow $duration--fast-01 motion(exit, productive),
        background-color $duration--fast-01 motion(exit, productive);
    }

    // Toggle circle
    &:after {
      box-sizing: border-box;
      position: absolute;
      display: block;
      cursor: pointer;
      left: carbon--rem(3px);
      top: carbon--rem(3px);
      width: carbon--rem(18px);
      height: carbon--rem(18px);
      background-color: $icon-03;
      border-radius: 50%;
      content: '';
      transition: transform $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle__check {
    fill: $icon-03;
    position: absolute;
    left: carbon--rem(6px);
    top: carbon--rem(6px);
    width: carbon--rem(6px);
    height: carbon--rem(5px);
    z-index: 1;
    transition: $duration--fast-01 motion(exit, productive);
    transform: scale(0.2);
  }

  .#{$prefix}--toggle__text--left,
  .#{$prefix}--toggle__text--right {
    @include type-style('body-short-01');
    position: relative;
    margin-left: $carbon--spacing-03;
  }

  .#{$prefix}--toggle__text--left {
    position: absolute;
    left: carbon--rem(48px);
  }

  .#{$prefix}--toggle:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left,
  .#{$prefix}--toggle:not(:checked)
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--right {
    visibility: hidden;
  }

  .#{$prefix}--toggle:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--right,
  .#{$prefix}--toggle:not(:checked)
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left {
    display: inline;
  }

  .#{$prefix}--toggle:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    &:before {
      background-color: $support-02;
    }

    &:after {
      background-color: $icon-03;
      transform: translateX(carbon--rem(24px));
    }
  }

  //----------------------------------------------
  // Focus
  // ---------------------------------------------
  .#{$prefix}--toggle + .#{$prefix}--toggle__label,
  .#{$prefix}--toggle + .#{$prefix}--toggle__label {
    .#{$prefix}--toggle__appearance:before {
      // Corresponds to the double-border for focused state (`0 0 0 1px $ui-02, 0 0 0 3px $focus`)
      box-shadow: 0 0 0 1px transparent, 0 0 0 3px transparent;
    }
  }
  .#{$prefix}--toggle:focus + .#{$prefix}--toggle__label,
  .#{$prefix}--toggle:active + .#{$prefix}--toggle__label {
    .#{$prefix}--toggle__appearance:before {
      box-shadow: 0 0 0 1px $ui-02, 0 0 0 3px $focus;
    }
  }

  //----------------------------------------------
  // Disabled
  // ---------------------------------------------
  .#{$prefix}--toggle:disabled + .#{$prefix}--toggle__label {
    cursor: not-allowed;
  }

  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    &:before {
      background-color: $disabled-01;
    }

    &:after {
      background-color: $disabled-02;
    }

    &:before,
    &:after {
      cursor: not-allowed;
      transition: $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left,
  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--right {
    color: $disabled;
  }

  .#{$prefix}--toggle:disabled:active
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance:before {
    box-shadow: none;
  }

  .#{$prefix}--toggle:disabled
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__check {
    fill: $disabled-02;
  }

  //----------------------------------------------
  // Small toggle
  // ---------------------------------------------

  .#{$prefix}--toggle--small
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    width: carbon--rem(32px);
    height: carbon--rem(16px);

    &:before {
      box-sizing: border-box;
      height: carbon--rem(16px);
      width: carbon--rem(32px);
      border-radius: 0.9375rem;
      top: 0;
    }

    &:after {
      width: carbon--rem(10px);
      height: carbon--rem(10px);
      top: carbon--rem(3px);
      left: carbon--rem(3px);
    }
  }

  .#{$prefix}--toggle--small:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__check {
    fill: $support-02;
    transform: scale(1) translateX(carbon--rem(16px));
  }

  .#{$prefix}--toggle--small
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__text--left {
    left: carbon--rem(32px);
  }

  .#{$prefix}--toggle--small:checked
    + .#{$prefix}--toggle__label
    .#{$prefix}--toggle__appearance {
    &:after {
      margin-left: 0px;
      transform: translateX(carbon--rem(17px));
    }
  }

  // -----------------------------------------------------
  // new accessible toggle
  // TODO: deprecate styles above this line
  // -----------------------------------------------------

  .#{$prefix}--toggle-input {
    @include hidden;

    &:focus {
      outline: none;
    }
  }

  .#{$prefix}--toggle-input__label {
    @include type-style('label-01');
    color: $text-02;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
  }

  .#{$prefix}--toggle__switch {
    position: relative;
    display: flex;
    align-items: center;
    width: carbon--rem(48px);
    height: carbon--rem(24px);
    margin: $carbon--spacing-03 0;
    cursor: pointer;

    // Toggle background oval
    &::before {
      box-sizing: border-box;
      position: absolute;
      top: 0;
      display: block;
      width: carbon--rem(48px);
      height: carbon--rem(24px);
      border-radius: carbon--rem(15px);
      content: '';
      background-color: $ui-04;
      will-change: box-shadow;
      // Corresponds to the double-border for focused state (`0 0 0 1px $ui-02, 0 0 0 3px $focus`)
      box-shadow: 0 0 0 1px transparent, 0 0 0 3px transparent;
      transition: box-shadow $duration--fast-01 motion(exit, productive),
        background-color $duration--fast-01 motion(exit, productive);
    }

    // Toggle circle
    &::after {
      box-sizing: border-box;
      position: absolute;
      top: carbon--rem(3px);
      left: carbon--rem(3px);
      display: block;
      width: carbon--rem(18px);
      height: carbon--rem(18px);
      border-radius: 50%;
      background-color: $icon-03;
      content: '';
      transition: transform $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle__text--off,
  .#{$prefix}--toggle__text--on {
    position: absolute;
    margin-left: carbon--rem(56px);
    @include type-style('body-short-01');
    user-select: none;
  }

  //----------------------------------------------
  // Checked
  // ---------------------------------------------
  .#{$prefix}--toggle-input:checked
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch
    > .#{$prefix}--toggle__text--off,
  .#{$prefix}--toggle-input:not(:checked)
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch
    > .#{$prefix}--toggle__text--on {
    visibility: hidden;
  }

  .#{$prefix}--toggle-input:checked
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch {
    &::before {
      background-color: $support-02;
    }

    &::after {
      background-color: $icon-03;
      transform: translateX(carbon--rem(24px));
    }
  }

  //----------------------------------------------
  // Focus and active
  // ---------------------------------------------
  .#{$prefix}--toggle-input:focus
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch::before,
  .#{$prefix}--toggle-input:active
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch::before {
    box-shadow: 0 0 0 1px $ui-02, 0 0 0 3px $focus;
  }

  //----------------------------------------------
  // Disabled
  // ---------------------------------------------
  .#{$prefix}--toggle-input:disabled + .#{$prefix}--toggle-input__label {
    cursor: not-allowed;
  }

  .#{$prefix}--toggle-input:disabled
    + .#{$prefix}--toggle-input__label
    > .#{$prefix}--toggle__switch {
    cursor: not-allowed;

    &::before {
      background-color: $disabled-01;
    }

    &::after {
      background-color: $disabled-02;
    }

    &::before,
    &::after {
      cursor: not-allowed;
      transition: $duration--fast-01 motion(exit, productive);
    }
  }

  .#{$prefix}--toggle-input:disabled + .#{$prefix}--toggle-input__label {
    color: $disabled;
{'fraction_non_alphanumeric': 0.24942710189947548, 'fraction_numerical': 0.020980801548097977, 'mean_word_length': 1.8900662251655629, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222842', 'n_tokens_mistral': 6662, 'n_tokens_neox': 6110, 'n_words': 1080}