Skip to content

Commit cb9e3d3

Browse files
committed
feat: enhance code syntaxe
1 parent 1713d1c commit cb9e3d3

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

.astro/content-modules.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
export default new Map([
33
["src/content/blog/welcome.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fblog%2Fwelcome.mdx&astroContentModuleFlag=true")],
4-
["src/content/docs/syntax/alert.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Falert.mdx&astroContentModuleFlag=true")],
5-
["src/content/docs/syntax/code-block.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Fcode-block.mdx&astroContentModuleFlag=true")],
6-
["src/content/docs/syntax/markdown.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Fmarkdown.mdx&astroContentModuleFlag=true")],
7-
["src/content/docs/syntax/text.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Ftext.mdx&astroContentModuleFlag=true")],
4+
["src/content/docs/framework/getting-started.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fgetting-started.mdx&astroContentModuleFlag=true")],
85
["src/content/docs/framework/blog.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fblog.mdx&astroContentModuleFlag=true")],
96
["src/content/docs/framework/configuration.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fconfiguration.mdx&astroContentModuleFlag=true")],
107
["src/content/docs/framework/docs.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fdocs.mdx&astroContentModuleFlag=true")],
11-
["src/content/docs/framework/getting-started.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fgetting-started.mdx&astroContentModuleFlag=true")],
8+
["src/content/docs/framework/project-structure.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fproject-structure.mdx&astroContentModuleFlag=true")],
129
["src/content/docs/framework/installation.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Finstallation.mdx&astroContentModuleFlag=true")],
13-
["src/content/docs/framework/project-structure.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fframework%2Fproject-structure.mdx&astroContentModuleFlag=true")]]);
10+
["src/content/docs/syntax/alert.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Falert.mdx&astroContentModuleFlag=true")],
11+
["src/content/docs/syntax/text.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Ftext.mdx&astroContentModuleFlag=true")],
12+
["src/content/docs/syntax/code-block.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Fcode-block.mdx&astroContentModuleFlag=true")],
13+
["src/content/docs/syntax/markdown.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsyntax%2Fmarkdown.mdx&astroContentModuleFlag=true")]]);
1414

explainer.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ export default defineExplainerConfig({
5050
description: 'Learn markdown syntax and markdown components.',
5151
href: '/docs/syntax/texts',
5252
},
53-
{
54-
label: 'Example',
55-
description: 'Example documentation',
56-
href: '/docs/example/welcome',
57-
},
5853
],
5954
},
6055
{

src/assets/css/markdown.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,18 @@ h6 {
245245
padding-left: 1.5em;
246246
}
247247

248-
html .prose .astro-code,
249-
html .prose .astro-code span:not(.highlighted, .highlighted-word, .diff) * {
248+
html:not(.dark) .prose .astro-code,
249+
html:not(.dark) .prose .astro-code span:not(.highlighted, .highlighted-word, .diff) * {
250250
background-color: var(--muted) !important;
251251
}
252252

253253
html.dark .prose .astro-code,
254-
html.dark .prose .astro-code span:not(.highlighted, .highlighted-word, .diff) * {
254+
html.dark .prose .astro-code * {
255255
color: var(--shiki-dark) !important;
256+
}
257+
258+
html.dark .prose .astro-code,
259+
html.dark .prose>.astro-code {
256260
background-color: var(--shiki-dark-bg) !important;
257261
}
258262

@@ -313,7 +317,6 @@ html.dark .prose .astro-code span:not(.highlighted, .highlighted-word, .diff) *
313317
position: relative;
314318

315319
&.highlighted {
316-
background-color: var(--bg-highlight);
317320

318321
&.error {
319322
background-color: rgba(244, 63, 94, .20);
@@ -340,18 +343,18 @@ html.dark .prose .astro-code span:not(.highlighted, .highlighted-word, .diff) *
340343

341344
.highlighted-word {
342345
position: relative;
343-
color: white;
346+
z-index: 0;
344347
margin: 0 5px;
345348

346349
&::before {
347350
content: "";
348351
position: absolute;
352+
z-index: 0;
349353
left: -5px;
350354
top: -3px;
351355
bottom: -3px;
352356
right: -5px;
353357
border: 1px solid var(--color-border-tab);
354-
background-color: var(--bg-highlight);
355358
border-radius: 0.25rem;
356359
}
357360
}

0 commit comments

Comments
 (0)