File tree Expand file tree Collapse file tree 3 files changed +66
-2
lines changed Expand file tree Collapse file tree 3 files changed +66
-2
lines changed Original file line number Diff line number Diff line change @@ -973,6 +973,61 @@ blockquote p:last-child {
973
973
}
974
974
975
975
/* Codeblocks */
976
+ .highlight {
977
+ grid-column : 1 / -1 !important ;
978
+ width : 100% ;
979
+ position : relative;
980
+ z-index : -1 ;
981
+ display : grid;
982
+ grid-template-columns : 40% 60% ;
983
+
984
+ pre .chroma {
985
+ grid-column : 1 / -1 ;
986
+ }
987
+
988
+ code .line {
989
+ display : grid;
990
+ grid-template-columns : 40% 60% ;
991
+ grid-template-areas : "comment code" ;
992
+ position : relative;
993
+
994
+ .cl {
995
+ grid-column : 2 / -1 ;
996
+ grid-area : code;
997
+ }
998
+
999
+ .c1 : not (: empty ) {
1000
+ position : relative;
1001
+ display : inline-block;
1002
+ white-space : normal;
1003
+ margin-bottom : var (--codeblock-comment-space-between );
1004
+ width : calc (100% - (var (--codeblock-comment-diff ) * 2 ));
1005
+ border : black var (--codeblock-border-thickness ) solid;
1006
+ box-shadow : 3px 3px 0px var (--color-shadow );
1007
+ padding : 8px ;
1008
+ grid-column : 1 ;
1009
+ grid-area : comment;
1010
+ }
1011
+
1012
+ & : has (.c1 : not (: empty )) .cl {
1013
+ height : fit-content;
1014
+ margin-bottom : var (--codeblock-comment-space-between );
1015
+ background-color : var (--color-codeblock-code-with-comment );
1016
+ }
1017
+
1018
+ & : has (.c1 ) .cl ::before {
1019
+ content : "" ;
1020
+ border-left : none;
1021
+ border-top : black var (--codeblock-border-thickness ) solid;
1022
+ left : calc (var (--codeblock-comment-diff ) * -1 );
1023
+ width : calc (
1024
+ var (--codeblock-horizontal-line-length ) +
1025
+ var (--codeblock-horizontal-line-overflow )
1026
+ );
1027
+ }
1028
+ }
1029
+ }
1030
+
976
1031
.highlight-mf {
977
1032
grid-column : 1 / -1 !important ;
978
1033
position : relative;
@@ -1005,7 +1060,7 @@ blockquote p:last-child {
1005
1060
" comment " ;
1006
1061
}
1007
1062
1008
- code .line : has (.comment ) .code {
1063
+ code .line : has (.comment ) .code . c1 {
1009
1064
display : inline-block;
1010
1065
height : fit-content;
1011
1066
white-space : pre-wrap;
Original file line number Diff line number Diff line change
1
+ document . addEventListener ( 'DOMContentLoaded' , ( ) => {
2
+ const codeblockLines = document . querySelectorAll ( 'span.c1' ) ;
3
+ codeblockLines . forEach ( ( val ) => {
4
+ const parent = val . parentNode ;
5
+ parent . parentNode . insertBefore ( val , parent . nextSibling ) ;
6
+ } ) ;
7
+ } ) ;
Original file line number Diff line number Diff line change 60
60
61
61
{{ end }}
62
62
63
-
63
+ <!-- Load Codeblock javascript -->
64
+ {{ $jsCodeblockV2 := resources.Get "js/codeblock-v2.js" | minify | fingerprint "sha512" }}
65
+ < script src ="{{ $jsCodeblockV2.RelPermalink }} " type ="text/javascript " integrity ="{{ $jsCodeblockV2.Data.Integrity }} "> </ script >
64
66
65
67
<!-- Load Sidebar javascript -->
66
68
{{ $jsSidebar := resources.Get "js/sidebar.js" | minify | fingerprint "sha512" }}
You can’t perform that action at this time.
0 commit comments