Skip to content

Commit e8de09c

Browse files
authored
Codeblocks overflow (#179)
* Polish: Codeblocks overflow * Polish: Add shadow to codeblock + fix images
1 parent 1293a4c commit e8de09c

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

assets/css/v2/style.css

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -973,11 +973,7 @@ blockquote.side-callout {
973973
}
974974

975975
.tab-content {
976-
border-bottom: 1px solid black;
977-
978-
/* Lines extend 1rem into gutter on both sides */
979-
width: calc(100% + 2rem);
980-
margin-left: -1rem;
976+
position: relative;
981977

982978
.tab-pane {
983979
display: none;
@@ -986,15 +982,21 @@ blockquote.side-callout {
986982
margin-left: 1rem;
987983
}
988984

989-
.tab-pane * {
990-
margin-left: 0;
991-
}
992-
993985
.active {
994986
display: block !important;
995987
}
996988
}
997989

990+
.tab-content::after {
991+
/* Bottom Horizontal Line for Tabs */
992+
content: "";
993+
position: absolute;
994+
border-bottom: 1px solid black;
995+
left: calc(-1 * var(--overflow-gutter-extension));
996+
bottom: 0;
997+
width: calc(100% + (2 * var(--overflow-gutter-extension)));
998+
}
999+
9981000
/* Codeblocks */
9991001
.highlight {
10001002
padding: 0 1rem 0 1rem;
@@ -1011,6 +1013,16 @@ blockquote.side-callout {
10111013
grid-column: 1;
10121014
}
10131015

1016+
.code-block .code-header:not(:has(.code-type)) {
1017+
/* Remove margin for codeblocks without a type */
1018+
margin-top: -1.5rem;
1019+
}
1020+
1021+
li .code-block {
1022+
/* For indented code blocks, move 1rem back to align code with text from heading */
1023+
margin-left: -1rem;
1024+
}
1025+
10141026
.icon-code-copy {
10151027
background-color: #f2f2f2;
10161028
border: none;
@@ -1022,21 +1034,29 @@ blockquote.side-callout {
10221034
}
10231035

10241036
.highlight-v2 {
1025-
padding: 0 1rem 0 0;
1026-
margin: 0 -1rem 1rem -1rem;
1037+
margin: 0 0 1rem 0;
10271038
border-top: 1px solid #cccccc;
10281039
border-bottom: 1px solid #cccccc;
10291040
overflow-x: scroll;
10301041
scrollbar-width: none;
1042+
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;
10311052
}
10321053

10331054
.highlight-v2.single-line {
10341055
display: flex;
10351056
align-items: center;
1036-
padding: 0 1rem 0 0;
10371057
border: 1px solid #cccccc;
10381058
overflow-x: scroll;
1039-
width: calc(100% + (2 * var(--overflow-gutter-extension)));
1059+
width: calc(100% + var(--overflow-gutter-extension));
10401060
}
10411061

10421062
.code-header {
@@ -1088,9 +1108,11 @@ figure {
10881108
margin: 0;
10891109
}
10901110

1111+
img,
10911112
.figure-bitmap {
10921113
margin-bottom: 0.625rem;
10931114
display: inline-block;
1115+
width: 100%;
10941116
max-width: 100%;
10951117
}
10961118

0 commit comments

Comments
 (0)