Fixed edge cases for rounded borders on code blocks

This commit is contained in:
squidfunk 2022-01-10 17:34:59 +01:00
parent aa3440215a
commit 73331ee78c
5 changed files with 30 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.faa78eba.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.8d5d63f8.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e6a45f82.min.css' | url }}">

View File

@ -180,6 +180,12 @@
// Adjust spacing for code block
+ pre {
margin-top: 0;
// Remove rounded border on top side
> code {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
}
@ -191,7 +197,8 @@
// don't overlay line numbers, as active annotations have a `z-index` of 2.
z-index: 3;
float: left;
margin-inline: px2em(16px, 13.6px);
margin-right: px2em(16px, 13.6px);
margin-left: px2em(-16px, 13.6px);
padding-left: px2em(16px, 13.6px);
color: var(--md-default-fg-color--light);
background-color: var(--md-code-bg-color);
@ -309,8 +316,8 @@
// Remove rounded borders on left side
code {
border-top-right-radius: px2rem(2px);
border-bottom-right-radius: px2rem(2px);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
@ -350,7 +357,7 @@
padding: 0 px2rem(16px);
}
// Omit rounded borders
// Remove rounded borders
code {
border-radius: 0;
}

View File

@ -186,13 +186,19 @@
> .highlighttable:first-child {
margin: 0;
// Omit rounded borders
> code {
// Remove rounded borders
code {
border-start-start-radius: 0;
border-start-end-radius: 0;
}
}
// Remove rounded border on line numbers container
> .highlighttable:first-child .linenos {
border-start-start-radius: 0;
border-start-end-radius: 0;
}
// Code block result container is the second child
> .result:nth-child(2) {
margin-top: 0;