saleor-dashboard-styles

Applies macaw-ui design system styling rules to Saleor Dashboard React components.

1.0k|1.2k|Updated Jun 19, 2019
One-click install
npx skills add https://github.com/saleor/saleor-dashboard --skill saleor-dashboard-styles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: saleor-dashboard-styles
Source: https://github.com/saleor/saleor-dashboard/tree/main/.claude/skills/saleor-dashboard-styles
Command: npx skills add https://github.com/saleor/saleor-dashboard --skill saleor-dashboard-styles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Styling React components in the Saleor Dashboard codebase requires choosing between Box inline props and CSS Modules, using the correct design tokens, and following established component patterns like DetailGroupBox, DetailSettingsCard, and PriceFieldV2. This Skill encodes those conventions so generated or refactored UI code matches the project's design system instead of introducing inline styles, hardcoded colors, or legacy patterns.

Core Features & Use Cases

  • Two styling strategies: Guides when to use <Box> sprinkle props from @saleor/macaw-ui-next for simple layout/spacing versus .module.css files for pseudo-selectors, animations, and media queries.
  • Design token enforcement: Directs usage of var(--mu-*) CSS variables and the vars TypeScript object instead of hardcoded colors, spacing, or borders.
  • Component pattern library: Covers foldable sections with DetailGroupBox, settings cards with DetailSettingsCard, assignable lists, channel amount lists, and PriceFieldV2 money inputs with spreadsheet paste support.
  • Use Case: When adding a new settings card to a product detail page, the Skill ensures you use DetailSettingsCard with the correct title typography, compact label rows, and token-based spacing rather than ad-hoc CSS.

Quick Start

Style this new React component for the Saleor Dashboard following the macaw-ui design system conventions.

Frequently Asked Questions about saleor-dashboard-styles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I style React components in Saleor Dashboard?

Use Box inline props from @saleor/macaw-ui-next for simple layout, spacing, and colors. Switch to a co-located .module.css file when you need pseudo-selectors, animations, media queries, or more than about five CSS rules.

When should I use Box props vs CSS Modules in macaw-ui?

Box props cover flex/grid layouts, padding, margin, gap, background colors, and border radius. CSS Modules handle hover states, keyframe animations, media queries, and nested selectors that Box sprinkles cannot express.

Can I use responsive objects for padding in macaw-ui Box?

No. Responsive objects work only for layout props like display, grid, and flex. Spacing props such as padding, margin, and gap throw a SprinklesError at runtime, so use a CSS Module media query instead.

What component should I use for money input fields in Saleor Dashboard?

Use PriceFieldV2 for all new money or amount fields. It provides right-aligned tabular numbers, currency adornments, paste normalization via formatPriceInput, and decimal padding on blur. Do not add new type="number" inputs or revive the legacy PriceField.

Why should I avoid hardcoded colors in Saleor Dashboard CSS?

Hardcoded colors break theming consistency with the macaw design system. Use var(--mu-colors-*) variables in CSS Modules or the vars object from @saleor/macaw-ui-next in TypeScript so components adapt to theme changes automatically.

What are the limitations of Box sprinkle props in macaw-ui?

Box sprinkles cannot express pseudo-selectors like ::placeholder or :hover on child elements, keyframe animations, or media queries. For arbitrary CSS values use the __ prefix escape hatch, and for complex styling use a CSS Module.