Skip to content
/ autobg Public

Set the width and height of elements based on the background image, supporting unocss and babel macro.

License

Notifications You must be signed in to change notification settings

pzehrel/autobg

Repository files navigation

🎨 autobg

中文

npm version

This is a CSS utility library that automatically generates background-image, width, and height styles for elements based on local image paths.

💡 Iterated from the littlee/autobg.macro

🚀 Features

  • 🖼️ Automatically generates styles that respect the original aspect ratio of images
  • 🛠️ Supports multiple integration methods:
  • 🔄 Fully compatible with webpack and vite
  • 🔗 Supports relative path image imports in unocss and vite unocss #1397
  • 📏 Supports custom style units in babel macro

📖 Usage

For detailed usage instructions, please check the corresponding documentation:

📄 License

MIT

About

Set the width and height of elements based on the background image, supporting unocss and babel macro.

Resources

License

Stars

Watchers

Forks

Packages

No packages published