diff --git a/package.json b/package.json index 1e5df4f1..bc765c18 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,9 @@ "@types/react": "^18.3.12", "@types/three": "^0.169.0", "cross-env": "^7.0.3", + "cssnano": "^7.0.6", "lefthook": "^1.8.2", + "postcss-combine-duplicated-selectors": "^10.0.3", "postcss-extend": "^1.0.5", "postcss-flexbugs-fixes": "^5.0.2", "postcss-functions": "^4.0.2", @@ -69,6 +71,7 @@ "postcss-include-media": "^1.1.1", "postcss-nesting": "^13.0.1", "postcss-preset-env": "^10.1.0", + "postcss-sort-media-queries": "^5.2.0", "storybook": "^8.4.2", "typescript": "^5.6.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c350a32a..4a868b59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -141,9 +141,15 @@ importers: cross-env: specifier: ^7.0.3 version: 7.0.3 + cssnano: + specifier: ^7.0.6 + version: 7.0.6(postcss@8.4.48) lefthook: specifier: ^1.8.2 version: 1.8.2 + postcss-combine-duplicated-selectors: + specifier: ^10.0.3 + version: 10.0.3(postcss@8.4.48) postcss-extend: specifier: ^1.0.5 version: 1.0.5 @@ -165,6 +171,9 @@ importers: postcss-preset-env: specifier: ^10.1.0 version: 10.1.0(postcss@8.4.48) + postcss-sort-media-queries: + specifier: ^5.2.0 + version: 5.2.0(postcss@8.4.48) storybook: specifier: ^8.4.2 version: 8.4.2(prettier@3.3.3) @@ -2918,6 +2927,9 @@ packages: peerDependencies: three: '>=0.126.1' + caniuse-api@3.0.0: + resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} + caniuse-lite@1.0.30001680: resolution: {integrity: sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==} @@ -3000,6 +3012,9 @@ packages: resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} engines: {node: '>=12.5.0'} + colord@2.9.3: + resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} + colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -3101,6 +3116,12 @@ packages: peerDependencies: postcss: ^8.4 + css-declaration-sorter@7.2.0: + resolution: {integrity: sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==} + engines: {node: ^14 || ^16 || >=18} + peerDependencies: + postcss: ^8.0.9 + css-has-pseudo@7.0.1: resolution: {integrity: sha512-EOcoyJt+OsuKfCADgLT7gADZI5jMzIe/AeI6MeAYKiFBDmNmM7kk46DtSfMj5AohUJisqVzopBpnQTlvbyaBWg==} engines: {node: '>=18'} @@ -3161,6 +3182,24 @@ packages: engines: {node: '>=4'} hasBin: true + cssnano-preset-default@7.0.6: + resolution: {integrity: sha512-ZzrgYupYxEvdGGuqL+JKOY70s7+saoNlHSCK/OGn1vB2pQK8KSET8jvenzItcY+kA7NoWvfbb/YhlzuzNKjOhQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + cssnano-utils@5.0.0: + resolution: {integrity: sha512-Uij0Xdxc24L6SirFr25MlwC2rCFX6scyUmuKpzI+JQ7cyqDEwD42fJ0xfB3yLfOnRDU5LKGgjQ9FA6LYh76GWQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + cssnano@7.0.6: + resolution: {integrity: sha512-54woqx8SCbp8HwvNZYn68ZFAepuouZW4lTwiMVnBErM3VkO7/Sd4oTOt3Zz3bPx3kxQ36aISppyXj2Md4lg8bw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + csso@5.0.5: resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} @@ -3846,6 +3885,10 @@ packages: lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + engines: {node: '>=14'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -3882,9 +3925,15 @@ packages: lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -4224,6 +4273,12 @@ packages: peerDependencies: postcss: ^8.4 + postcss-calc@10.0.2: + resolution: {integrity: sha512-DT/Wwm6fCKgpYVI7ZEWuPJ4az8hiEHtCUeYjZXqU7Ou4QqYh1Df2yCQ7Ca6N7xqKPFkxN3fhf+u9KSoOCJNAjg==} + engines: {node: ^18.12 || ^20.9 || >=22.0} + peerDependencies: + postcss: ^8.4.38 + postcss-clamp@4.1.0: resolution: {integrity: sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==} engines: {node: '>=7.6.0'} @@ -4248,6 +4303,24 @@ packages: peerDependencies: postcss: ^8.4 + postcss-colormin@7.0.2: + resolution: {integrity: sha512-YntRXNngcvEvDbEjTdRWGU606eZvB5prmHG4BF0yLmVpamXbpsRJzevyy6MZVyuecgzI2AWAlvFi8DAeCqwpvA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-combine-duplicated-selectors@10.0.3: + resolution: {integrity: sha512-IP0BmwFloCskv7DV7xqvzDXqMHpwdczJa6ZvIW8abgHdcIHs9mCJX2ltFhu3EwA51ozp13DByng30+Ke+eIExA==} + engines: {node: ^10.0.0 || ^12.0.0 || >=14.0.0} + peerDependencies: + postcss: ^8.1.0 + + postcss-convert-values@7.0.4: + resolution: {integrity: sha512-e2LSXPqEHVW6aoGbjV9RsSSNDO3A0rZLCBxN24zvxF25WknMPpX8Dm9UxxThyEbaytzggRuZxaGXqaOhxQ514Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-custom-media@11.0.5: resolution: {integrity: sha512-SQHhayVNgDvSAdX9NQ/ygcDQGEY+aSF4b/96z7QUX6mqL5yl/JgG/DywcF6fW9XbnCRE+aVYk+9/nqGuzOPWeQ==} engines: {node: '>=18'} @@ -4272,6 +4345,30 @@ packages: peerDependencies: postcss: ^8.4 + postcss-discard-comments@7.0.3: + resolution: {integrity: sha512-q6fjd4WU4afNhWOA2WltHgCbkRhZPgQe7cXF74fuVB/ge4QbM9HEaOIzGSiMvM+g/cOsNAUGdf2JDzqA2F8iLA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-duplicates@7.0.1: + resolution: {integrity: sha512-oZA+v8Jkpu1ct/xbbrntHRsfLGuzoP+cpt0nJe5ED2FQF8n8bJtn7Bo28jSmBYwqgqnqkuSXJfSUEE7if4nClQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-empty@7.0.0: + resolution: {integrity: sha512-e+QzoReTZ8IAwhnSdp/++7gBZ/F+nBq9y6PomfwORfP7q9nBpK5AMP64kOt0bA+lShBFbBDcgpJ3X4etHg4lzA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-overridden@7.0.0: + resolution: {integrity: sha512-GmNAzx88u3k2+sBTZrJSDauR0ccpE24omTQCVmaTTZFz1du6AasspjaUPMJ2ud4RslZpoFKyf+6MSPETLojc6w==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-double-position-gradients@6.0.0: resolution: {integrity: sha512-JkIGah3RVbdSEIrcobqj4Gzq0h53GG4uqDPsho88SgY84WnpkTpI0k50MFK/sX7XqVisZ6OqUfFnoUO6m1WWdg==} engines: {node: '>=18'} @@ -4357,6 +4454,42 @@ packages: peerDependencies: postcss: ^8.4 + postcss-merge-longhand@7.0.4: + resolution: {integrity: sha512-zer1KoZA54Q8RVHKOY5vMke0cCdNxMP3KBfDerjH/BYHh4nCIh+1Yy0t1pAEQF18ac/4z3OFclO+ZVH8azjR4A==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-merge-rules@7.0.4: + resolution: {integrity: sha512-ZsaamiMVu7uBYsIdGtKJ64PkcQt6Pcpep/uO90EpLS3dxJi6OXamIobTYcImyXGoW0Wpugh7DSD3XzxZS9JCPg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-font-values@7.0.0: + resolution: {integrity: sha512-2ckkZtgT0zG8SMc5aoNwtm5234eUx1GGFJKf2b1bSp8UflqaeFzR50lid4PfqVI9NtGqJ2J4Y7fwvnP/u1cQog==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-gradients@7.0.0: + resolution: {integrity: sha512-pdUIIdj/C93ryCHew0UgBnL2DtUS3hfFa5XtERrs4x+hmpMYGhbzo6l/Ir5de41O0GaKVpK1ZbDNXSY6GkXvtg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-params@7.0.2: + resolution: {integrity: sha512-nyqVLu4MFl9df32zTsdcLqCFfE/z2+f8GE1KHPxWOAmegSo6lpV2GNy5XQvrzwbLmiU7d+fYay4cwto1oNdAaQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-selectors@7.0.4: + resolution: {integrity: sha512-JG55VADcNb4xFCf75hXkzc1rNeURhlo7ugf6JjiiKRfMsKlDzN9CXHZDyiG6x/zGchpjQS+UAgb1d4nqXqOpmA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-modules-extract-imports@3.1.0: resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} engines: {node: ^10 || ^12 || >= 14} @@ -4387,12 +4520,72 @@ packages: peerDependencies: postcss: ^8.4 + postcss-normalize-charset@7.0.0: + resolution: {integrity: sha512-ABisNUXMeZeDNzCQxPxBCkXexvBrUHV+p7/BXOY+ulxkcjUZO0cp8ekGBwvIh2LbCwnWbyMPNJVtBSdyhM2zYQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-display-values@7.0.0: + resolution: {integrity: sha512-lnFZzNPeDf5uGMPYgGOw7v0BfB45+irSRz9gHQStdkkhiM0gTfvWkWB5BMxpn0OqgOQuZG/mRlZyJxp0EImr2Q==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-positions@7.0.0: + resolution: {integrity: sha512-I0yt8wX529UKIGs2y/9Ybs2CelSvItfmvg/DBIjTnoUSrPxSV7Z0yZ8ShSVtKNaV/wAY+m7bgtyVQLhB00A1NQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-repeat-style@7.0.0: + resolution: {integrity: sha512-o3uSGYH+2q30ieM3ppu9GTjSXIzOrRdCUn8UOMGNw7Af61bmurHTWI87hRybrP6xDHvOe5WlAj3XzN6vEO8jLw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-string@7.0.0: + resolution: {integrity: sha512-w/qzL212DFVOpMy3UGyxrND+Kb0fvCiBBujiaONIihq7VvtC7bswjWgKQU/w4VcRyDD8gpfqUiBQ4DUOwEJ6Qg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-timing-functions@7.0.0: + resolution: {integrity: sha512-tNgw3YV0LYoRwg43N3lTe3AEWZ66W7Dh7lVEpJbHoKOuHc1sLrzMLMFjP8SNULHaykzsonUEDbKedv8C+7ej6g==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-unicode@7.0.2: + resolution: {integrity: sha512-ztisabK5C/+ZWBdYC+Y9JCkp3M9qBv/XFvDtSw0d/XwfT3UaKeW/YTm/MD/QrPNxuecia46vkfEhewjwcYFjkg==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-url@7.0.0: + resolution: {integrity: sha512-+d7+PpE+jyPX1hDQZYG+NaFD+Nd2ris6r8fPTBAjE8z/U41n/bib3vze8x7rKs5H1uEw5ppe9IojewouHk0klQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-whitespace@7.0.0: + resolution: {integrity: sha512-37/toN4wwZErqohedXYqWgvcHUGlT8O/m2jVkAfAe9Bd4MzRqlBmXrJRePH0e9Wgnz2X7KymTgTOaaFizQe3AQ==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-opacity-percentage@3.0.0: resolution: {integrity: sha512-K6HGVzyxUxd/VgZdX04DCtdwWJ4NGLG212US4/LA1TLAbHgmAsTWVR86o+gGIbFtnTkfOpb9sCRBx8K7HO66qQ==} engines: {node: '>=18'} peerDependencies: postcss: ^8.4 + postcss-ordered-values@7.0.1: + resolution: {integrity: sha512-irWScWRL6nRzYmBOXReIKch75RRhNS86UPUAxXdmW/l0FcAsg0lvAXQCby/1lymxn/o0gVa6Rv/0f03eJOwHxw==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-overflow-shorthand@6.0.0: resolution: {integrity: sha512-BdDl/AbVkDjoTofzDQnwDdm/Ym6oS9KgmO7Gr+LHYjNWJ6ExORe4+3pcLQsLA9gIROMkiGVjjwZNoL/mpXHd5Q==} engines: {node: '>=18'} @@ -4422,6 +4615,18 @@ packages: peerDependencies: postcss: ^8.4 + postcss-reduce-initial@7.0.2: + resolution: {integrity: sha512-pOnu9zqQww7dEKf62Nuju6JgsW2V0KRNBHxeKohU+JkHd/GAH5uvoObqFLqkeB2n20mr6yrlWDvo5UBU5GnkfA==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-reduce-transforms@7.0.0: + resolution: {integrity: sha512-pnt1HKKZ07/idH8cpATX/ujMbtOGhUfE+m8gbqwJE05aTaNw8gbo34a2e3if0xc0dlu75sUOiqvwCGY3fzOHew==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-replace-overflow-wrap@4.0.0: resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} peerDependencies: @@ -4441,6 +4646,24 @@ packages: resolution: {integrity: sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ==} engines: {node: '>=4'} + postcss-sort-media-queries@5.2.0: + resolution: {integrity: sha512-AZ5fDMLD8SldlAYlvi8NIqo0+Z8xnXU2ia0jxmuhxAU+Lqt9K+AlmLNJ/zWEnE9x+Zx3qL3+1K20ATgNOr3fAA==} + engines: {node: '>=14.0.0'} + peerDependencies: + postcss: ^8.4.23 + + postcss-svgo@7.0.1: + resolution: {integrity: sha512-0WBUlSL4lhD9rA5k1e5D8EN5wCEyZD6HJk0jIvRxl+FDVOMlJ7DePHYWGGVc5QRqrJ3/06FTXM0bxjmJpmTPSA==} + engines: {node: ^18.12.0 || ^20.9.0 || >= 18} + peerDependencies: + postcss: ^8.4.31 + + postcss-unique-selectors@7.0.3: + resolution: {integrity: sha512-J+58u5Ic5T1QjP/LDV9g3Cx4CNOgB5vz+kM6+OxHHhFACdcDeKhBXjQmB7fnIZM12YSTvsL0Opwco83DmacW2g==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} @@ -4801,6 +5024,10 @@ packages: snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} + sort-css-media-queries@2.2.0: + resolution: {integrity: sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==} + engines: {node: '>= 6.3.0'} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -4929,6 +5156,12 @@ packages: babel-plugin-macros: optional: true + stylehacks@7.0.4: + resolution: {integrity: sha512-i4zfNrGMt9SB4xRK9L83rlsFCgdGANfeDAYacO1pkqcE7cRHPdWHwnKZVz7WY17Veq/FvyYsRAU++Ga+qDFIww==} + engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} + peerDependencies: + postcss: ^8.4.31 + stylis@4.3.4: resolution: {integrity: sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now==} @@ -8847,6 +9080,13 @@ snapshots: dependencies: three: 0.170.0 + caniuse-api@3.0.0: + dependencies: + browserslist: 4.24.2 + caniuse-lite: 1.0.30001680 + lodash.memoize: 4.1.2 + lodash.uniq: 4.5.0 + caniuse-lite@1.0.30001680: {} case-sensitive-paths-webpack-plugin@2.4.0: {} @@ -8933,6 +9173,8 @@ snapshots: color-string: 1.9.1 optional: true + colord@2.9.3: {} + colorette@2.0.20: {} combined-stream@1.0.8: @@ -9049,6 +9291,10 @@ snapshots: postcss: 8.4.48 postcss-selector-parser: 7.0.0 + css-declaration-sorter@7.2.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + css-has-pseudo@7.0.1(postcss@8.4.48): dependencies: '@csstools/selector-specificity': 5.0.0(postcss-selector-parser@7.0.0) @@ -9116,6 +9362,50 @@ snapshots: cssesc@3.0.0: {} + cssnano-preset-default@7.0.6(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + css-declaration-sorter: 7.2.0(postcss@8.4.48) + cssnano-utils: 5.0.0(postcss@8.4.48) + postcss: 8.4.48 + postcss-calc: 10.0.2(postcss@8.4.48) + postcss-colormin: 7.0.2(postcss@8.4.48) + postcss-convert-values: 7.0.4(postcss@8.4.48) + postcss-discard-comments: 7.0.3(postcss@8.4.48) + postcss-discard-duplicates: 7.0.1(postcss@8.4.48) + postcss-discard-empty: 7.0.0(postcss@8.4.48) + postcss-discard-overridden: 7.0.0(postcss@8.4.48) + postcss-merge-longhand: 7.0.4(postcss@8.4.48) + postcss-merge-rules: 7.0.4(postcss@8.4.48) + postcss-minify-font-values: 7.0.0(postcss@8.4.48) + postcss-minify-gradients: 7.0.0(postcss@8.4.48) + postcss-minify-params: 7.0.2(postcss@8.4.48) + postcss-minify-selectors: 7.0.4(postcss@8.4.48) + postcss-normalize-charset: 7.0.0(postcss@8.4.48) + postcss-normalize-display-values: 7.0.0(postcss@8.4.48) + postcss-normalize-positions: 7.0.0(postcss@8.4.48) + postcss-normalize-repeat-style: 7.0.0(postcss@8.4.48) + postcss-normalize-string: 7.0.0(postcss@8.4.48) + postcss-normalize-timing-functions: 7.0.0(postcss@8.4.48) + postcss-normalize-unicode: 7.0.2(postcss@8.4.48) + postcss-normalize-url: 7.0.0(postcss@8.4.48) + postcss-normalize-whitespace: 7.0.0(postcss@8.4.48) + postcss-ordered-values: 7.0.1(postcss@8.4.48) + postcss-reduce-initial: 7.0.2(postcss@8.4.48) + postcss-reduce-transforms: 7.0.0(postcss@8.4.48) + postcss-svgo: 7.0.1(postcss@8.4.48) + postcss-unique-selectors: 7.0.3(postcss@8.4.48) + + cssnano-utils@5.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + + cssnano@7.0.6(postcss@8.4.48): + dependencies: + cssnano-preset-default: 7.0.6(postcss@8.4.48) + lilconfig: 3.1.2 + postcss: 8.4.48 + csso@5.0.5: dependencies: css-tree: 2.2.1 @@ -9773,6 +10063,8 @@ snapshots: dependencies: immediate: 3.0.6 + lilconfig@3.1.2: {} + lines-and-columns@1.2.4: {} loader-runner@4.3.0: {} @@ -9803,8 +10095,12 @@ snapshots: lodash.get@4.4.2: {} + lodash.memoize@4.1.2: {} + lodash.merge@4.6.2: {} + lodash.uniq@4.5.0: {} + lodash@4.17.21: {} loose-envify@1.4.0: @@ -10144,6 +10440,12 @@ snapshots: postcss: 8.4.48 postcss-selector-parser: 7.0.0 + postcss-calc@10.0.2(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + postcss-value-parser: 4.2.0 + postcss-clamp@4.1.0(postcss@8.4.48): dependencies: postcss: 8.4.48 @@ -10170,6 +10472,25 @@ snapshots: postcss: 8.4.48 postcss-value-parser: 4.2.0 + postcss-colormin@7.0.2(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + caniuse-api: 3.0.0 + colord: 2.9.3 + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-combine-duplicated-selectors@10.0.3(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + + postcss-convert-values@7.0.4(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + postcss-custom-media@11.0.5(postcss@8.4.48): dependencies: '@csstools/cascade-layer-name-parser': 2.0.4(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) @@ -10200,6 +10521,23 @@ snapshots: postcss: 8.4.48 postcss-selector-parser: 7.0.0 + postcss-discard-comments@7.0.3(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + + postcss-discard-duplicates@7.0.1(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + + postcss-discard-empty@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + + postcss-discard-overridden@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-double-position-gradients@6.0.0(postcss@8.4.48): dependencies: '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.48) @@ -10280,6 +10618,45 @@ snapshots: postcss: 8.4.48 postcss-value-parser: 4.2.0 + postcss-merge-longhand@7.0.4(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + stylehacks: 7.0.4(postcss@8.4.48) + + postcss-merge-rules@7.0.4(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + caniuse-api: 3.0.0 + cssnano-utils: 5.0.0(postcss@8.4.48) + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + + postcss-minify-font-values@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-minify-gradients@7.0.0(postcss@8.4.48): + dependencies: + colord: 2.9.3 + cssnano-utils: 5.0.0(postcss@8.4.48) + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-minify-params@7.0.2(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + cssnano-utils: 5.0.0(postcss@8.4.48) + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-minify-selectors@7.0.4(postcss@8.4.48): + dependencies: + cssesc: 3.0.0 + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + postcss-modules-extract-imports@3.1.0(postcss@8.4.48): dependencies: postcss: 8.4.48 @@ -10308,10 +10685,61 @@ snapshots: postcss: 8.4.48 postcss-selector-parser: 7.0.0 + postcss-normalize-charset@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + + postcss-normalize-display-values@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-positions@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-repeat-style@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-string@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-timing-functions@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-unicode@7.0.2(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-url@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + + postcss-normalize-whitespace@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + postcss-opacity-percentage@3.0.0(postcss@8.4.48): dependencies: postcss: 8.4.48 + postcss-ordered-values@7.0.1(postcss@8.4.48): + dependencies: + cssnano-utils: 5.0.0(postcss@8.4.48) + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + postcss-overflow-shorthand@6.0.0(postcss@8.4.48): dependencies: postcss: 8.4.48 @@ -10398,6 +10826,17 @@ snapshots: postcss: 8.4.48 postcss-selector-parser: 7.0.0 + postcss-reduce-initial@7.0.2(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + caniuse-api: 3.0.0 + postcss: 8.4.48 + + postcss-reduce-transforms@7.0.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + postcss-replace-overflow-wrap@4.0.0(postcss@8.4.48): dependencies: postcss: 8.4.48 @@ -10417,6 +10856,22 @@ snapshots: cssesc: 3.0.0 util-deprecate: 1.0.2 + postcss-sort-media-queries@5.2.0(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + sort-css-media-queries: 2.2.0 + + postcss-svgo@7.0.1(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-value-parser: 4.2.0 + svgo: 3.3.2 + + postcss-unique-selectors@7.0.3(postcss@8.4.48): + dependencies: + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + postcss-value-parser@4.2.0: {} postcss@5.2.18: @@ -10941,6 +11396,8 @@ snapshots: dot-case: 3.0.4 tslib: 2.8.1 + sort-css-media-queries@2.2.0: {} + source-map-js@1.2.1: {} source-map-support@0.5.21: @@ -11055,6 +11512,12 @@ snapshots: optionalDependencies: '@babel/core': 7.26.0 + stylehacks@7.0.4(postcss@8.4.48): + dependencies: + browserslist: 4.24.2 + postcss: 8.4.48 + postcss-selector-parser: 6.1.2 + stylis@4.3.4: {} supports-color@2.0.0: {} diff --git a/postcss.config.d.ts b/postcss.config.d.ts new file mode 100644 index 00000000..f966a75a --- /dev/null +++ b/postcss.config.d.ts @@ -0,0 +1,5 @@ +declare const config: { + plugins: Record> +} + +export default config diff --git a/postcss.config.mjs b/postcss.config.mjs index f5a47046..064f0d5a 100644 --- a/postcss.config.mjs +++ b/postcss.config.mjs @@ -1,5 +1,16 @@ import { breakpoints as _breakpoints, screens } from './styles/config.mjs' +const validatePixels = (pixels, dimension) => { + const numPixels = Number.parseFloat(pixels) + if (Number.isNaN(numPixels)) { + throw new Error(`Invalid pixel value: ${pixels}`) + } + if (screens[dimension].width === 0 || screens[dimension].height === 0) { + throw new Error(`Screen ${dimension} dimensions cannot be zero`) + } + return numPixels +} + const postcss = { plugins: { 'postcss-import': {}, @@ -29,31 +40,20 @@ const postcss = { 'postcss-functions': { functions: { 'mobile-vw': (pixels) => { - const numPixels = Number.parseFloat(pixels) - if (Number.isNaN(numPixels)) { - throw new Error(`Invalid pixel value: ${pixels}`) - } + const numPixels = validatePixels(pixels, 'mobile') return `${(numPixels * 100) / screens.mobile.width}vw` }, 'mobile-vh': (pixels) => { - const numPixels = Number.parseFloat(pixels) - if (Number.isNaN(numPixels)) { - throw new Error(`Invalid pixel value: ${pixels}`) - } - return `${(numPixels * 100) / screens.mobile.height}svh` + const numPixels = validatePixels(pixels, 'mobile') + const vh = `${(numPixels * 100) / screens.mobile.height}` + return `clamp(${vh}vh, ${vh}svh, ${vh}dvh)` }, 'desktop-vw': (pixels) => { - const numPixels = Number.parseFloat(pixels) - if (Number.isNaN(numPixels)) { - throw new Error(`Invalid pixel value: ${pixels}`) - } + const numPixels = validatePixels(pixels, 'desktop') return `${(numPixels * 100) / screens.desktop.width}vw` }, 'desktop-vh': (pixels) => { - const numPixels = Number.parseFloat(pixels) - if (Number.isNaN(numPixels)) { - throw new Error(`Invalid pixel value: ${pixels}`) - } + const numPixels = validatePixels(pixels, 'desktop') return `${(numPixels * 100) / screens.desktop.height}svh` }, columns: (columns) => { @@ -65,6 +65,9 @@ const postcss = { }, }, }, + 'postcss-sort-media-queries': {}, + 'postcss-combine-duplicated-selectors': {}, + cssnano: process.env.NODE_ENV === 'production' ? {} : false, }, }