Packages

Browser-side MF2 syntax highlighter + Phoenix LiveView hook. Ships a prebuilt web-tree-sitter bundle and the tree-sitter-mf2 grammar compiled to WASM. Consumers drop a script tag and a textarea-over-pre widget — no per-keystroke server round trip.

Current section

Files

Jump to
mf2_wasm_editor priv themes rainbow_dash.css
Raw

priv/themes/rainbow_dash.css

/*
* MF2 editor theme: RainbowDash Style
*
* Generated by `scripts/generate_themes.exs` from Makeup's
* `rainbow_dash` Pygments theme (pinned to v1.1.0).
* Classes use the tree-sitter capture taxonomy, so this
* stylesheet styles both the browser editor and the HTML
* emitted by `Localize.Message.to_html/2`.
*
* Editor:
* <link rel="stylesheet" href="/mf2_editor/themes/rainbow_dash.css" />
*
* Server-rendered HTML (standalone):
* {:ok, html} = Localize.Message.to_html(msg, standalone: true)
*/
.mf2-highlight {
background-color: #ffffff;
color: #4d4d4d;
padding: 0.75em 1em;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
overflow-x: auto;
}
.mf2-highlight code {
color: #4d4d4d;
}
.mf2-function {
color: #ff8000;
font-weight: bold;
}
.mf2-keyword, .mf2-keyword-import {
color: #5918bb;
font-weight: bold;
}
.mf2-tag, .mf2-keyword-conditional {
color: #2c5dcd;
font-weight: bold;
}
.mf2-attribute, .mf2-punctuation-special {
color: #2c5dcd;
font-style: italic;
}
.mf2-property {
color: #2c5dcd;
font-style: italic;
}
.mf2-number {
color: #5918bb;
font-weight: bold;
}
.mf2-string-escape {
color: #c5060b;
font-weight: bold;
}
.mf2-string {
color: #00cc66;
}
.mf2-constant-builtin {
color: #2c5dcd;
font-weight: bold;
}
.mf2-punctuation-bracket, .mf2-operator {
color: #2c5dcd;
}