Skip to content

Commit 73331ee

Browse files
committed
Fixed edge cases for rounded borders on code blocks
1 parent aa34402 commit 73331ee

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
lines changed

material/assets/stylesheets/main.faa78eba.min.css renamed to material/assets/stylesheets/main.8d5d63f8.min.css

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/stylesheets/main.faa78eba.min.css.map renamed to material/assets/stylesheets/main.8d5d63f8.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{% endif %}
3535
{% endblock %}
3636
{% block styles %}
37-
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.faa78eba.min.css' | url }}">
37+
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.8d5d63f8.min.css' | url }}">
3838
{% if config.theme.palette %}
3939
{% set palette = config.theme.palette %}
4040
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e6a45f82.min.css' | url }}">

src/assets/stylesheets/main/extensions/pymdownx/_highlight.scss

+11-4
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@
180180
// Adjust spacing for code block
181181
+ pre {
182182
margin-top: 0;
183+
184+
// Remove rounded border on top side
185+
> code {
186+
border-top-left-radius: 0;
187+
border-top-right-radius: 0;
188+
}
183189
}
184190
}
185191

@@ -191,7 +197,8 @@
191197
// don't overlay line numbers, as active annotations have a `z-index` of 2.
192198
z-index: 3;
193199
float: left;
194-
margin-inline: px2em(16px, 13.6px);
200+
margin-right: px2em(16px, 13.6px);
201+
margin-left: px2em(-16px, 13.6px);
195202
padding-left: px2em(16px, 13.6px);
196203
color: var(--md-default-fg-color--light);
197204
background-color: var(--md-code-bg-color);
@@ -309,8 +316,8 @@
309316

310317
// Remove rounded borders on left side
311318
code {
312-
border-top-right-radius: px2rem(2px);
313-
border-bottom-right-radius: px2rem(2px);
319+
border-top-left-radius: 0;
320+
border-bottom-left-radius: 0;
314321
}
315322
}
316323

@@ -350,7 +357,7 @@
350357
padding: 0 px2rem(16px);
351358
}
352359

353-
// Omit rounded borders
360+
// Remove rounded borders
354361
code {
355362
border-radius: 0;
356363
}

src/assets/stylesheets/main/extensions/pymdownx/_tabbed.scss

+8-2
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,19 @@
186186
> .highlighttable:first-child {
187187
margin: 0;
188188

189-
// Omit rounded borders
190-
> code {
189+
// Remove rounded borders
190+
code {
191191
border-start-start-radius: 0;
192192
border-start-end-radius: 0;
193193
}
194194
}
195195

196+
// Remove rounded border on line numbers container
197+
> .highlighttable:first-child .linenos {
198+
border-start-start-radius: 0;
199+
border-start-end-radius: 0;
200+
}
201+
196202
// Code block result container is the second child
197203
> .result:nth-child(2) {
198204
margin-top: 0;

0 commit comments

Comments
 (0)