Skip to content

Commit

Permalink
Improved styling of code annotations and fixed borders of code blocks…
Browse files Browse the repository at this point in the history
… in tabs
  • Loading branch information
squidfunk committed Mar 26, 2022
1 parent c7cc8f0 commit 71dd84a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.9d5733d3.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.36ad6006.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e6a45f82.min.css' | url }}">
Expand Down
9 changes: 2 additions & 7 deletions src/assets/stylesheets/main/extensions/pymdownx/_tabbed.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@
// Code block is the first child of a tab - remove margin and mirror
// previous (now deprecated) SuperFences code block grouping behavior
> pre:first-child,
> .highlight:first-child pre,
> .highlight:first-child > pre:first-child,
> .highlighttable:first-child {
margin: 0;

// Remove rounded borders
code {
> code {
border-start-start-radius: 0;
border-start-end-radius: 0;
}
Expand All @@ -204,11 +204,6 @@
border-start-end-radius: 0;
}

// Code block result container is the second child
> .result:nth-child(2) {
margin-top: 0;
}

// Adjust spacing for nested tabbed container
> .tabbed-set {
margin: 0;
Expand Down
35 changes: 21 additions & 14 deletions src/assets/stylesheets/main/layout/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
// alignment of text following an annotation.
&::after {
position: absolute;
top: 0.025em;
left: -0.126em;
z-index: -1;
// Hack: the first property is used as a fallback for older browsers
Expand Down Expand Up @@ -209,20 +208,28 @@
}
}

// Annotation marker content
[data-md-annotation-id]::before {
// Annotation marker
[data-md-annotation-id] {
display: inline-block;
transition: transform 400ms cubic-bezier(0.1, 0.7, 0.1, 1);
content: attr(data-md-annotation-id);

// [not print]: if we're not in print mode, show a `+` sign instead of
// the original numbers, as context is already given by the position.
@media not print {
content: "+";

// Annotation marker content on focus
:focus-within > & {
transform: rotate(45deg);
line-height: 90%;

// Annotation marker content
&::before {
display: inline-block;
padding-bottom: 0.1em;
vertical-align: 0.0625em;
transition: transform 400ms cubic-bezier(0.1, 0.7, 0.1, 1);
content: attr(data-md-annotation-id);

// [not print]: if we're not in print mode, show a `+` sign instead of
// the original numbers, as context is already given by the position.
@media not print {
content: "+";

// Annotation marker content on focus
:focus-within > & {
transform: rotate(45deg);
}
}
}
}
Expand Down

0 comments on commit 71dd84a

Please sign in to comment.