@@ -1009,8 +1009,11 @@ blockquote.side-callout {
1009
1009
}
1010
1010
}
1011
1011
1012
- .code-block {
1012
+ .code-container {
1013
1013
grid-column : 1 ;
1014
+ display : flex;
1015
+ flex-direction : row;
1016
+ position : relative;
1014
1017
}
1015
1018
1016
1019
.code-block .code-header : not (: has (.code-type )) {
@@ -1023,40 +1026,18 @@ li .code-block {
1023
1026
margin-left : -1rem ;
1024
1027
}
1025
1028
1026
- .icon-code-copy {
1027
- background-color : # f2f2f2 ;
1028
- border : none;
1029
- padding : 5px 10px ;
1030
- cursor : pointer;
1031
- font-family : "JetBrains Mono" , monospace;
1032
- font-size : 12px ;
1033
- color : # 000 ;
1034
- }
1035
-
1036
1029
.highlight-v2 {
1037
- margin : 0 0 1rem 0 ;
1038
1030
border-top : 1px solid # cccccc ;
1039
1031
border-bottom : 1px solid # cccccc ;
1040
1032
overflow-x : scroll;
1041
1033
scrollbar-width : none;
1042
1034
width : calc (100% + var (--overflow-gutter-extension ));
1043
-
1044
- background-image : linear-gradient (to right, white, white),
1045
- linear-gradient (to right, white, white),
1046
- linear-gradient (to right, rgba (165 , 165 , 165 , 0.25 ), rgba (255 , 255 , 255 , 0 )),
1047
- linear-gradient (to left, rgba (165 , 165 , 165 , 0.25 ), rgba (255 , 255 , 255 , 0 ));
1048
- background-position : left center, right center, left center, right center;
1049
- background-repeat : no-repeat;
1050
- background-size : 12px 100% , 12px 100% , 10px 100% , 10px 100% ;
1051
- background-attachment : local, local, scroll, scroll;
1052
1035
}
1053
1036
1054
1037
.highlight-v2 .single-line {
1055
1038
display : flex;
1056
1039
align-items : center;
1057
1040
border : 1px solid # cccccc ;
1058
- overflow-x : scroll;
1059
- width : calc (100% + var (--overflow-gutter-extension ));
1060
1041
}
1061
1042
1062
1043
.code-header {
@@ -1070,12 +1051,18 @@ li .code-block {
1070
1051
1071
1052
.code-type {
1072
1053
text-transform : uppercase;
1073
- border : 1px solid # cccccc ;
1074
- border-bottom : 1px solid white;
1075
- padding : .25rem 1rem ; /* Padding for button content */
1054
+ padding : .25rem 0.25rem ; /* Padding for button content */
1076
1055
font-size : 12px ; /* Font size */
1077
1056
z-index : 9999 ;
1078
- margin-bottom : -1px ;
1057
+ position : absolute;
1058
+ background-color : white;
1059
+ margin : -12px 0 0 1rem ;
1060
+ }
1061
+
1062
+ .code-container : hover {
1063
+ .code-copy-button {
1064
+ display : block;
1065
+ }
1079
1066
}
1080
1067
1081
1068
.code-copy-button {
@@ -1086,6 +1073,14 @@ li .code-block {
1086
1073
font-family : "JetBrains Mono" , monospace;
1087
1074
font-size : 12px ;
1088
1075
color : # 000 ;
1076
+ order : 2 ;
1077
+ display : none;
1078
+ }
1079
+
1080
+ .code-copy-button {
1081
+ position : absolute;
1082
+ right : 8px ;
1083
+ margin-top : 8px ;
1089
1084
}
1090
1085
1091
1086
.code-copy-button : hover {
0 commit comments