File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
sphinx_togglebutton/_static Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,9 @@ button.toggle-button {
65
65
}
66
66
67
67
details .toggle-details .tb-icon {
68
- height : 1.3em ;
69
- width : 1.3em ;
68
+ height : 1.4em ;
69
+ width : 1.4em ;
70
+ margin-top : 0.1em ; /* To center the button vertically */
70
71
}
71
72
72
73
.toggle-button-hidden .tb-icon {
@@ -92,8 +93,12 @@ details.toggle-details summary {
92
93
border-radius : .4em ;
93
94
border : 1px solid # ccc ;
94
95
background : # f8f8f8 ;
95
- padding : 0.4em 1em 0.4em 0.5em ; /* Less padding on left because the SVG has left margin */
96
- font-size : .9em ;
96
+ padding : 0.2em 0.7em 0.3em 0.5em ; /* Less padding on left because the SVG has left margin */
97
+ font-size : 0.8em ;
98
+ }
99
+
100
+ .toggle-details__summary-text {
101
+ margin-left : 0.2em ;
97
102
}
98
103
99
104
details .toggle-details summary : hover {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ var initToggleItems = () => {
25
25
}
26
26
// This is the button that will be added to each item to trigger the toggle
27
27
var collapseButton = `
28
- <button type="button" id="${ buttonID } " class="toggle-button" data-target="${ toggleID } " data-button="${ buttonID } ", data-toggle-hint="${ toggleHintShow } ">
28
+ <button type="button" id="${ buttonID } " class="toggle-button" data-target="${ toggleID } " data-button="${ buttonID } " data-toggle-hint="${ toggleHintShow } " aria-label="Click to toggle content ">
29
29
${ toggleChevron }
30
30
</button>` ;
31
31
@@ -50,9 +50,9 @@ var initToggleItems = () => {
50
50
// Define the structure of the details block and insert it as a sibling
51
51
var detailsBlock = `
52
52
<details class="toggle-details">
53
- <summary>
53
+ <summary class="toggle-details__summary" >
54
54
${ toggleChevron }
55
- <span>${ toggleHintShow } </span>
55
+ <span class="toggle-details__summary-text" >${ toggleHintShow } </span>
56
56
</summary>
57
57
</details>` ;
58
58
item . insertAdjacentHTML ( "beforebegin" , detailsBlock ) ;
You can’t perform that action at this time.
0 commit comments