Skip to content

Commit 86b08e4

Browse files
committed
style. new syntax highlight theme for code
1 parent 69771e5 commit 86b08e4

File tree

5 files changed

+802
-852
lines changed

5 files changed

+802
-852
lines changed

astro.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'astro/config'
2-
import ayuMirage from '/src/styles/ayu-mirage.json'
2+
import kopiLuwak from '/src/styles/kopi-luwak.json'
33

44
export default defineConfig({
55
markdown: {
6-
shikiConfig: { theme: ayuMirage },
6+
shikiConfig: { theme: kopiLuwak },
77
},
88
site: 'https://samdevega.github.io',
99
})

src/layouts/MarkdownPostLayout.astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ const pageTitle = siteTitle + ' - ' + subtitle
148148

149149
.pre-header {
150150
align-items: center;
151-
background-color: #1f2430;
152-
box-shadow: inset 0 -1px 0px #3a445a;
151+
box-shadow: inset 0 -1px 0px rgba(255, 255, 255, 0.1);
153152
border-radius: 0.25rem 0.25rem 0 0;
154-
color: var(--light-color);
155153
display: flex;
156154
font-family: 'CascadiaCode', monospace;
157155
font-size: 0.875rem;

src/scripts/copy.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ codeNodes.forEach(node => {
88
let timeoutId
99
const preHeader = document.createElement('div')
1010
const previousDomNode = node.parentElement.previousElementSibling
11+
const preBackgroundColor = getComputedStyle(node.parentElement).backgroundColor
12+
const preColor = getComputedStyle(node.parentElement).color
13+
preHeader.style.backgroundColor = preBackgroundColor
14+
preHeader.style.color = preColor
1115
const isPreTitle = previousDomNode
1216
&& previousDomNode.tagName === 'P'
1317
&& previousDomNode.children.length === 1

0 commit comments

Comments
 (0)