@@ -263,28 +263,52 @@ body {
263
263
}
264
264
265
265
body {
266
- margin-left : calc (10vw + 20ex );
267
- margin-right : 4ex ;
268
- margin-top : 30px ;
269
- margin-bottom : 50px ;
266
+ margin-left : auto;
267
+ margin-right : auto;
268
+ padding : 0 4ex ;
270
269
}
271
270
272
271
body .odoc {
273
- max-width : 100ex ;
272
+ max-width : 132ex ;
273
+ display : grid;
274
+ grid-template-columns : min-content 1fr ;
275
+ column-gap : 4ex ;
276
+ row-gap : 2ex ;
274
277
}
275
278
276
279
body .odoc-src {
277
280
margin-right : calc (10vw + 20ex );
278
281
}
279
282
283
+ .odoc-content {
284
+ grid-row : 4 ;
285
+ grid-column : 2 ;
286
+ }
287
+
288
+ .odoc-preamble > * : first-child {
289
+ /* This make the first thing in the preamble align with the sidebar */
290
+ padding-top : 0 ;
291
+ margin-top : 0 ;
292
+ }
293
+
280
294
header {
281
295
margin-bottom : 30px ;
282
296
}
283
297
298
+ header .odoc-preamble {
299
+ grid-column : 2 ;
300
+ grid-row : 3 ;
301
+ }
302
+
284
303
nav {
285
304
font-family : "Fira Sans" , sans-serif;
286
305
}
287
306
307
+ nav .odoc-nav {
308
+ grid-column : 2 ;
309
+ grid-row : 2 ;
310
+ }
311
+
288
312
/* Basic markup elements */
289
313
290
314
b , strong {
480
504
font-size : 1.12em ;
481
505
}
482
506
483
- /* Comment delimiters, hidden but accessible to screen readers and
507
+ /* Comment delimiters, hidden but accessible to screen readers and
484
508
selected for copy/pasting */
485
509
486
510
/* Taken from bootstrap */
@@ -759,19 +783,29 @@ td.def-doc *:first-child {
759
783
line-height : 1.2 ;
760
784
}
761
785
786
+ .odoc-search + * + .odoc-toc {
787
+ --toc-top : calc (var (--search-bar-height ) + var (--search-padding-top ) + 20px );
788
+ max-height : calc (100vh - 2 * var (--toc-top ));
789
+ top : var (--toc-top )
790
+ }
791
+
762
792
.odoc-toc {
763
- position : fixed;
764
- top : 0px ;
765
- bottom : 0px ;
766
- left : 0px ;
767
- max-width : 30ex ;
768
- min-width : 26ex ;
769
- width : 20% ;
793
+ --toc-top : 20px ;
794
+ width : 28ex ;
770
795
background : var (--toc-background );
771
796
overflow : auto;
772
797
color : var (--toc-color );
773
798
padding-left : 2ex ;
774
799
padding-right : 2ex ;
800
+ grid-row-start : 3 ;
801
+ grid-row-end : 5 ;
802
+ grid-column : 1 ;
803
+ height : fit-content;
804
+ border : solid 1px var (--border );
805
+ border-radius : 5px ;
806
+ position : sticky;
807
+ max-height : calc (100vh - 2 * var (--toc-top ));
808
+ top : var (--toc-top )
775
809
}
776
810
777
811
.odoc-toc ul li a {
@@ -789,26 +823,31 @@ td.def-doc *:first-child {
789
823
}
790
824
791
825
: root {
792
- --search-bar-height : 20px ;
826
+ --search-bar-height : 25px ;
827
+ --search-padding-top : 1rem ;
793
828
}
794
829
795
830
.odoc-search {
796
- --padding-top : 1rem ;
797
831
position : sticky;
798
832
top : 0 ;
799
833
background : var (--main-background );
800
- height : calc (var (--search-bar-height ) + var (--padding-top ));
834
+ /* This amounts to fit-content when the search is not active, but when you
835
+ have the search results displayed, you do not want the height of the search
836
+ container to change. */
837
+ height : calc (var (--search-bar-height ) + var (--search-padding-top ));
801
838
width : 100% ;
802
- padding-top : var (--padding-top );
839
+ padding-top : var (--search- padding-top );
803
840
z-index : 1 ;
841
+ grid-row : 1 ;
842
+ grid-column-start : 1 ;
843
+ grid-column-end : 3 ;
804
844
}
805
845
806
846
807
847
.odoc-search .search-inner {
808
848
width : 100% ;
809
849
position : relative;
810
850
left : 0 ;
811
- transition : left 0.3s , transform 0.3s , width 0.3s ;
812
851
display : grid;
813
852
/* The second column is for the search snake, which has 0 width */
814
853
grid-template-columns : 1fr 0fr ;
@@ -818,20 +857,13 @@ td.def-doc *:first-child {
818
857
background : transparent;
819
858
}
820
859
821
- .odoc-search : focus-within .search-inner {
822
- /* Search inner is bigger than its parent, but the overflow needs to be
823
- centered. */
824
- left : 50% ;
825
- transform : translateX (-50% );
826
- width : 110% ;
827
- }
828
-
829
860
.odoc-search .search-bar {
830
861
position : relative;
831
862
z-index : 2 ;
832
863
font-size : 1em ;
833
864
transition : font-size 0.3s ;
834
865
box-shadow : 0px 0px 0.2rem 0.3em var (--main-background );
866
+ height : var (--search-bar-height );
835
867
}
836
868
837
869
.odoc-search : focus-within .search-bar {
@@ -934,7 +966,7 @@ td.def-doc *:first-child {
934
966
.odoc-search .search-entry {
935
967
color : var (--color );
936
968
display : grid;
937
- /* Possible kinds are the following :
969
+ /* Possible kinds are the following :
938
970
"doc" "type" "mod" "exn" "class" "meth" "cons" "sig" "cons" "field" "val"
939
971
and "ext".
940
972
As the longest is 5 characters (and the font monospace), we give 5
@@ -1113,6 +1145,11 @@ td.def-doc *:first-child {
1113
1145
@media only screen and (max-width : 110ex ) {
1114
1146
body {
1115
1147
margin : 2em ;
1148
+ padding : 0 ;
1149
+ }
1150
+
1151
+ body .odoc {
1152
+ display : block;
1116
1153
}
1117
1154
1118
1155
.odoc-toc {
0 commit comments