@@ -41,6 +41,7 @@ xmlns="http://www.w3.org/2000/svg" fill="black" height="18px">\
41
41
--font-family : "Source Serif 4" , NanumBarunGothic, serif;
42
42
--font-family-code : "Source Code Pro" , monospace;
43
43
--line-number-padding : 4px ;
44
+ --line-number-right-margin : 20px ;
44
45
/* scraped examples icons (34x33px) */
45
46
--prev-arrow-image : url ('data:image/svg+xml,<svg width="16" height="16" viewBox="0 0 16 16" \
46
47
enable-background= "new 0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="none" \
@@ -848,22 +849,6 @@ ul.block, .block li, .block ul {
848
849
border-radius : 6px ;
849
850
}
850
851
851
- /*
852
- If the code example line numbers are displayed, there will be a weird radius in the middle from
853
- both the code example and the line numbers, so we need to remove the radius in this case.
854
- */
855
- .rustdoc .example-wrap > .example-line-numbers ,
856
- .rustdoc .scraped-example .src-line-numbers ,
857
- .rustdoc .scraped-example .src-line-numbers > pre {
858
- border-top-right-radius : 0 ;
859
- border-bottom-right-radius : 0 ;
860
- }
861
- .rustdoc .example-wrap > .example-line-numbers + pre ,
862
- .rustdoc .scraped-example .rust {
863
- border-top-left-radius : 0 ;
864
- border-bottom-left-radius : 0 ;
865
- }
866
-
867
852
.rustdoc .scraped-example {
868
853
position : relative;
869
854
}
@@ -908,65 +893,105 @@ both the code example and the line numbers, so we need to remove the radius in t
908
893
overflow : auto;
909
894
}
910
895
911
- .rustdoc .example-wrap pre .example-line-numbers ,
912
- .rustdoc .example-wrap .src-line-numbers {
913
- min-width : fit-content; /* prevent collapsing into nothing in truncated scraped examples */
914
- flex-grow : 0 ;
915
- text-align : right;
916
- -moz-user-select : none;
917
- -webkit-user-select : none;
918
- -ms-user-select : none;
919
- user-select : none;
920
- padding : 14px 8px ;
921
- padding-right : 2px ;
922
- color : var (--src-line-numbers-span-color );
923
- }
924
-
925
- .example-wrap .digits-1 [data-nosnippet ] {
896
+ .example-wrap .digits-1 : not (.hide-lines ) [data-nosnippet ] {
926
897
width : calc (1ch + var (--line-number-padding ) * 2 );
927
898
}
928
- .example-wrap .digits-2 [data-nosnippet ] {
899
+ .example-wrap .digits-2 : not (. hide-lines ) [data-nosnippet ] {
929
900
width : calc (2ch + var (--line-number-padding ) * 2 );
930
901
}
931
- .example-wrap .digits-3 [data-nosnippet ] {
902
+ .example-wrap .digits-3 : not (. hide-lines ) [data-nosnippet ] {
932
903
width : calc (3ch + var (--line-number-padding ) * 2 );
933
904
}
934
- .example-wrap .digits-4 [data-nosnippet ] {
905
+ .example-wrap .digits-4 : not (. hide-lines ) [data-nosnippet ] {
935
906
width : calc (4ch + var (--line-number-padding ) * 2 );
936
907
}
937
- .example-wrap .digits-5 [data-nosnippet ] {
908
+ .example-wrap .digits-5 : not (. hide-lines ) [data-nosnippet ] {
938
909
width : calc (5ch + var (--line-number-padding ) * 2 );
939
910
}
940
- .example-wrap .digits-6 [data-nosnippet ] {
911
+ .example-wrap .digits-6 : not (. hide-lines ) [data-nosnippet ] {
941
912
width : calc (6ch + var (--line-number-padding ) * 2 );
942
913
}
943
- .example-wrap .digits-7 [data-nosnippet ] {
914
+ .example-wrap .digits-7 : not (. hide-lines ) [data-nosnippet ] {
944
915
width : calc (7ch + var (--line-number-padding ) * 2 );
945
916
}
946
- .example-wrap .digits-8 [data-nosnippet ] {
917
+ .example-wrap .digits-8 : not (. hide-lines ) [data-nosnippet ] {
947
918
width : calc (8ch + var (--line-number-padding ) * 2 );
948
919
}
949
- .example-wrap .digits-9 [data-nosnippet ] {
920
+ .example-wrap .digits-9 : not (. hide-lines ) [data-nosnippet ] {
950
921
width : calc (9ch + var (--line-number-padding ) * 2 );
951
922
}
952
923
953
924
.example-wrap [data-nosnippet ] {
954
925
color : var (--src-line-numbers-span-color );
955
926
text-align : right;
956
927
display : inline-block;
957
- margin-right : 20 px ;
928
+ margin-right : var ( --line-number-right-margin ) ;
958
929
-moz-user-select : none;
959
930
-webkit-user-select : none;
960
931
-ms-user-select : none;
961
932
user-select : none;
962
- padding : 0 4 px ;
933
+ padding : 0 var ( --line-number-padding ) ;
963
934
}
964
935
.example-wrap [data-nosnippet ]: target {
965
936
border-right : none;
966
937
}
967
938
.example-wrap .line-highlighted [data-nosnippet ] {
968
939
background-color : var (--src-line-number-highlighted-background-color );
969
940
}
941
+ : root .wrap-source-code .example-wrap [data-nosnippet ] {
942
+ position : absolute;
943
+ left : 0 ;
944
+ }
945
+ .wrap-source-code .example-wrap pre > code {
946
+ position : relative;
947
+ word-break : break-all;
948
+ }
949
+ : root .wrap-source-code .example-wrap pre > code {
950
+ display : block;
951
+ white-space : pre-wrap;
952
+ }
953
+ : root .wrap-source-code .example-wrap pre > code * {
954
+ word-break : break-all;
955
+ }
956
+ : root .wrap-source-code .example-wrap .digits-1 pre > code {
957
+ padding-left : calc (
958
+ 1ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
959
+ }
960
+ : root .wrap-source-code .example-wrap .digits-2 pre > code {
961
+ padding-left : calc (
962
+ 2ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
963
+ }
964
+ : root .wrap-source-code .example-wrap .digits-3 pre > code {
965
+ padding-left : calc (
966
+ 3ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
967
+ }
968
+ : root .wrap-source-code .example-wrap .digits-4 pre > code {
969
+ padding-left : calc (
970
+ 4ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
971
+ }
972
+ : root .wrap-source-code .example-wrap .digits-5 pre > code {
973
+ padding-left : calc (
974
+ 5ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
975
+ }
976
+ : root .wrap-source-code .example-wrap .digits-6 pre > code {
977
+ padding-left : calc (
978
+ 6ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
979
+ }
980
+ : root .wrap-source-code .example-wrap .digits-7 pre > code {
981
+ padding-left : calc (
982
+ 7ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
983
+ }
984
+ : root .wrap-source-code .example-wrap .digits-8 pre > code {
985
+ padding-left : calc (
986
+ 8ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
987
+ }
988
+ : root .wrap-source-code .example-wrap .digits-9 pre > code {
989
+ padding-left : calc (
990
+ 9ch + var (--line-number-padding ) * 2 + var (--line-number-right-margin ));
991
+ }
992
+ .example-wrap .hide-lines [data-nosnippet ] {
993
+ display : none;
994
+ }
970
995
971
996
.search-loading {
972
997
text-align : center;
0 commit comments