Skip to content

Commit 12d19c5

Browse files
authored
fix: DC-5453 Update highlighted code padding (#7136)
* Update highlighted code padding * update global rule
1 parent b57f1ae commit 12d19c5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/css/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,11 @@ code:not(pre > code) {
15691569
background-color: var(--code-inline-bgd-color);
15701570
}
15711571

1572+
pre > code {
1573+
border-top-right-radius: 0 !important;
1574+
border-top-left-radius: 0 !important;
1575+
}
1576+
15721577
.anchor code {
15731578
font-size: inherit;
15741579
display: inline-block;

src/theme/CodeBlock/Line/styles.module.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus
1010
:global(.theme-code-block-added-line)::before {
1111
content: "+" !important;
1212
position: absolute;
13-
left: 16px;
13+
left: 8px;
1414
color: #47bb78;
1515
}
1616
:global(.theme-code-block-deleted-line) {
@@ -22,7 +22,7 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus
2222
:global(.theme-code-block-deleted-line)::before {
2323
content: "-" !important;
2424
position: absolute;
25-
left: 16px;
25+
left: 8px;
2626
color: #e53e3e;
2727
}
2828

@@ -35,7 +35,7 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus
3535
:global(.theme-code-block-edited-line)::before {
3636
content: "" !important;
3737
position: absolute;
38-
left: 16px;
38+
left: 8px;
3939
color: #a0aec0;
4040
}
4141

@@ -112,3 +112,7 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus
112112
margin-left: calc(var(--ifm-pre-padding) + 8.41px);
113113
}
114114
}
115+
116+
:global(code:has(.theme-code-block-added-line, .theme-code-block-deleted-line, .theme-code-block-edited-line) > span) {
117+
padding-left: 32px !important;
118+
}

0 commit comments

Comments
 (0)