Skip to content

BREAKING: tokens, typography! - #13

Merged
shawnbot merged 7 commits into
mainfrom
feat/tokens
Nov 2, 2026
Merged

shawnbot merged 7 commits into
mainfrom
feat/tokens

Conversation

@shawnbot

@shawnbot shawnbot commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Sorry, this one is kinda big. 😬

Three major things here that I think qualify this as a major release ("breaking changes"):

  1. We now have a "bundled" version of the Tailwind theme from sf.gov. My process for importing it was to copy the whole theme and tokens directories from the design-system package, convert everything to TypeScript, delete the stuff that we didn't use, then (with Claude's help) collapse it all into a single file, tailwind.theme.ts. When we publish the design system's Tailwind theme, we can just delete this file. 🎉

  2. I've replaced most of the CSS rules with Tailwind @apply directives. This is awesome because it lets us leverage the tokens from the Tailwind theme without having to define any CSS variables. I used the extension and Claude to check my work: Before deleting the CSS rules, I commented them out and wrote the equivalent @apply below, toggled the CSS in the extension for visual confirmation, then asked Claude to compare the generated CSS before and after. The diff was too noisy because Tailwind's output can be verbose, but Claude cut through that and noted places where the diff was irrelevant because the effect was the same.

  3. I've renamed the theme directory to src and created a separate typography.css for, well, typography rules. This is now where we set heading and label text styles, and nothing else.

Sans font

The biggest impact of the typography updates is that we're now using the --font-sans variable that Fillout provides, which is a stripped down version of Tailwind's default:

/* Fillout */
--font-sans: ui-sans-serif, system-ui, sans-serif,
  "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Tailwind */
--font-sans: ui-sans-serif, system-ui,
  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
  "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"

What it really boils down to, though, is that we're no longer trying to display Open Sans and failing because it's not a web-safe font and, as far as I can tell, not included in Fillout forms:

image
📦 Published canary version 1.0.0--canary.13.41146569271.0
https://unpkg.com/@sfgov/fillout@1.0.0--canary.13.41146569271.0/dist/theme-sfgov.css

Copy the URL above to test this release with the CSS extension.

Comment thread src/typography.css
Comment on lines +14 to +26
@apply font-slab text-desktop-heading-xxl;
}
h3 {
@apply font-slab text-desktop-heading-xl;
}
h4 {
@apply font-slab text-desktop-heading-lg;
}
h5 {
@apply font-body text-desktop-heading-md;
}
h6 {
@apply font-body text-desktop-heading-sm;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't know if these are the correct styles. @nlsfds have you specced how headings should be styled in forms somewhere? I couldn't find anything in Figma.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up here for posterity: It looks like I got these right!

@shawnbot shawnbot changed the title feat: tokens, typography! BREAKING: tokens, typography! Oct 30, 2026
@shawnbot shawnbot added the major Increment the major version when merged label Oct 30, 2026
@shawnbot
shawnbot requested a balanced review from Copilot October 30, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved issues override inherited span typography, alter radio-control spacing, and misconfigure rebuild watching for theme files and package metadata.

2 open issues
What changed in this PR

This PR aligns the Fillout theme with SF.gov design tokens and centralizes typography, replacing the attempted Open Sans styling with Fillout’s system sans-serif stack.

Changes:

  • Bundles design tokens and registers them as the Tailwind theme.
  • Converts component styles to token-based @apply rules and extracts typography.
  • Renames theme to src and updates build, watch, and editor configuration.
File Description
tailwind.theme.ts Bundles design tokens and Tailwind theme definitions.
tailwind.config.ts Registers the bundled theme.
src/​typography.css Centralizes body, heading, and label typography.
src/​sfgov.css Imports typography and converts component styles to utilities.
README.md Updates the source-directory link.
postcss.config.js Resolves stylesheet imports from src.
package.json Updates build paths and watch targets.
knip.config.ts Updates entry paths for source analysis.
.vscode/​settings.json Associates CSS files with Tailwind CSS tooling.

Review effort: Balanced

Comment thread package.json Resolved
Comment thread src/typography.css
@@ -0,0 +1,31 @@
/* basics */
div, p, p::after, nav, span,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is technically true, it doesn't seem to affect Fillout's markup. There are, however, a ton of <span>s in Fillout that need to be reset. 🤷

@jackieyoungsfgov jackieyoungsfgov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@shawnbot
shawnbot merged commit 261da1a into main Nov 2, 2026
8 checks passed
@shawnbot
shawnbot deleted the feat/tokens branch November 2, 2026 23:29

This branch was successfully deployed

1 active deployment
release — 3c39f55f Deployed Oct 30, 2026 by shawnbot via release #42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major Increment the major version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants