Skip to content

Commit 2c6b32f

Browse files
More hovering + zoom cases for rotated chevrons
1 parent c0dd37d commit 2c6b32f

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

assets/theme-css/sphinx-design/_dropdown.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ details.sd-dropdown {
2727
align-items: center;
2828
}
2929

30+
// The hover effect should only change opacity, not transform.
31+
// We are transforming the chevron elements instead, see below.
3032
&:hover .sd-summary-state-marker svg {
3133
opacity: 1;
3234
}
@@ -123,9 +125,36 @@ details.sd-dropdown {
123125
&:hover .sd-summary-chevron-right i,
124126
&:hover .sd-summary-chevron-down i {
125127
opacity: 1;
128+
}
129+
130+
// Combined transforms for each state with hover. These cover
131+
// the cases where the chevron is rotated, say, when the dropdown
132+
// is open or if the chevron starts rotated (e.g. in the down-up
133+
// state).
134+
&:not([open]):hover .sd-summary-chevron-right i {
126135
transform: scale(1.1);
127136
}
128137

138+
&:not([open]):hover .sd-summary-chevron-down i {
139+
transform: scale(1.1);
140+
}
141+
142+
&[open]:hover .sd-summary-chevron-right i {
143+
transform: rotate(90deg) scale(1.1);
144+
}
145+
146+
&[open]:hover .sd-summary-chevron-down i {
147+
transform: rotate(180deg) scale(1.1);
148+
}
149+
150+
&[open]:hover > .sd-summary-title .sd-summary-chevron-right i {
151+
transform: rotate(90deg) scale(1.1);
152+
}
153+
154+
&[open]:hover > .sd-summary-title .sd-summary-chevron-down i {
155+
transform: rotate(180deg) scale(1.1);
156+
}
157+
129158
// Hide the card body border when not open
130159
&:not([open]).sd-card {
131160
border: none;

0 commit comments

Comments
 (0)