@@ -40,8 +40,7 @@ div.container.cell {
4040}
4141
4242/* Input cells */
43- div .cell div .cell_input ,
44- div .cell details .above-input > summary {
43+ div .cell > div .cell_input {
4544 padding-left : 0em ;
4645 padding-right : 0em ;
4746 border : var (--mystnb-source-border-width ) var (--mystnb-source-border-color ) solid;
@@ -90,57 +89,69 @@ div.cell_output div.output>div.highlight {
9089 border : 1px solid var (--mystnb-traceback-border-color );
9190}
9291
93- /* Collapsible cell content */
94- div .cell details .above-input div .cell_input {
95- border-top-left-radius : 0 ;
96- border-top-right-radius : 0 ;
97- border-top : var (--mystnb-source-border-width ) var (--mystnb-source-border-color ) dashed;
92+ /* --- Collapsible cell content --- */
93+
94+ /*
95+ encourage summary container to blend in with its parent.
96+ p.admonition-title should hold the title styles.
97+ */
98+ div .cell details .hide summary {
99+ border-left : unset;
100+ padding : inherit;
101+ margin : inherit;
102+ background-color : inherit;
98103}
99104
100- div .cell div .cell_input .above-output-prompt {
101- border-bottom-left-radius : 0 ;
102- border-bottom-right-radius : 0 ;
105+ /* Neighboring input/output elements - spacing, borders */
106+ div .cell details .hide .above-input + details .below-input ,
107+ div .cell div .cell_input + details .below-input
108+ {
109+ margin-top : 0 ;
110+ }
111+
112+ div .cell details .hide .above-input : has (+ details .below-input ),
113+ div .cell div .cell_input : has (+ details .below-input )
114+ {
115+ margin-bottom : 0 ;
103116}
104117
105- div .cell details .above-input > summary {
118+ div .cell : has (> * : nth-child (2 )) div .cell_input : first-child ,
119+ div .cell : has (> * : nth-child (2 )) details : first-child
120+ {
106121 border-bottom-left-radius : 0 ;
107122 border-bottom-right-radius : 0 ;
108- border-bottom : var (--mystnb-source-border-width ) var (--mystnb-source-border-color ) dashed;
109- padding-left : 1em ;
110- margin-bottom : 0 ;
111123}
112124
113- div .cell details .above-output > summary {
114- background-color : var (--mystnb-source-bg-color );
115- padding-left : 1em ;
116- padding-right : 0em ;
117- border : var (--mystnb-source-border-width ) var (--mystnb-source-border-color ) solid;
118- border-radius : var (--mystnb-source-border-radius );
119- border-left-color : var (--mystnb-source-margin-color );
120- border-left-width : medium;
125+ div .cell : has (> * : nth-child (2 )) div .cell_input : last-child ,
126+ div .cell : has (> * : nth-child (2 )) details : last-child
127+ {
128+ border-top-left-radius : 0 ;
129+ border-top-right-radius : 0 ;
121130}
122131
123- div .cell details .below-input > summary {
124- background-color : var (--mystnb-source-bg-color );
125- padding-left : 1em ;
126- padding-right : 0em ;
127- border : var (--mystnb-source-border-width ) var (--mystnb-source-border-color ) solid;
128- border-top : none;
129- border-bottom-left-radius : var (--mystnb-source-border-radius );
130- border-bottom-right-radius : var (--mystnb-source-border-radius );
131- border-left-color : var (--mystnb-source-margin-color );
132- border-left-width : medium;
132+ /* intra-label styles for collapsibles */
133+ div .cell .container details .hide .above-input > summary ,
134+ div .cell .container details .hide .below-input > summary ,
135+ div .cell .container details .hide .above-output > summary
136+ {
137+ display : block;
138+ border-left : none;
133139}
134140
135- div .cell details .hide > summary > span {
136- opacity : var (--mystnb-hide-prompt-opacity );
141+ div .cell details .hide > summary > p .admonition-title {
142+ display : list-item;
143+ margin-bottom : 0 ;
137144}
138145
139- div .cell details .hide [open ]> summary > span .collapsed {
146+ div .cell details .hide : not ([open ]) {
147+ padding-bottom : 0 ;
148+ }
149+
150+ div .cell details .hide [open ]> summary > p .collapsed {
140151 display : none;
141152}
142153
143- div .cell details .hide : not ([open ])> summary > span .expanded {
154+ div .cell details .hide : not ([open ])> summary > p .expanded {
144155 display : none;
145156}
146157
@@ -159,6 +170,11 @@ div.cell details.hide[open]>summary~* {
159170 animation : collapsed-fade-in 0.3s ease-in-out;
160171}
161172
173+ /* Clear conflicting styles for details and admonitions set by some themes */
174+ div .cell details .admonition summary ::before {
175+ content : unset;
176+ }
177+
162178/* Math align to the left */
163179.cell_output .MathJax_Display {
164180 text-align : left !important ;
0 commit comments