This page shares how to get started with the arXiv Design System: basic markup, which files to link to, in what order, and a handful of things to avoid.
If you are an AI assistant, AGENTS.md at the repository root holds the file map in a form you can route from.
Every core file you need to include in your repo, and in what order.
fonts.css. Include this file before design-system.css. The font file declares the faces, the stylesheet names them. Either order renders but we have chosen this way for consistency.design-system.css. The foundational tier 1 stylesheet. When working on internal pages, there is a tier 2 stylesheet that builds on this one.theme.js. The foundational tier 1 JavaScript. Internal tools add no JavaScript of their own.toc.js, optional. Add it when the page has a contents bar. The bar itself is tier 1; the script closes the menu after a choice and names the section the reader is in. See Contents bar.copy-code.js, optional. Add it when the page shows code a reader might take away. It needs no markup: it finds every <pre> on the page and puts a copy button on each one.theme.js is not deferred. The script is deliberately not deferred because it writes the reader's theme onto <html> before the first paint. If we added defer then the page will render light first, and then flip if the reader chose dark mode in their system. Many readers choose dark mode because light mode is less legible or hurts their eyes and we want to honor that.This is all you need for a public arXiv page. Copy it and follow the comments.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Your page — arXiv</title>
<link rel="stylesheet" href="fonts.css">
<link rel="stylesheet" href="design-system.css">
<script src="theme.js"></script>
</head>
<body class="ds-page">
<div class="ds-container">
<!-- add section elements as direct children here -->
</div>
</body>
</html>
class="ds-page" on the body is not optional. A page without it gets components on unstyled ground. The foundation hangs on the class rather than on <body> so that a page which is not on the design system can link the stylesheet, for its header and footer, without its own body styles being overwritten.<section> without one is hard to find.aria-labelledby pointing at the heading) is optional, but useful for a section that a reader would want to jump to directly. Use your discretion. Every named section becomes an entry in the landmark list.<span aria-hidden="true">arXiv</span><span class="is-sr-only">archive</span>.When building internal tools like arXiv Check or Admin Console pages, one class is added to <html> and a tier 2 stylesheet is added to the <head> section, in this order.
<html lang="en" class="ds-internal">
…
<link rel="stylesheet" href="../fonts.css">
<link rel="stylesheet" href="../design-system.css"> <!-- tier 1 -->
<link rel="stylesheet" href="internal-tools.css"> <!-- tier 2 -->
<script src="../theme.js"></script>
internal-tools.css does not work on its own
internal-tools.css is not a standalone stylesheet. It is a lightweight file that holds only the special styles or overrides that are specific to internal tools. Load it on its own and you get no foundation at all.
.ds-internal re-points --ds-accent and its family to Access Lime, and every component inside it that reaches for the accent follows without being told. It works on any parent, so a page that shows both surfaces puts it on a wrapper instead of on <html>. There is no second copy of the button, the tag or the switch inside the tier 2 stylesheet: it is not needed. Just a handful of new styles and overrides, and that class on the wrapper, are enough..ds-container is a grid with various options for managing section layout.
<section> elements, and the container sets the gap between them. Do not add top or bottom margins to sections, the container already does..ds-full. Do not add negative margins or use viewport units for placement. Using a calculation like calc(-50vw + 50%) overhangs the section band and causes the page to scroll sideways in some environments.--ds-width-page and --ds-gutter.
Need to change the page width? Repoint one of the tokens, do not add a second width beside it.<div class="ds-container">
<section>…</section> <!-- content track -->
<section class="ds-full">…</section> <!-- edge to edge -->
</div>