Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/components/InlineEditor.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
---
import { Code } from "astro:components";
import lightPlus from "@shikijs/themes/light-plus";
const { code } = Astro.props;

import flixGrammar from "../grammars/flix.tmLanguage.json";

// Light+ colors `keyword`/`storage` blue but `keyword.control` magenta;
// unify them so all Flix keywords share the magenta.
const theme = {
...lightPlus,
name: "light-plus-flix",
tokenColors: [
...(lightPlus.tokenColors ?? []),
{ scope: ["keyword", "storage"], settings: { foreground: "#AF00DB" } },
],
};
---

<div class="inline-editor-frame">
<div class="inline-editor-code">
<Code code={code} theme="light-plus" lang={flixGrammar} />
<Code code={code} theme={theme} lang={flixGrammar} />
</div>
</div>
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ p:last-child {
font-family:
Monaco, Menlo, "Ubuntu Mono", Consolas, "Source Code Pro",
source-code-pro, monospace;
line-height: 16px;
line-height: 14px;
}

.inline-editor-code pre {
Expand Down