Background Size - 图1

Work in progress!

More detailed documentation is coming soon, but in the meantime here’s a quick class reference.

Class reference

Background Size - 图2

Customizing

By default Tailwind provides utilities for auto, cover, and contain background sizes. You can change, add, or remove these by editing the backgroundSize section of your config.

Background Size - 图3

Responsive and State Variants

By default, only responsive variants are generated for background size utilities.

You can control which variants are generated for the background size utilities by modifying the backgroundSize property in the modules section of your Tailwind config file.

For example, this config will also generate hover and focus variants:

Background Size - 图4

Disabling

If you don’t plan to use the background size utilities in your project, you can disable them entirely by setting the backgroundSize property to false in the modules section of your config file:

Background Size - 图5