Fix toggle switch and chevron behavior, improve layout

This commit is contained in:
Marcus Quinn
2025-03-16 03:05:43 +00:00
parent 10dc0e2d72
commit 374bedbede
3 changed files with 64 additions and 89 deletions

View File

@ -88,9 +88,8 @@
position: relative;
display: inline-block;
width: 40px;
height: 20px;
margin-right: 12px;
cursor: pointer;
height: 24px;
flex-shrink: 0;
}
.wp-toggle-switch input {
@ -146,11 +145,10 @@ input:checked + .wp-toggle-slider:before {
/* Toggle Sections */
.wp-allstars-toggle {
background: #fff;
border: 1px solid #ddd;
border: 1px solid #ccc;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
transition: all 0.2s ease;
position: relative;
}
.wp-allstars-toggle:hover {
@ -159,15 +157,38 @@ input:checked + .wp-toggle-slider:before {
}
.wp-allstars-toggle-header {
padding: 24px;
padding: 15px;
cursor: pointer;
user-select: none;
position: relative;
}
.wp-allstars-toggle-header::after {
content: '';
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>') no-repeat center;
background-size: 24px;
transition: transform 0.3s ease;
}
.wp-allstars-toggle-header[aria-expanded="true"]::after {
transform: translateY(-50%) rotate(180deg);
}
.wp-allstars-toggle-main {
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 40px;
}
.wp-allstars-toggle-left {
display: flex;
align-items: center;
gap: 10px;
}
@ -181,6 +202,7 @@ input:checked + .wp-toggle-slider:before {
color: #1d2327;
line-height: 1.4;
cursor: default;
pointer-events: none;
}
.wp-allstars-expand-settings {
@ -239,21 +261,6 @@ input:checked + .wp-toggle-slider:before {
outline: 2px solid transparent;
}
/* Add chevron icon using pseudo-element */
.wp-allstars-toggle-header::after {
content: "";
display: block;
width: 20px;
height: 20px;
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" fill="%232271b1"/></svg>') no-repeat center;
transition: transform 0.2s ease;
background-size: 20px;
}
.wp-allstars-toggle-header[aria-expanded="true"]::after {
transform: rotate(180deg);
}
/* Clear floats after tabs */
.nav-tab-wrapper::after {
content: "";