Skip to content

Commit

Permalink
fix: fix code block line number highlights were not showing correctly (
Browse files Browse the repository at this point in the history
…#142)

Co-authored-by: Kia King Ishii <kia.king.08@gmail.com>
  • Loading branch information
patak-dev and kiaking authored Nov 24, 2020
1 parent 1836934 commit 0c644fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

```json
```json{3,5,7}
{
"scripts": {
"docs:dev": "vitepress dev docs",
Expand Down
10 changes: 5 additions & 5 deletions src/client/theme-default/styles/code.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
code {
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);
background-color: rgba(27, 31, 35, 0.05);
padding: 0.25rem 0.5rem;
Expand Down Expand Up @@ -59,9 +59,9 @@ div[class*='language-'] {
/* Line highlighting */

.highlight-lines {
font-size: 0.9em;
font-size: var(--code-font-size);
user-select: none;
padding-top: 1.3rem;
padding-top: var(--code-padding-vertical);
position: absolute;
top: 0;
left: 0;
Expand All @@ -87,8 +87,8 @@ div[class*='language-'].line-numbers-mode {
text-align: center;
color: #888;
line-height: 1.5;
font-size: 0.9em;
padding: 1.3rem 0;
font-size: var(--code-font-size);
padding: var(--code-padding-vertical) 0;
border-right: 1px solid rgba(0,0,0,50%);
z-index: 4;
}
Expand Down
4 changes: 3 additions & 1 deletion src/client/theme-default/styles/vars.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** Base styles */
/** Base Styles */
:root {

/**
Expand Down Expand Up @@ -46,6 +46,8 @@

--c-bg: var(--c-white);

--code-padding-vertical: 1.5rem;
--code-font-size: .85em;
--code-bg-color: #282c34;

}

0 comments on commit 0c644fc

Please sign in to comment.