{"_id":"@autobg/unocss","_rev":"8-6ff3d7b0da97252c775142e7bb38604f","name":"@autobg/unocss","dist-tags":{"latest":"1.5.0"},"versions":{"0.0.1":{"name":"@autobg/unocss","version":"0.0.1","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@0.0.1","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"e5f8f4c7e922858716c7178c596308ca38d3fb79","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-0.0.1.tgz","fileCount":7,"integrity":"sha512-8EqyJLeFUhV62ldYu1J1bKEdOYa79ikr/ohnOGBT6jdp0LQfENbFbnMGdP6RGXgJEoMTQsh/94ziT55fucl7cw==","signatures":[{"sig":"MEUCIAOJ+Q/z7hM5vEpeFWLRKJa+MKuvucauuuDjcoUxMZMsAiEAq5IWgoffJPjx9B+YKeDwJYc2IutLUVfA0Qsq79VpeOQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15020},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-0.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","require":"dist/index.cjs","scripts":{"build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/477aa8d728e75dcedcc2b0b5e8833810/autobg-unocss-0.0.1.tgz","_integrity":"sha512-8EqyJLeFUhV62ldYu1J1bKEdOYa79ikr/ohnOGBT6jdp0LQfENbFbnMGdP6RGXgJEoMTQsh/94ziT55fucl7cw==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"image-size":"^2.0.1","@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_0.0.1_1743088714160_0.6417344666911253","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@autobg/unocss","version":"1.0.0","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@1.0.0","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"e12bc364692e9fcb1cb8af33db7032149b83c730","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.0.0.tgz","fileCount":9,"integrity":"sha512-R97IyWa8wrGOQN1T60vIpe6y5O6ZvYR+CZYrTI5hhAiO3yfgAMXG2+zXHk2mPnPWBLL73j5WWp0miNBc3BuAoA==","signatures":[{"sig":"MEUCIFxJn4fTt04lnPt3SfHT1RA6tjmNtG82/ZA4Jz4X2oYCAiEAtayOraRS06eiF0c1+YRmVf5X6MsZlF0qXT1eUcs+4wg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19153},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-1.0.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","require":"dist/index.cjs","scripts":{"stub":"unbuild --stub","build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/3b87cb24fe8fef981dbb1206cbfb3963/autobg-unocss-1.0.0.tgz","_integrity":"sha512-R97IyWa8wrGOQN1T60vIpe6y5O6ZvYR+CZYrTI5hhAiO3yfgAMXG2+zXHk2mPnPWBLL73j5WWp0miNBc3BuAoA==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"image-size":"^2.0.1","@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_1.0.0_1743142521144_0.801615911127703","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@autobg/unocss","version":"1.0.1","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@1.0.1","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"89cab242297843c8d5e1913f5642020ca0761665","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.0.1.tgz","fileCount":9,"integrity":"sha512-NOvPmfZUHz5zxiR/Rgam6psVb0hX1i2IS7QHywRqy3igE/HwtHuUVM41hLSzMbo/rWc76ggS+Als4Wz39GuJiQ==","signatures":[{"sig":"MEUCIA1nPVYKH3Vz3tZkSR0j0y9OfgkTq9Ip1rRfZ4fjafPoAiEAryvQe1oLXm3VQ5xJR6YFwdv3Z9/vj/FbSnkSWE36wkg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":18643},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-1.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","require":"dist/index.cjs","scripts":{"stub":"unbuild --stub","build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/0ee09b81033a6bc208b0ed26a17c8793/autobg-unocss-1.0.1.tgz","_integrity":"sha512-NOvPmfZUHz5zxiR/Rgam6psVb0hX1i2IS7QHywRqy3igE/HwtHuUVM41hLSzMbo/rWc76ggS+Als4Wz39GuJiQ==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"image-size":"^2.0.1","@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_1.0.1_1743152514786_0.7545890475484502","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@autobg/unocss","version":"1.1.0","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@1.1.0","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"1c77e4a4f32c6d06f49f36afd589f9adec72706a","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.1.0.tgz","fileCount":9,"integrity":"sha512-OOroh3mXjLVSr+R7Bak7lIWQlJveUAS/oiOA6hGxtVH47AT/SEVPuje/dKHQtpX848uuDHftGigOhS+mnTrM8A==","signatures":[{"sig":"MEUCIQCMbvYqZwzMWC8WE/J3aAI7A9x01u64N6JTxxPpHOAUBAIgWcpcs/6Gvytk03kdVFE/DHbIfpGfU1ghJBqcb+OX5VI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":17098},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-1.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","require":"dist/index.cjs","scripts":{"stub":"unbuild --stub","build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/459b03b101bd7c40ef60ae9537998668/autobg-unocss-1.1.0.tgz","_integrity":"sha512-OOroh3mXjLVSr+R7Bak7lIWQlJveUAS/oiOA6hGxtVH47AT/SEVPuje/dKHQtpX848uuDHftGigOhS+mnTrM8A==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"image-size":"^2.0.1","@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_1.1.0_1743487817665_0.5874256546232319","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@autobg/unocss","version":"1.2.0","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@1.2.0","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"9563ceb6d3a5fe81e73258f903aa3302b6ea69f7","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.2.0.tgz","fileCount":9,"integrity":"sha512-qqp4uugtWg7gdvEExOD1rdYc3W2r0azZTCs92ta9oefkmxJJxF6Yi7UgZn/qmrLnM3JxkFCdP6hRhquVTSI94g==","signatures":[{"sig":"MEYCIQClbMzHUoO3+xNIl+BjZ3CVWMr6ZL906z/NYhNk4CfNFQIhAPzUWr4eTBfMF9AmVwNdElwM+PvRwpA4EkcCHzZZwPHH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19154},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-1.2.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"require":"dist/index.cjs","scripts":{"stub":"unbuild --stub","build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/f67948ff589d50f293f5e8ea8f46338b/autobg-unocss-1.2.0.tgz","_integrity":"sha512-qqp4uugtWg7gdvEExOD1rdYc3W2r0azZTCs92ta9oefkmxJJxF6Yi7UgZn/qmrLnM3JxkFCdP6hRhquVTSI94g==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"devDependencies":{"image-size":"^2.0.1"},"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_1.2.0_1744033992574_0.2502272024980623","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@autobg/unocss","version":"1.3.0","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@1.3.0","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"603d19f1c2f3f22aaedea52a7f45760a4e4b43c2","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.3.0.tgz","fileCount":9,"integrity":"sha512-AhrQwJN1uufXZT2SP7usQUiD7B/9/gsttOd+XSn8aaTi/qJ22qYSTXHppP5vSeiA46YPAr9BmNB+MlD06pavGQ==","signatures":[{"sig":"MEUCIQCyrw+ad7DyLGV7ofx5yDAbt2h2/ncFWS6uX+3O8CuQwQIgKngEgTLh1sbCKb2Fnll85l1g9sQmeHRTgj/4IIt0v7c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21540},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-1.3.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"require":"dist/index.cjs","scripts":{"stub":"unbuild --stub","build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/0cab120d18a9452e0ba9847cc7bb69bf/autobg-unocss-1.3.0.tgz","_integrity":"sha512-AhrQwJN1uufXZT2SP7usQUiD7B/9/gsttOd+XSn8aaTi/qJ22qYSTXHppP5vSeiA46YPAr9BmNB+MlD06pavGQ==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"devDependencies":{"image-size":"^2.0.1"},"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_1.3.0_1744443567662_0.7927653714124849","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@autobg/unocss","version":"1.4.0","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"author":{"url":"https://github.com/pzehrel","name":"pzehrel","email":"pzehrel@gmail.com"},"license":"MIT","_id":"@autobg/unocss@1.4.0","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"dist":{"shasum":"abd5addb863912aa42e3c44dd5dd2d5eb6837823","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.4.0.tgz","fileCount":9,"integrity":"sha512-9InlXqu/rTj5dYmIOSua6muaslBuf7PUjP5Tag/J/JCUqSYzLsFEg8PqH0NEhmUbucSX8arIy07I7jpTN77UVw==","signatures":[{"sig":"MEUCICCsGIi/qGzB8UxUUOJkOewC5lpn1jvu1f446zan13FPAiEAkfAGQO5WJOtNBbtrsqd7zWn8xFBqgsSb8M5uQ6qqKyQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26347},"main":"dist/index.mjs","type":"module","_from":"file:autobg-unocss-1.4.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"require":"dist/index.cjs","scripts":{"stub":"unbuild --stub","build":"unbuild"},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"_resolved":"/tmp/c1655d8f304733a1012160664604343e/autobg-unocss-1.4.0.tgz","_integrity":"sha512-9InlXqu/rTj5dYmIOSua6muaslBuf7PUjP5Tag/J/JCUqSYzLsFEg8PqH0NEhmUbucSX8arIy07I7jpTN77UVw==","repository":{"url":"git+https://github.com/pzehrel/autobg.git","type":"git","directory":"packages/unocss"},"_npmVersion":"10.9.2","description":"Set the width and height of elements based on the background image","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@unocss/core":"^66.0.0"},"_hasShrinkwrap":false,"devDependencies":{"image-size":"^2.0.1"},"peerDependencies":{"image-size":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/unocss_1.4.0_1744525364188_0.27094039812935944","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@autobg/unocss","type":"module","version":"1.5.0","description":"Set the width and height of elements based on the background image","author":{"name":"pzehrel","email":"pzehrel@gmail.com","url":"https://github.com/pzehrel"},"license":"MIT","homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","repository":{"type":"git","url":"git+https://github.com/pzehrel/autobg.git","directory":"packages/unocss"},"bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"dist/index.mjs","module":"dist/index.mjs","require":"dist/index.cjs","types":"dist/index.d.ts","peerDependencies":{"image-size":"^2.0.1","pathe":"^2.0.3"},"dependencies":{"@unocss/core":"^66.0.0"},"devDependencies":{"image-size":"^2.0.1","pathe":"^2.0.3"},"scripts":{"build":"unbuild","stub":"unbuild --stub"},"_id":"@autobg/unocss@1.5.0","_integrity":"sha512-WKWxu/0gzoAyGNofqgnBdegQ+3SC61/ziXBgDs1Hg0nHO3sxD9oT92le6I3sBildCgD9vwUteOf08YTbgbAikA==","_resolved":"/tmp/e84ac2c5f0f689827600da7bec4f35fd/autobg-unocss-1.5.0.tgz","_from":"file:autobg-unocss-1.5.0.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-WKWxu/0gzoAyGNofqgnBdegQ+3SC61/ziXBgDs1Hg0nHO3sxD9oT92le6I3sBildCgD9vwUteOf08YTbgbAikA==","shasum":"ea0f1d4929a82f961003b8cb0e91aeca6cb55fd8","tarball":"https://registry.npmjs.org/@autobg/unocss/-/unocss-1.5.0.tgz","fileCount":9,"unpackedSize":39770,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autobg%2funocss@1.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDWPErxmDeVi9t+MkQQuVr9ZvDLOAW4pcIZRBBsfAHdIwIhALjJFCsysbBJJzgbY9YuMIXFmvueAs68szDNKDMY9hNj"}]},"_npmUser":{"name":"pzehrel","email":"pzehrel@gmail.com"},"directories":{},"maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/unocss_1.5.0_1744967948039_0.2204425608155034"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-27T15:18:34.043Z","modified":"2025-04-18T09:19:08.621Z","0.0.1":"2025-03-27T15:18:34.340Z","1.0.0":"2025-03-28T06:15:21.333Z","1.0.1":"2025-03-28T09:01:54.964Z","1.1.0":"2025-04-01T06:10:17.857Z","1.2.0":"2025-04-07T13:53:12.757Z","1.3.0":"2025-04-12T07:39:27.842Z","1.4.0":"2025-04-13T06:22:44.387Z","1.5.0":"2025-04-18T09:19:08.244Z"},"bugs":{"url":"https://github.com/pzehrel/autobg/issues"},"author":{"name":"pzehrel","email":"pzehrel@gmail.com","url":"https://github.com/pzehrel"},"license":"MIT","homepage":"https://github.com/pzehrel/autobg/tree/main/packages/unocss","keywords":["autobg","babel","macro","background","image","unocss","unocss-preset-autobg","unocss-preset"],"repository":{"type":"git","url":"git+https://github.com/pzehrel/autobg.git","directory":"packages/unocss"},"description":"Set the width and height of elements based on the background image","maintainers":[{"name":"pzehrel","email":"pzehrel@gmail.com"}],"readme":"# 🎨 @autobg/unocss\n\n[![npm version](https://img.shields.io/npm/v/@autobg/unocss.svg?style=flat)](https://www.npmjs.com/package/@autobg/unocss)\n[![npm downloads](https://img.shields.io/npm/dm/@autobg/unocss.svg?style=flat)](https://www.npmjs.com/package/@autobg/unocss)\n\n> 能够根据本地图片路径为元素生成完整的背景图和宽高样式的 UnoCSS 预设。\n\n## ✨ 核心特性\n\n- 🚀 **完美支持** Vite 构建工具\n- 🔄 **智能识别** 图片尺寸并自动应用\n- 📍 **灵活支持** 相对路径和路径别名\n- 🎨 **无缝集成** UnoCSS 生态系统\n- 📐 **多种模式** 提供灵活的缩放选项\n\n> ⚠️ **注意**：暂不支持 `unocss@66.1.0` 版本，该版本处于 beta 阶段，preset 机制有所变化。\n\n## 📦 安装\n\n```bash\npnpm add @autobg/unocss\n```\n\n## ⚙️ 配置\n\n### Vite 项目\n\n```ts\n// uno.config.ts\nimport { autobgPreset } from '@autobg/unocss'\nimport { defineConfig } from 'unocss'\n\nexport default defineConfig({\n  presets: [\n    autobgPreset({\n      // 使用绝对路径，而不是 process.cwd()。\n      // 因为 VSCode 的 unocss 扩展在调用 preset 的 transformer 时不会传递项目根目录路径。\n      // 这会导致代码高亮工具提示不正确，但不会影响实际的类名生成。\n      root: import.meta.env.dirname,\n\n      // 转换 width 和 height 的值，可以为其添加样式单位\n      // 默认会转换为 `px` 单位\n      // 这只是一个临时方案，未来可能会废弃\n      transformSize: value => `${value}px`,\n    }),\n  ],\n})\n```\n\n### Webpack 支持说明\n\n目前暂不支持 Webpack，主要原因：\n\n- Webpack 的 transformer 处理机制导致路径无法正确替换\n- UnoCSS 官方的 `bg-[url()]` 规则在 Webpack 环境中同样存在兼容性问题\n\n## 🎯 使用指南\n\n### 基础用法\n\n轻松指定背景图片路径：\n\n```tsx\n<div className=\"autobg-['url(/foo.png)']\" />\n<div className=\"autobg-['url(@/assets/foo.png)']\" />\n<div className=\"autobg-['url(../assets/foo.png)']\" />\n```\n\n### 等比缩放\n\n#### 固定宽度或高度\n\n指定一个维度，另一个维度将按原图比例自动计算：\n\n```tsx\n// 指定宽度\n<div className=\"autobg-['url(/foo.png)']-w200\" />\n\n// 使用分隔符连接数值\n<div className=\"autobg-['url(/foo.png)']-w-200\" />\n\n// 指定高度\n<div className=\"autobg-['url(/foo.png)']-h200\" />\n\n// 使用分隔符连接数值\n<div className=\"autobg-['url(/foo.png)']-h-200\" />\n```\n\n> 💡 **提示**：暂不支持样式单位（如 `px`、`rem` 等），这会导致缩放比例无法正确计算。\n> 特别注意 `w-200` 中的 `-` 仅作为分隔符，不表示负值。\n\n#### 百分比缩放\n\n使用百分比值控制缩放比例：\n\n```tsx\n// 宽度百分比\n<div className=\"autobg-['url(/foo.png)']-w78%\" />\n\n// 高度百分比\n<div className=\"autobg-['url(/foo.png)']-h78%\" />\n```\n\n> 💡 **提示**：百分比必须以 `%` 结尾，否则将被视为普通数值。\n\n#### 整体缩放比例\n\n不指定具体维度时，将按整体比例均匀调整：\n\n```tsx\n// 小数形式（0.78倍缩放）\n<div className=\"autobg-['url(/foo.png)']-0.78\" />\n\n// 百分比形式（缩放至78%）\n<div className=\"autobg-['url(/foo.png)']-78%\" />\n```\n\n### 使用 aspect-ratio 属性\n\n利用现代 CSS 的 [aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) 属性保持元素宽高比，实现更灵活的布局控制。\n\n特别适用于需要响应式缩放的场景，当父元素尺寸动态变化时尤为有效：\n\n```tsx\n// 父元素高度可能会动态变化\n<div className=\"h200\">\n  {/* 子元素会自动保持图片原始宽高比并适应父元素 */}\n  <div className=\"autobg-aspect-['url(/foo.png)']-h\"></div>\n</div>\n```\n\n当父元素的高度发生变化时，子元素会自动保持原始图片的宽高比例，实现等比例缩放。\n\n#### 基础用法\n\n不指定宽高时，仅生成背景和宽高比：\n\n```tsx\n<div className=\"autobg-aspect-['url(/foo.png)']\" />\n```\n\n#### 📐 指定生成宽度或高度\n\n自动生成一个维度的值（默认100%）：\n\n```tsx\n// 生成高度，保持原图宽高比\n<div className=\"autobg-aspect-['url(/foo.png)']-h\" />\n\n// 生成宽度，保持原图宽高比\n<div className=\"autobg-aspect-['url(/foo.png)']-w\" />\n```\n\n#### 自定义比例\n\n设置宽高：\n\n```tsx\n<div className=\"autobg-aspect-['url(/foo.png)']-h78%\" />\n<div className=\"autobg-aspect-['url(/foo.png)']-h78\" />\n<div className=\"autobg-aspect-['url(/foo.png)']-h78rem\" />\n\n<div className=\"autobg-aspect-['url(/foo.png)']-w78%\" />\n<div className=\"autobg-aspect-['url(/foo.png)']-w78\" />\n<div className=\"autobg-aspect-['url(/foo.png)']-w78rem\" />\n```\n\n> 💡 **提示**：在 aspect 模式下，值会直接设置到 width 或 height 属性上，不会经过转换。\n\n## 📋 规则总览\n\n| 选项                | 语法                                 | 功能描述                                                       |\n| ------------------- | ------------------------------------ | -------------------------------------------------------------- |\n| 宽度缩放            | `autobg-['url(...)']-w{数值}`        | 固定宽度，高度按比例自动计算（数值表示像素值）                 |\n| 高度缩放            | `autobg-['url(...)']-h{数值}`        | 固定高度，宽度按比例自动计算（数值表示像素值）                 |\n| 整体缩放            | `autobg-['url(...)']-{数值或百分比}` | 按比例统一缩放两个维度（数值表示百分小数，百分比表示缩放比例） |\n| 宽高比模式-宽度     | `autobg-aspect-['url(...)']-w`       | 生成宽度并设置 aspect-ratio，保持原图宽高比                    |\n| 宽高比模式-高度     | `autobg-aspect-['url(...)']-h`       | 生成高度并设置 aspect-ratio，保持原图宽高比                    |\n| 宽高比模式-自定义宽 | `autobg-aspect-['url(...)']-w{数值}` | 设置宽度为指定比例并保持原图宽高比                             |\n| 宽高比模式-自定义高 | `autobg-aspect-['url(...)']-h{数值}` | 设置高度为指定比例并保持原图宽高比                             |\n\n## ⚙️ 配置项详解\n\n| 配置项        | 类型                                 | 默认值                                         | 说明                                                                          |\n| ------------- | ------------------------------------ | ---------------------------------------------- | ----------------------------------------------------------------------------- |\n| publicPath    | `string`                             | `'public'`                                     | public 目录路径，需与构建工具配置保持一致                                     |\n| alias         | `Record<string, string>`             | `{ '@/': 'src/', '~': 'src/', '~@/': 'src/' }` | 路径别名配置，需与构建工具配置保持一致<br>若不使用路径别名，请传入空对象 `{}` |\n| root          | `string`                             | `undefined`                                    | 项目根目录路径<br>若不提供，将无法在 VSCode unocss 扩展中正确预览样式类       |\n| transformSize | `(size: number) => string \\| number` | `undefined`                                    | 转换 width 和 height 的值，可以为其添加样式单位                               |\n\n## 📄 许可证\n\nMIT\n","readmeFilename":"README.zh-CN.md"}