Skip to content

@scribe-atp/styles

Pure CSS package for rendering Scribe CMS article content. No JavaScript, no build step. All rules are scoped to .scribe-content so they cannot leak into the rest of your page.

Terminal window
npm install @scribe-atp/styles

Import the stylesheet once at the route that renders article content:

import "@scribe-atp/styles";

Then wrap your article HTML in an element with the scribe-content class. The easiest way is the <ScribeContent> component from @scribe-atp/react, which adds the class automatically:

import { ScribeContent } from "@scribe-atp/react";
import "@scribe-atp/styles";
<ScribeContent html={article.content} />

Or apply the class directly if you are not using React:

<div class="scribe-content" [innerHTML]="article.content"></div>

ElementSelector
Code blocks.scribe-content pre
Inline code.scribe-content :not(pre) > code
Syntax tokens.scribe-content .token.keyword etc.
Images.scribe-content img
Blockquotes.scribe-content blockquote
Ordered / unordered lists.scribe-content ul, .scribe-content ol
Checklists.scribe-content li[role="checkbox"]

Syntax token classes (token keyword, token string, …) are the Prism-compatible class names that Scribe CMS emits when it serialises article HTML. The default palette matches Prism’s light theme.


Override any --scribe-* custom property on .scribe-content (or a parent element) to customise the output. This is the recommended way to support dark mode:

.my-article.dark {
--scribe-code-bg: #1e1e1e;
--scribe-code-border: #333;
--scribe-inline-code-bg: rgba(255, 255, 255, 0.08);
--scribe-blockquote-border: #555;
--scribe-blockquote-color: #aaa;
/* VS Code dark+ palette */
--scribe-token-keyword: #569cd6;
--scribe-token-string: #ce9178;
--scribe-token-comment: #6a9955;
--scribe-token-function: #dcdcaa;
--scribe-token-variable: #9cdcfe;
--scribe-token-property: #4ec9b0;
--scribe-token-punctuation: #d4d4d4;
--scribe-token-operator: #d4d4d4;
}

Code blocks & inline code

PropertyDefaultDescription
--scribe-code-bg#f5f5f5Code block background
--scribe-code-border#e0e0e0Code block border colour
--scribe-code-font"Courier New", Courier, monospaceFont family for all code
--scribe-code-font-size0.875emFont size for all code
--scribe-inline-code-bgrgba(0,0,0,0.06)Inline code background

Blockquotes

PropertyDefaultDescription
--scribe-blockquote-border#cccLeft border colour
--scribe-blockquote-color#666Text colour

Checklists

PropertyDefaultDescription
--scribe-checkbox-size1emCheckbox width and height
--scribe-checkbox-border#aaaBorder of an unchecked item
--scribe-checkbox-checked-bg#333Fill of a checked item
--scribe-checkbox-checked-border#333Border of a checked item

Syntax token colours

PropertyDefaultApplies to
--scribe-token-comment#708090comment, prolog, doctype, cdata
--scribe-token-punctuation#555punctuation
--scribe-token-property#905property, tag, boolean, number, constant, symbol, deleted
--scribe-token-string#690string, selector, attr, char, builtin, inserted
--scribe-token-operator#9a6e3aoperator, entity, url
--scribe-token-keyword#07akeyword, atrule
--scribe-token-function#dd4a68function, class-name, class
--scribe-token-variable#e90variable, regex, important