Spacing
Learn how to use our spacing helpers to make margin and padding management easier.
Spacing Utilities
Dracula UI ships with two spacing utilities that help you define padding and margin for your websites and apps. While not required, the utility css classes and the p
and m
properties (for React components), help remove the burden of having to manage your own spacing classes, properties and variables.
Padding
The padding css utility classes and p
React property can help manage padding for your components and html elements.
Add the p
property at the top level of any Dracula UI react component for easy and type safe padding management. For HTML only websites, apply the .drac-p
css utilty classes directly into your code.
Margin
Similar to the padding helpers, the margin css utility classes and m
React property can help manage margin for your components and html elements.
Utility Classes and Properties
Here's a full list of all CSS classes and React properties.
Padding | Margin |
---|---|
.drac-p-none | .drac-m-auto |
.drac-p-xxs | .drac-m-none |
.drac-p-xs | .drac-m-xxs |
.drac-p-sm | .drac-m-xs |
.drac-p-md | .drac-m-sm |
.drac-p-lg | .drac-m-md |
.drac-px-none | .drac-m-lg |
.drac-px-xxs | .drac-mx-auto |
.drac-px-xs | .drac-mx-none |
.drac-px-sm | .drac-mx-xxs |
.drac-px-md | .drac-mx-xs |
.drac-px-lg | .drac-mx-sm |
.drac-py-none | .drac-mx-md |
.drac-py-xxs | .drac-mx-lg |
.drac-py-xs | .drac-my-auto |
.drac-py-sm | .drac-my-none |
.drac-py-md | .drac-my-xxs |
.drac-py-lg | .drac-my-xs |
.drac-pt-none | .drac-my-sm |
.drac-pt-xxs | .drac-my-md |
.drac-pt-xs | .drac-my-lg |
.drac-pt-sm | .drac-mt-auto |
.drac-pt-md | .drac-mt-none |
.drac-pt-lg | .drac-mt-xxs |
.drac-pb-none | .drac-mt-xs |
.drac-pb-xxs | .drac-mt-sm |
.drac-pb-xs | .drac-mt-md |
.drac-pb-sm | .drac-mt-lg |
.drac-pb-md | .drac-mb-auto |
.drac-pb-lg | .drac-mb-none |
.drac-pl-none | .drac-mb-xxs |
.drac-pl-xxs | .drac-mb-xs |
.drac-pl-xs | .drac-mb-sm |
.drac-pl-sm | .drac-mb-md |
.drac-pl-md | .drac-mb-lg |
.drac-pl-lg | .drac-mr-auto |
.drac-pr-none | .drac-mr-none |
.drac-pr-xxs | .drac-mr-xxs |
.drac-pr-xs | .drac-mr-xs |
.drac-pr-sm | .drac-mr-sm |
.drac-pr-md | .drac-mr-md |
.drac-pr-lg | .drac-mr-lg |
Styling with regular CSS
Regular styling with CSS, inline styles, and custom classes are still, for the cases where the Dracula UI spacing system can't cater to your needs.
Feel free to mix and match whatever styling strategy makes sense for your project.