mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Rotate the accordion plus toggle so it works with sprite icons (#3075)
This commit is contained in:
1 parent
cc7afaf01b
commit
b295d84b3e
3 files changed
+12
-9
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@tabler/core": patch
|
||||||
|
"@tabler/docs": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed `.accordion-button-toggle-plus` with sprite icons by rotating the plus into a close icon instead of hiding a path.
|
||||||
@@ -96,17 +96,14 @@
|
|||||||
color: var(--accordion-active-color);
|
color: var(--accordion-active-color);
|
||||||
transform: rotate(-180deg);
|
transform: rotate(-180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
path {
|
|
||||||
transition: $transition-time opacity;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A plus turns into a close icon by rotating a quarter turn. Rotating the
|
||||||
|
// toggle instead of hiding an svg path works with every icon source — inline
|
||||||
|
// svg, a sprite `<use>`, an icon font (#2606).
|
||||||
.accordion-button-toggle-plus {
|
.accordion-button-toggle-plus {
|
||||||
.accordion-button:not(.collapsed) & {
|
.accordion-button:not(.collapsed) & {
|
||||||
path:first-child {
|
transform: rotate(45deg);
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ classnames:
|
|||||||
- class: accordion-button-toggle
|
- class: accordion-button-toggle
|
||||||
desc: Chevron indicator on the toggle
|
desc: Chevron indicator on the toggle
|
||||||
- class: accordion-button-toggle-plus
|
- class: accordion-button-toggle-plus
|
||||||
desc: Plus and minus indicator instead of a chevron
|
desc: Plus indicator that turns into a close icon when open
|
||||||
modifier:
|
modifier:
|
||||||
- class: accordion-flush
|
- class: accordion-flush
|
||||||
desc: Removes the outer border and rounding, to sit flush in a parent
|
desc: Removes the outer border and rounding, to sit flush in a parent
|
||||||
@@ -75,7 +75,7 @@ This preview shows the base structure with one expanded section.
|
|||||||
|
|
||||||
### Plus toggle icon
|
### Plus toggle icon
|
||||||
|
|
||||||
Use `.accordion-button-toggle-plus` to hide the first SVG path when expanded. This pattern is useful for plus-to-minus toggles.
|
Use `.accordion-button-toggle-plus` with a `plus` icon. When the section opens, the toggle rotates a quarter turn and the plus becomes a close icon. It rotates the whole toggle, so it works with an inline SVG, a sprite `<use>` or an icon font.
|
||||||
|
|
||||||
<Example>
|
<Example>
|
||||||
<div class="accordion" id="accordion-plus">
|
<div class="accordion" id="accordion-plus">
|
||||||
|
|||||||
Reference in new issue
Block a user