Align and animate expandable items (details, menu)
This commit is contained in:
+3
-3
@@ -143,11 +143,11 @@ a .book-icon {
|
||||
input.toggle + label::after {
|
||||
content: "▸";
|
||||
align-self: center;
|
||||
transition: transform 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
input.toggle:checked + label::after {
|
||||
content: "▾";
|
||||
align-self: center;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ body[dir="rtl"] .book-menu {
|
||||
}
|
||||
|
||||
input.toggle:checked + label::after {
|
||||
content: "▾";
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -186,10 +186,22 @@
|
||||
padding: $padding-16;
|
||||
margin: -$padding-16;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
|
||||
&::before {
|
||||
content: "▸";
|
||||
display: inline-block;
|
||||
margin-inline-end: $padding-8;
|
||||
transition: transform 0.1s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
&[open] summary {
|
||||
margin-bottom: 0;
|
||||
|
||||
&::before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user