fix: fix code block line number highlights were not showing correctly (#142)

Co-authored-by: Kia King Ishii <kia.king.08@gmail.com>
pull/144/head
Matias Capeletto 5 years ago committed by GitHub
parent 1836934f7c
commit 0c644fc34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,7 +28,7 @@ This section will help you build a basic VuePress documentation site from ground
- **Step. 5:** Add some scripts to `package.json`. - **Step. 5:** Add some scripts to `package.json`.
```json ```json{3,5,7}
{ {
"scripts": { "scripts": {
"docs:dev": "vitepress dev docs", "docs:dev": "vitepress dev docs",

@ -1,6 +1,6 @@
code { code {
font-family: source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace; font-family: source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace;
font-size: 0.85em; font-size: var(--code-font-size);
color: var(--c-text-light); color: var(--c-text-light);
background-color: rgba(27, 31, 35, 0.05); background-color: rgba(27, 31, 35, 0.05);
padding: 0.25rem 0.5rem; padding: 0.25rem 0.5rem;
@ -59,9 +59,9 @@ div[class*='language-'] {
/* Line highlighting */ /* Line highlighting */
.highlight-lines { .highlight-lines {
font-size: 0.9em; font-size: var(--code-font-size);
user-select: none; user-select: none;
padding-top: 1.3rem; padding-top: var(--code-padding-vertical);
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -87,8 +87,8 @@ div[class*='language-'].line-numbers-mode {
text-align: center; text-align: center;
color: #888; color: #888;
line-height: 1.5; line-height: 1.5;
font-size: 0.9em; font-size: var(--code-font-size);
padding: 1.3rem 0; padding: var(--code-padding-vertical) 0;
border-right: 1px solid rgba(0,0,0,50%); border-right: 1px solid rgba(0,0,0,50%);
z-index: 4; z-index: 4;
} }

@ -1,4 +1,4 @@
/** Base styles */ /** Base Styles */
:root { :root {
/** /**
@ -46,6 +46,8 @@
--c-bg: var(--c-white); --c-bg: var(--c-white);
--code-padding-vertical: 1.5rem;
--code-font-size: .85em;
--code-bg-color: #282c34; --code-bg-color: #282c34;
} }

Loading…
Cancel
Save