# Styles

```css
@import '@memomori/charon/styles.css';
```

```html
<article class="charon">…</article>
```

The CSS is plain: no Tailwind and no build step. Importing the parser loads no
CSS, so import it on its own.

Add `not-prose` to any element inside `.charon` that should keep its own
styles.

## Dark mode

Every color is a `light-dark()` pair, so the theme follows `color-scheme`. Set
it on the page:

```css
:root {
  color-scheme: light dark;
}
```

Set `color-scheme: dark` to force the dark colors.

## Colors

Override any `--charon-*` property. The defaults sit in `:where(:root)`, so any
rule of yours wins:

```css
:root {
  --charon-links: #0f766e;
  --charon-callout-tip: light-dark(#15803d, #4ade80);
}
```

| Token                                                                                                       | Colors                       |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------- |
| `--charon-body`, `--charon-lead`, `--charon-headings`, `--charon-bold`, `--charon-links`, `--charon-quotes` | text                         |
| `--charon-counters`, `--charon-bullets`, `--charon-captions`, `--charon-kbd`                                | list markers, captions, keys |
| `--charon-hr`, `--charon-quote-borders`, `--charon-th-borders`, `--charon-td-borders`                       | rules and borders            |
| `--charon-code`, `--charon-code-inline-background`                                                          | inline code                  |
| `--charon-code-background`, `--charon-code-foreground`, `--charon-code-<token>`                             | code blocks and highlighting |
| `--charon-callout-note`, `-tip`, `-important`, `-warning`, `-danger`, `-quote`                              | callouts                     |
| `--charon-tag`, `--charon-wiki-broken`, `--charon-wiki-ambiguous`                                           | tags and unresolved links    |

## Files

| File             | Holds                                                                         |
| ---------------- | ----------------------------------------------------------------------------- |
| `styles.css`     | the three below                                                               |
| `reset.css`      | a reset scoped to `.charon`: the part of Tailwind's preflight the theme needs |
| `typography.css` | spacing, sizes and base colors, from Tailwind Typography                      |
| `charon.css`     | tokens, code, callouts, tags, links and KaTeX                                 |

Each optional module has its own file: `heading-links.css`, `examples.css` and
`assets.css`. A docs site adds `docs.css`; see [Labels and styles](sites/labels.md).

## With Tailwind

Skip `reset.css`, since preflight does its job. Put `typography.css` in the
components layer, so utilities beat it:

```css
@import 'tailwindcss';
@import '@memomori/charon/typography.css' layer(components);
@import '@memomori/charon/charon.css';
```

`typography.css` and `reset.css` derive from Tailwind CSS, under its MIT
license. See `THIRD-PARTY-NOTICES` in the package.
