UNPKG

@citedrive/bibtex-editor

Version:
44 lines (38 loc) 993 B
/* NOTE: Code sourced from: https://upmostly.com/tutorials/build-a-react-switch-toggle-component */ /* Placeholder React-based Switch UI-element */ .react-switch-checkbox { height: 0; width: 0; visibility: hidden; } .react-switch-label { display: flex; align-items: center; justify-content: space-between; cursor: pointer; width: 30px; height: 15px; background: grey; border-radius: 30px; position: relative; transition: background-color 0.2s; } .react-switch-label .react-switch-button { content: ""; position: absolute; top: 0.6px; left: 0.6px; width: 13.5px; height: 13.5px; border-radius: 13.5px; transition: 0.2s; background: #fff; box-shadow: 0 0 1px 0 rgba(10, 10, 10, 0.29); } .react-switch-checkbox:checked + .react-switch-label .react-switch-button { left: calc(100% - 0.6px); transform: translateX(-100%); } .react-switch-label:active .react-switch-button { width: 18px; }