switch.css 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*-----------------------------------------------------------------------------
  2. | Copyright (c) Jupyter Development Team.
  3. | Distributed under the terms of the Modified BSD License.
  4. |----------------------------------------------------------------------------*/
  5. .jp-switch {
  6. display: flex;
  7. align-items: center;
  8. font-size: var(--jp-ui-font-size1);
  9. background-color: transparent;
  10. color: var(--jp-ui-font-color1);
  11. border: none;
  12. height: 20px;
  13. }
  14. .jp-switch:hover {
  15. background-color: var(--jp-layout-color2);
  16. }
  17. .jp-switch-label {
  18. margin-right: 5px;
  19. }
  20. .jp-switch-track {
  21. cursor: pointer;
  22. background-color: var(--jp-border-color1);
  23. -webkit-transition: 0.4s;
  24. transition: 0.4s;
  25. border-radius: 34px;
  26. height: 16px;
  27. width: 35px;
  28. position: relative;
  29. }
  30. .jp-switch-track::before {
  31. content: '';
  32. position: absolute;
  33. height: 10px;
  34. width: 10px;
  35. margin: 3px;
  36. left: 0px;
  37. background-color: var(--jp-ui-inverse-font-color1);
  38. -webkit-transition: 0.4s;
  39. transition: 0.4s;
  40. border-radius: 50%;
  41. }
  42. .jp-switch[aria-checked='true'] .jp-switch-track {
  43. background-color: var(--jp-warn-color0);
  44. }
  45. .jp-switch[aria-checked='true'] .jp-switch-track::before {
  46. /* track width (35) - margins (3 + 3) - thumb width (10) */
  47. left: 19px;
  48. }