File tree 4 files changed +34
-24
lines changed 4 files changed +34
-24
lines changed Original file line number Diff line number Diff line change 1
- < div {% if include.id %} id ="{{include.id}} " {% endif %} class ="alt-details ">
2
- < button class ="alt-details-toggle "> {{include.title}}</ button >
1
+ < div id ="{{include.id}} " class ="alt-details ">
2
+ < input class ="alt-details-control " type ="checkbox " id ="{{include.id}}__control ">
3
+ < label class ="alt-details-toggle " for ="{{include.id}}__control "> {{include.title}}</ label >
3
4
< div class ="alt-details-detail ">
4
5
{{include.detail}}
5
6
</ div >
Original file line number Diff line number Diff line change 13
13
</ div >
14
14
{% endcapture %}
15
15
{% include alt-details.html
16
+ id='cs-setup-macos-nobrew'
16
17
title=homebrewAlt
17
18
detail=homebrewDetail
18
19
%}
Original file line number Diff line number Diff line change 4
4
5
5
.alt-details {
6
6
7
+ .alt-details-control {
8
+ display : none ;
9
+ }
10
+
7
11
.alt-details-toggle {
8
12
width : 100% ;
13
+ display : block ;
14
+ font-family : $base-font-family ;
15
+ line-height : normal ;
16
+ text-align : center ;
9
17
border : none ;
10
18
background-color : $brand-tertiary ;
11
19
padding : 5px 10px ;
20
28
}
21
29
22
30
& :after {
23
- content : " \f13a " ; // <i class="fa-solid fa-circle-chevron-down"></i>
31
+ // show a right arrow at the end of the toggle element
32
+ content : " \f138 " ; // <i class="fa-solid fa-circle-chevron-right"></i>
24
33
font-family : " FontAwesome" ;
25
34
font-weight : 900 ;
26
35
font-size : 15px ;
27
36
float : right ;
28
37
margin-top : 2px ;
29
38
}
30
39
31
- & .alt-details-closed :after {
32
- content : " \f138 " ; // <i class="fa-solid fa-circle-chevron-right"></i>
33
- }
40
+ }
41
+
42
+ .alt-details-control + .alt-details-toggle + .alt-details-detail {
43
+ // by default, hide the details
44
+ display : none ;
45
+ }
46
+
47
+ .alt-details-control :checked + .alt-details-toggle + .alt-details-detail {
48
+ // show the details when the control is checked
49
+ display : block ;
50
+ }
51
+
52
+ .alt-details-control :checked + .alt-details-toggle :after {
53
+ // change the marker on the toggle label to a down arrow
54
+ content : " \f13a " ; // <i class="fa-solid fa-circle-chevron-down"></i>
34
55
}
35
56
36
57
.alt-details-detail {
37
58
// The detail box appears to be underneath the toggle button
38
59
// so we add a padding to the top and push it up.
39
- border : $base-border-gray ;
40
- padding-top : 15px ;
41
- margin-top : -15px ;
60
+ border-bottom : $base-border-gray ;
61
+ border-left : $base-border-gray ;
62
+ border-right : $base-border-gray ;
63
+ padding-top : 10px ;
64
+ margin-top : -10px ;
42
65
}
43
66
}
Original file line number Diff line number Diff line change @@ -178,21 +178,6 @@ var toggleStickyToc = function() {
178
178
}
179
179
}
180
180
181
- $ ( document ) . ready ( function ( ) {
182
- // for each .alt-details div, find the .alt-details-toggle button,
183
- // and add a click handler to toggle the visibility of the .alt-details-detail
184
-
185
- $ ( '.alt-details' ) . each ( function ( ) {
186
- var toggle = $ ( this ) . find ( '.alt-details-toggle' ) ;
187
- var details = $ ( this ) . find ( '.alt-details-detail' ) ;
188
- toggle . click ( function ( ) {
189
- details . css ( 'display' ) === 'none' ? details . show ( ) : details . hide ( ) ;
190
- toggle . toggleClass ( 'alt-details-closed' ) ;
191
- } ) ;
192
- toggle . click ( ) ;
193
- } ) ;
194
- } ) ;
195
-
196
181
// Blog search
197
182
$ ( document ) . ready ( function ( ) {
198
183
if ( $ ( "#blog-search-bar" ) . length ) {
You can’t perform that action at this time.
0 commit comments