Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multi-line inline code styling #106

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Any non-code changes should be prefixed with `(docs)`.
See `PUBLISH.md` for instructions on how to publish a new version.
-->

- (patch) Fix multi-line inline code styling


## v1.12.5 - fc90098

Expand Down
24 changes: 5 additions & 19 deletions styles/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,11 @@ limitations under the License.
// Inline code
pre,
code {
background-color: $gray8;
border-radius: 0.5em;
color: $gray3;
font-size: 0.875em;
padding: 0 0.2em;
position: relative;

&::before {
background-color: $gray8;
border-radius: 0.5em;
content: "";
display: block;
inset: -0.2em 0;
position: absolute;
z-index: -1;
}
padding: 0.2em;
}

// Code blocks
Expand All @@ -50,14 +41,9 @@ pre {
white-space: normal;
word-wrap: normal;

&,
code {
&::before {
display: none;
}
}

code {
background: none;
border-radius: 0;
color: inherit;
font-size: 1em;
padding: 0;
Expand Down
12 changes: 7 additions & 5 deletions styles/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ ol {

// Links
a {
background: linear-gradient($blue2, $blue2) bottom repeat-x;
background-size: 1px 1px;
background: linear-gradient($blue2, $blue2) center bottom / 100% 1px no-repeat;
border-bottom: none;
color: $blue2;
text-decoration: none;
Expand All @@ -106,17 +105,20 @@ a {

&:hover,
&:focus {
background: linear-gradient($blue1, $blue1) bottom repeat-x;
background-size: 100% 100%;
background: linear-gradient($blue1, $blue1) center bottom / 100% 100% no-repeat;
color: $white;

code {
background: linear-gradient($blue1, $blue1) center calc(100% - 0.2em + 0.5px) / 100% calc(100% - (0.2em * 2)) no-repeat, linear-gradient($gray8, $gray8);
color: $white;
}
}

code {
transition: color 300ms ease-in-out;
background: linear-gradient($blue2, $blue2) center calc(100% - 0.2em + 0.5px) / 100% 1px no-repeat, linear-gradient($gray8, $gray8);
transition:
background 300ms ease-in-out,
color 300ms ease-in-out;
}
}

Expand Down