# Text and Code

Readable links, keyboard hints, and code treatments. (CSS only.)

Reference: https://timeless.build/docs/components/text-and-code/

## Markup

```html
<div class="ui-primitive-copy">
  <p>Use <a class="ui-link" href="#link">links</a>, <code class="ui-code">inline code</code>, and <kbd class="ui-kbd">Cmd</kbd><kbd class="ui-kbd">K</kbd> in dense interface text.</p>
  <pre class="ui-code" tabindex="0" aria-label="Component CSS import"><code>import '@timelessui/components/css/themes/atmosphere.css'</code></pre>
</div>
```

## Install

```js
import '@timelessui/components/css/tokens.css'
import '@timelessui/components/css/core/code.css'
import '@timelessui/components/css/core/kbd.css'
import '@timelessui/components/css/themes/atmosphere/tokens.css'
import '@timelessui/components/css/themes/atmosphere/link.css'
import '@timelessui/components/css/themes/atmosphere/kbd.css'
import '@timelessui/components/css/themes/atmosphere/code.css'
```

## Attributes

Every value below is implemented by the stylesheets this component ships. Boolean attributes
are presence-based: author the attribute with no value, or omit it.

**ui-link**

| Attribute | Values | Default | Description |
| --- | --- | --- | --- |
| `data-ui-variant` | `default` · `muted` · `danger` | `default` | Link color intent. |

## Styling

Root identity: `ui-link`, `ui-kbd`, `ui-code`.
Required stylesheets: `tokens.css`, `core/code.css`, `core/kbd.css`, `themes/atmosphere/tokens.css`, `themes/atmosphere/link.css`, `themes/atmosphere/kbd.css`, `themes/atmosphere/code.css`.

This component adds no custom properties of its own. Restyle it through the design tokens at https://timeless.build/docs/styling/theming/ or your own CSS.

Design tokens this component reads (16), global and set at the theme level: `--ui-accent`, `--ui-accent-hover`, `--ui-bg-control-muted`, `--ui-bg-surface`, `--ui-bg-surface-raised`, `--ui-danger`, `--ui-duration-fast`, `--ui-ease-standard`, `--ui-fg`, `--ui-fg-muted`, `--ui-focus`, `--ui-font-mono`, `--ui-line`, `--ui-radius-sm`, `--ui-radius-xs`, `--ui-space-4`.

## Accessibility

Keep the native elements, roles, and relationships shown in the markup. Timeless adds only the
state and keyboard coordination the platform does not already provide, and it never supplies
your accessible names — those depend on your content.

This component declares no keyboard contract, because it has none of its own: the markup above
is native elements and native ARIA, and everything a keyboard or a screen reader does with it
comes from the platform. Nothing here manages focus, and nothing here adds a role you did not
author. So the accessibility of this component is the accessibility of the markup — which is why
the markup is the part worth copying exactly.

## Before JavaScript runs

This primitive is CSS only. There is nothing to register and nothing to wait for.
