after adding custom icons into my bootstrap 5.3.3 accordion i find my hover effects are…
- User
after adding custom icons into my bootstrap 5.3.3 accordion i find my hover effects are no longer working:
.accordion-header .accordion-button { position: relative; overflow: hidden; background-color: var(--btn-color-blue); color: #ffffff; font-size: 1.1rem; } /* Custom icon for the collapsed state / .accordion-button.collapsed::after { background-image: url('http://localhost:3000/icons/circle-white.svg'); position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); } / Custom icon for the expanded state / .accordion-button:not(.collapsed)::after { background-image: url('http://localhost:3000/icons/circle-fill-white.svg'); position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); } / Customize the focus box shadow / .accordion-header .accordion-button:focus { box-shadow: 0 0 0 0.25rem rgba(149, 176, 182, 0.4);/ rgb(87.1% 72.9% 36.5%) / border-color: var(--btn-color-blue-visited); } .accordion-header .accordion-button .underlay { content: ''; position: absolute; background-color: var(--btn-color-blue-visited); height: 4px; left: 0; right: 0; bottom: 0; transform: scaleX(0); transition: transform 0.3s ease; } .accordion-header .accordion-button:hover .underlay { transform: scaleX(1); } .accordion-header .accordion-button:hover { background-color: var(--btn-color-blue); color: #ffffff; } / Prevent default style */ .accordion .accordion-item { border: none; }
- Assistant
- User
also how do i control the title text if to long at some screen sizes? the overflow?
- Assistant
- User
.accordion-header .accordion-button { position: relative; overflow: hidden; background-color: var(--btn-color-blue); color: #ffffff; font-size: 1.1rem; z-index: 10;/* Add z-index for hover state / } / Custom icon for the collapsed state / .accordion-button.collapsed::after { background-image: url('http://localhost:3000/icons/circle-white.svg'); position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none;/ Prevents the icon from blocking hover effects Custom icon for the expanded state Prevents the icon from blocking hover effects Customize the focus box shadow rgb(87.1% 72.9% 36.5%) Visual feedback on hover Prevent default style */ .accordion .accordion-item { border: none; }
- Assistant
- User
why did you combine these??
/* Custom icon for the collapsed state / .accordion-button.collapsed::after { background-image: url('http://localhost:3000/icons/circle-white.svg'); position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none;/ Prevents the icon from blocking hover effects / } / Custom icon for the expanded state / .accordion-button:not(.collapsed)::after { background-image: url('http://localhost:3000/icons/circle-fill-white.svg'); position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none;/ Prevents the icon from blocking hover effects */ }
They have to differnt svg files for a reason
- Assistant