Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
Bootstrap 5 Accordion: make arrows rotate 90 degree instead of 180 degree

I created a Bootstrap 5 Accordion like here https://getbootstrap.com/docs/5.0/components/accordion/. By default, the arrows are rotated 180 degree, when the item is open (from 'v' to '^'). But I want the arrow to rotate just 90 degree (from '>' to 'v').

I tried to manipulate it by exchanging variable values:

In _variables.scss I set $accordion-icon-transform: rotate(90deg); (instead of bootstrap 5 default $accordion-icon-transform: rotate(-180deg) !default;) and I exchanged the arrow svg from a 'v' (bootstrap 5 default) to a '>'

The outcome is, that on first page load, the arrows look like 'v' (I want a '>'). When I open the accordion item, it shows a 'v' (correct). Then I close it and the arrow looks like desired '>'. But I want the arrow to show '>' with the first page load.

Is there a way to achieve this, only by manipulating the bootstrap variables? Or do I have to write some extra JS on top of collapse.js?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Now, I found a solution with pure CSS: In my custom style.scss, I added:

.accordion-button&[aria-expanded="false"]::after {
  transform: none;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda