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 {
973973}
974974
975975/* 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+
9761031.highlight-mf {
9771032 grid-column : 1 / -1 !important ;
9781033 position : relative;
@@ -1005,7 +1060,7 @@ blockquote p:last-child {
10051060 " comment " ;
10061061 }
10071062
1008- code .line : has (.comment ) .code {
1063+ code .line : has (.comment ) .code . c1 {
10091064 display : inline-block;
10101065 height : fit-content;
10111066 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 6060
6161{{ end }}
6262
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 >
6466
6567<!-- Load Sidebar javascript -->
6668{{ $jsSidebar := resources.Get "js/sidebar.js" | minify | fingerprint "sha512" }}
You can’t perform that action at this time.
0 commit comments