Skip to content

Commit

Permalink
fix scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
namachan10777 committed Jun 22, 2024
1 parent 8724668 commit 75b8cde
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"astro-icon": "^1.1.0",
"astro-seo": "^0.8.4",
"hast-util-to-html": "^9.0.1",
"hast-util-to-string": "^3.0.0",
"license-checker": "^25.0.1",
"license-checker-rseidelsohn": "^4.3.0",
"lightningcss": "^1.25.1",
Expand All @@ -55,6 +54,7 @@
"retext-english": "^5.0.0",
"retext-equality": "^7.1.0",
"retext-stringify": "^4.0.0",
"shiki": "^1.9.0",
"sharp": "^0.33.4",
"typescript": "^5.4.5",
"unified": "^11.0.4",
Expand All @@ -71,7 +71,6 @@
"npm-run-all2": "^6.2.0",
"prettier": "^3.3.2",
"prettier-plugin-astro": "^0.14.0",
"shiki": "^1.9.0",
"stylelint": "^16.6.1",
"stylelint-config-html": "^1.1.0",
"stylelint-config-standard": "^36.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/components/mdx/pre.astro
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export interface Props {
}

pre {
overflow-x: scroll;
overflow-x: auto;
scrollbar-color: var(--fg-thumb) var(--fg-track);
font-size: var(--font-size-sm);
}

Expand Down
8 changes: 8 additions & 0 deletions src/layouts/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
--light-fg-normal: rgb(0 0 0 / 85%);
--light-fg-strong: rgb(0 0 0 / 100%);
--light-fg-linenum: rgb(0 0 0 / 40%);
--light-fg-thumb: #bbb;
--light-fg-track: #ddd;

--dark-bg: #202020;
--dark-bg-code: #303030;
Expand All @@ -32,6 +34,8 @@
--dark-fg-normal: rgb(255 255 255 / 85%);
--dark-fg-strong: rgb(255 255 255 / 100%);
--dark-fg-linenum: rgb(255 255 255 / 40%);
--dark-fg-thumb: #555;
--dark-fg-track: #333;
}

body {
Expand All @@ -53,6 +57,8 @@ body {
--fg-normal: var(--light-fg-normal);
--fg-strong: var(--light-fg-strong);
--fg-linenum: var(--light-fg-linenum);
--fg-thumb: var(--light-fg-thumb);
--fg-track: var(--light-fg-track);
}

:root:has(#theme-switcher[data-theme="dark"]) {
Expand All @@ -66,4 +72,6 @@ body {
--fg-normal: var(--dark-fg-normal);
--fg-strong: var(--dark-fg-strong);
--fg-linenum: var(--dark-fg-linenum);
--fg-thumb: var(--dark-fg-thumb);
--fg-track: var(--dark-fg-track);
}

0 comments on commit 75b8cde

Please sign in to comment.