Define a Semantic Design Token Scale for CSS
Generate a structured 4px/8px-based design token scale for spacing, sizing, and typography using primitive and semantic CSS custom properties.
Prompt
Act as a Senior Design Systems Engineer. Create a semantic design token system based on a 4px base unit. First, ask these 3 questions: 1. What is the primary brand font family? 2. How many distinct spacing levels do you need for your layouts? 3. Do you need specific support for high-contrast modes? Wait for the answers. Once provided, generate a CSS file containing two sections: Primitives (raw values) and Semantic tokens (usage-based). Rules: 1. Use CSS custom properties with a --prefix. 2. Group tokens by category (Spacing, Sizing, Typography). 3. Ensure all spacing follows a 4px/8px multiplier. 4. Include a comment for every token explaining its specific UI intent. Output format: Provide a single code block containing the full CSS stylesheet. This is not professional engineering advice; consult a lead architect for large-scale production implementation.Example output
Tips and common edits
Why this works
- Forces a clear separation between raw values and semantic usage.
- Ensures mathematical consistency using a 4px/8px scale.
- Categorizes tokens to make them easier to maintain in CSS files.
Use this prompt to build a design system foundation from scratch. It works best in ChatGPT, Claude, or Gemini. Paste your answers to the three questions, and the model will output a ready-to-copy CSS file for your project.
Common edits
- Add your project-specific brand color palette if you need to expand the scope.
- Adjust the multipliers if your design system uses a 6px or 10px base instead.
Make it repeatable
Keep using this prompt without pasting it in every time.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Design an Accessible Settings Page with Toggles, Segmented Controls and Sliders
A ready-to-paste prompt that builds a polished single-file settings page with custom accessible toggles, segmented controls and sliders that update a live reading preview.
Consolidate duplicate components across design libraries
Scan a messy inventory of UI components to find duplicates, confusing synonyms, and overlapping variants. Use this during design system cleanups and mergers.
Write component deprecation notices and migration paths
Produce clear deprecation notices and step-by-step replacement guides for UI components. Use this to help product teams upgrade design systems without breaking views.
Frontend Design Direction Brief So Your Coding Agent Avoids the Generic AI Look
Writes a DESIGN.md brief for a coding agent with one visual direction, concrete type, color, spacing and layout tokens, a banned list of generic AI patterns, and screenshot checks before it builds UI.
Audit mobile forms for keyboard friction
Identify mismatched mobile keyboards, missing autocomplete attributes, and form fields that slow down mobile completion.
Create Accessible Keyboard Navigation Maps for Complex Web Layouts
Generate a logical, WCAG-compliant keyboard navigation sequence for complex web components to ensure full usability for screen reader and keyboard-only users.
- Build a Responsive Three-Tier Pricing Section with Monthly/Yearly Toggle
- Build a content-first wireframe specification
- Build a five-day remote design sprint schedule
- Translate vague design feedback into actionable visual revisions
- Create a WCAG 2.2 AA Accessibility Audit Checklist
- Design a Progressive Disclosure Pattern for Complex Settings