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