Skip to content

Commit

Permalink
feat(theme): improve line number
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Nov 7, 2023
1 parent 607bb68 commit 9f1721e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/theme/src/client/styles/code/base.scss
Expand Up @@ -168,7 +168,6 @@ div[class*="language-"] {

display: flex;
flex-direction: column;
justify-content: space-evenly;

width: var(--line-numbers-width);
padding: 1rem 0;
Expand All @@ -188,11 +187,21 @@ div[class*="language-"] {
.line-number {
position: relative;
z-index: 4;

display: flex;
flex: 1;
align-items: center;
justify-content: center;

user-select: none;

&::before {
content: counter(line-number);

display: block;

font-size: 0.8em;
line-height: 1;
counter-increment: line-number;
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/src/client/styles/layout.scss
@@ -1,6 +1,8 @@
@use "@sass-palette/hope-config";

:root {
scrollbar-width: thin;

@media (prefers-reduced-motion: no-preference) {
scroll-behavior: smooth;
}
Expand Down

0 comments on commit 9f1721e

Please sign in to comment.