From 7b83006499effed1ad5e3ea6b7309b62f9a59067 Mon Sep 17 00:00:00 2001 From: pxpm Date: Fri, 20 Dec 2024 16:49:14 +0000 Subject: [PATCH] fix switch --- resources/assets/css/coreui4.css | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/resources/assets/css/coreui4.css b/resources/assets/css/coreui4.css index 5679ce1..b6a8023 100644 --- a/resources/assets/css/coreui4.css +++ b/resources/assets/css/coreui4.css @@ -14,6 +14,8 @@ --cui-sidebar-1: #5c4fa9; --cui-sidebar-2: #2c2950; + --bg-switch-checked-color: var(--cui-primary); + } body { @@ -320,3 +322,44 @@ html:not([dir=rtl]) .wrapper { #datatable_search_stack .input-icon-addon { display: none; } +.switch-label .switch-slider::after { + position: absolute; + right: 1.5em; + z-index: 1; + margin-top: -1.8em; + font-size: 8px; + font-weight: 600; + line-height: 1; + text-align: center; + text-transform: uppercase; + content: attr(data-unchecked); + transition: inherit; +} + +.switch-slider { + position: relative; + display: block; +} + +.switch-label.switch-sm .switch-slider { + font-size: 8px; +} + +.switch-label.switch-sm .switch-input:checked ~ .switch-slider::after { + transform: translateX(-4.3em); +} +.switch-label .switch-input:checked ~ .switch-slider::after { + left: 1px; + color: #fff; + content: attr(data-checked); +} + +.switch-input.form-check-input { + width: 3em; + height: 1.5em; +} + +.form-switch.switch { + width:3.5em; + height: 1.8em; +}