Skip to content

Commit

Permalink
fix(collapse): replace unicode triangle indicator with pure CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Mar 22, 2024
1 parent 8627eb0 commit f11183b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
16 changes: 11 additions & 5 deletions assets/mods/bootstrap/scss/_collapse.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
.collapse-toggle {
padding-left: 0.25rem !important;

&::before {
content: "\2BC8";
margin-right: 0.25rem;
border-left: 10px solid;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
width: 0;
height: 0;
content: "";
display: inline-block;
}

&[aria-expanded=true] {
&::before {
transform: rotate(90deg);
display: inline-block;
border-top: 10px solid;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: unset;
}
}
}
4 changes: 4 additions & 0 deletions assets/mods/bootstrap/scss/index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/*! purgecss start ignore */

@import 'alert';
@import 'collapse';

/*! purgecss end ignore */
2 changes: 1 addition & 1 deletion layouts/partials/bootstrap/collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class="collapse-wrapper mb-1">
<a
type="button"
class="collapse-toggle text-decoration-none text-bg-{{ $style }} px-2"
class="collapse-toggle text-decoration-none text-bg-{{ $style }} py-1 px-2"
data-bs-toggle="collapse"
href="#{{ $id }}"
aria-expanded="{{ cond $expand `true` `false` }}"
Expand Down

0 comments on commit f11183b

Please sign in to comment.