tailwindcss-spacing

Document Tailwind CSS v4.1 spacing utilities for margin, padding, and space-between classes.

22|3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/fusengine/agents --skill tailwindcss-spacing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tailwindcss-spacing
Source: https://github.com/fusengine/agents/tree/main/plugins/tailwindcss/skills/tailwindcss-spacing
Command: npx skills add https://github.com/fusengine/agents --skill tailwindcss-spacing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to Tailwind CSS v4.1 spacing utilities, helping developers efficiently manage margins, padding, and spacing between elements.

Core Features & Use Cases

  • Margin Utilities: Covers all margin classes including m-*, mx-*, my-*, mt-*, mr-*, mb-*, ml-*, negative margins, and m-auto.
  • Padding Utilities: Details all padding classes like p-*, px-*, py-*, pt-*, pr-*, pb-*, and pl-*.
  • Space Between: Explains space-x-* and space-y-* for consistent spacing between child elements in flex or grid layouts.
  • Use Case: Quickly reference the correct Tailwind class to apply a 1rem margin to all sides of a div, or to create 4px horizontal spacing between items in a flex container.

Quick Start

Use the tailwindcss-spacing skill to find the correct class for applying 8px of padding to the left and right of an element.

Frequently Asked Questions about tailwindcss-spacing

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

FAQPage Schema
How do I apply specific margin and padding values using Tailwind CSS utility classes?

Tailwind CSS spacing utilities use classes like `m-*` for margin and `p-*` for padding to apply consistent spacing. You can target specific sides using prefixes such as `mt-*` for top margin or `px-*` for horizontal padding.

What is the difference between space-between and padding utilities in Tailwind CSS?

Tailwind CSS padding utilities control the internal spacing within an element, while space-between utilities like `space-x-*` and `space-y-*` manage the external gaps between child elements inside flex or grid layouts.

Can I use negative margins and auto spacing for responsive design in Tailwind CSS?

Yes, Tailwind CSS spacing supports negative margins to pull elements outside their normal flow and `m-auto` to center elements. These utilities integrate seamlessly with responsive prefixes for adaptive layouts.

How do I configure custom spacing values in a Tailwind CSS design system?

Tailwind CSS allows configuration of custom spacing values to extend the default design system. Developers can modify the theme configuration to define specific spacing scales that map directly to margin and padding utility classes.

Why does my space-y utility not work on flex items in Tailwind CSS?

The `space-y-*` utility targets direct children using margin, which may not apply correctly in complex flex layouts. Ensure the parent container is properly configured and that no conflicting CSS overrides are affecting the child elements.

What is the best way to add consistent horizontal spacing between flex items in Tailwind CSS?

The best way to add horizontal spacing between flex items is using the `space-x-*` utility. This applies consistent left margins to child elements, ensuring evenly distributed gaps across the container.