Skip to content

Commit a88e73c

Browse files
authored
ENH: Vertical flip for toggle icon (#39)
1 parent 9c2d4a1 commit a88e73c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

sphinx_togglebutton/_static/togglebutton.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,24 @@ button.toggle-button {
6464
stroke: currentColor; /* So that we inherit the color of other text */
6565
}
6666

67+
/* Rotate icon with admonitions so that it points down */
68+
.admonition.toggle .tb-icon {
69+
transform: rotate(-90deg);
70+
}
71+
72+
/* When the admonition is hidden, icon should flip upwards but retain rotation */
73+
/* We scaleX, in order to flip along Y, because it is rotated */
74+
.admonition.toggle .toggle-button-hidden .tb-icon {
75+
transform: rotate(-90deg) scaleX(-1);
76+
}
77+
78+
/* With details toggles, we don't rotate the icon so it points right */
6779
details.toggle-details .tb-icon {
6880
height: 1.4em;
6981
width: 1.4em;
7082
margin-top: 0.1em; /* To center the button vertically */
7183
}
7284

73-
.toggle-button-hidden .tb-icon {
74-
transform: rotate(90deg);
75-
}
7685

7786
/**
7887
* Details-based toggles.

0 commit comments

Comments
 (0)