Sizing Units logo

Sizing Units

Organization
dembrandt
sizing-units

rem, px or relative units for each kind of value. Use when defining spacing and sizing tokens, control heights or media queries, or when a layout breaks under enlarged text.

Overview

Publisherdembrandt
Repositorydembrandt-skills
Skill namesizing-units
Stars
169
Forks
21
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dembrandt on GitHub. Read the source before you install it.

Installation

Install the Sizing Units AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dembrandt/dembrandt-skills/tree/main/skills/sizing-units
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dembrandt/dembrandt-skills.git /tmp/dembrandt-skills
mkdir -p .claude/skills
cp -r /tmp/dembrandt-skills/skills/sizing-units .claude/skills/sizing-units
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sizing Units in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sizing Units on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sizing Units is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Sizing Units

The Question the Unit Answers

A unit is not a formatting preference. It is a declaration of what happens to a value when the user enlarges text.

  • rem — this value belongs to the text and must grow with it.
  • px — this value belongs to the screen and must stay put.
  • %, fr, ch, clamp(), min() — this value belongs to the available space.

Pick the unit by answering that question, not by picking a house style and applying it everywhere. Both absolutist positions — all-rem and all-px — produce defects, and they are different defects.

Zoom Is Not the Font-Size Setting

The common argument for px everywhere is that browsers already have full-page zoom, so the root font size can be ignored. They are separate controls serving separate people.

  • Full-page zoom magnifies everything, layout included. It buys larger text at the cost of horizontal scrolling and fewer items per screen.
  • The browser's default font size enlarges text and leaves the layout alone. This is what a user with low vision sets once, years ago, and never touches again. They will not switch to zoom because your product ignored it.

A product that hard-codes every dimension in px answers the first user and silently refuses the second. WCAG 2.2 SC 1.4.4 (Resize Text) requires text to reach 200% without loss of content or function, and SC 1.4.10 (Reflow) requires the page to survive it in a single column. See [[wcag-accessibility]].

Use rem For

Typography. Every font size and line height. See [[modular-scale-typography]].

Padding around text. A button's inner padding in px means large text presses against its edges. In rem the breathing room scales with the words it surrounds.

Control heights. A 40px control holding 24px text is broken. Write the height token in rem and it stays a control-shaped control at every text size. See [[component-family-consistency]].

Measure. max-width on a text column: 65ch or a rem value, never px.

Gaps between text-bearing blocks. Stack spacing in a form or an article is part of the reading rhythm.

Use px For

Hairlines and borders. 1px is one device pixel by intent. In rem it becomes 1.25px at a larger root size and renders as a blurry smear.

Shadow offsets and blur. Elevation is a screen-space effect. See [[elevation-and-depth]].

Small icons inside controls where the icon is a fixed glyph rather than text.

Sub-pixel corrections — the -1px that makes two borders overlap instead of doubling.

Use Relative Units For

Layout widths and gaps. This is where the "lock it in px so it stays stable" instinct goes wrong: a px-locked container is not stable, it is brittle. The text inside it still grows, and a fixed box is exactly what makes growing text clip.

css
/* Brittle — the box cannot absorb anything */
.card   { width: 320px; height: 180px; }
.sidebar { width: 280px; }

/* Resilient */
.card    { max-width: 20rem; min-height: 11.25rem; }
.sidebar { width: clamp(16rem, 22%, 22rem); }

min-height, never height, on anything containing text. A fixed height cannot grow; a minimum height holds the shape at rest and yields when it must.

Media Queries

Use em in media queries. Media-query rem and em both resolve against the browser's default font size, ignoring any html { font-size } you set — so em is the honest spelling, and both respect the user's preference where a px breakpoint does not. A user with a large default font size gets the layout their effective text size warrants, not the one their device width claims.

css
@media (min-width: 48em) { /* ~768px at default settings */ }

Do Not Reset the Root

css
html { font-size: 62.5%; } /* Do not do this */

The 62.5% trick exists to make rem arithmetic easy — 1.6rem for 16px. It buys you mental arithmetic and pays for it by overriding the user's stated preference by default. Keep the root at the browser default and let the tooling do the division.

A Measured Container Must Not Depend on What It Sizes

When script sizes an element from its container, the container's size must be definite and independent of that element on every breakpoint. If the container shrink-wraps the child, the measurement reads the child's own collapsed size and the element stays collapsed, silently, on the breakpoints where the chain loses its definite size. Give the chain a definite size down to the measured box and observe the box itself, not window events.

Review Checklist

  • Is every font size, line height, and text-adjacent padding in rem?
  • Are borders, hairlines, and shadow offsets in px?
  • Does any element containing text use height rather than min-height?
  • Are container widths relative (%, fr, clamp(), max-width) rather than fixed px?
  • Are media-query breakpoints in em?
  • Is html { font-size } left at the browser default?
  • At a 200% browser font-size setting, does every control still contain its label, with no clipping and no horizontal page scroll?
  • Is every script-measured container sized by layout rather than by the child it sizes?

Frequently asked questions

What does the Sizing Units AI skill do?

rem, px or relative units for each kind of value. Use when defining spacing and sizing tokens, control heights or media queries, or when a layout breaks under enlarged text.

Why use Sizing Units on TypingMind?

Because you install it once and use it with any model. Sizing Units is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sizing Units in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dembrandt/dembrandt-skills/tree/main/skills/sizing-units. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sizing Units?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sizing Units?

As many as you like. As long as a model supports skills, you can use Sizing Units with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sizing Units AI skill free?

Yes. It is published on GitHub by dembrandt under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇