diff --git a/bin/build_package.js b/bin/build_package.js index ee3054d253d..ed83b079a82 100644 --- a/bin/build_package.js +++ b/bin/build_package.js @@ -7,7 +7,7 @@ const path = require('node:path'); const fs = require('node:fs'); const glob = require('glob'); const rollup = require('rollup'); -const CleanCSS = require('clean-css'); +const LightningCSS = require('lightningcss'); const { getRollupConfiguration } = require('./rollup'); const args = parseArgs({ @@ -70,7 +70,12 @@ async function main() { console.log('Minifying CSS...'); const css = await fs.promises.readFile(inputStyleFile, 'utf-8'); - const minified = new CleanCSS().minify(css).styles; + const { code: minified } = LightningCSS.transform({ + filename: path.basename(inputStyleFile, '.css'), + code: Buffer.from(css), + minify: true, + sourceMap: false, // TODO: Maybe we can add source maps later? :) + }); await fs.promises.writeFile(inputStyleFileDist, minified); }; diff --git a/package.json b/package.json index e48cff66ba9..6f0b53732a6 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@rollup/plugin-typescript": "^11.1.6", "@symfony/stimulus-testing": "^2.0.1", "@vitest/browser": "^2.1.1", - "clean-css": "^5.3.3", + "lightningcss": "^1.28.2", "playwright": "^1.47.0", "rollup": "^4.22.5", "tslib": "^2.6.3", diff --git a/src/Dropzone/assets/dist/style.min.css b/src/Dropzone/assets/dist/style.min.css index df4fdd88585..4c1e49daedb 100644 --- a/src/Dropzone/assets/dist/style.min.css +++ b/src/Dropzone/assets/dist/style.min.css @@ -1 +1 @@ -.dropzone-container{position:relative;display:flex;min-height:100px;border:2px dashed #bbb;align-items:center;padding:20px 10px}.dropzone-input{position:absolute;display:block;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:1}.dropzone-preview{display:flex;align-items:center;max-width:100%}.dropzone-preview-image{flex-basis:0;min-width:50px;max-width:50px;height:50px;margin-right:10px;background-size:contain;background-position:50% 50%;background-repeat:no-repeat}.dropzone-preview-filename{word-wrap:anywhere}.dropzone-preview-button{position:absolute;top:0;right:0;z-index:1;border:none;margin:0;padding:0;width:auto;overflow:visible;background:0 0;color:inherit;font:inherit;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none}.dropzone-preview-button::before{content:'×';padding:3px 7px;cursor:pointer}.dropzone-placeholder{flex-grow:1;text-align:center;color:#999} \ No newline at end of file +.dropzone-container{border:2px dashed #bbb;align-items:center;min-height:100px;padding:20px 10px;display:flex;position:relative}.dropzone-input{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;display:block;position:absolute;top:0;left:0}.dropzone-preview{align-items:center;max-width:100%;display:flex}.dropzone-preview-image{background-position:50%;background-repeat:no-repeat;background-size:contain;flex-basis:0;min-width:50px;max-width:50px;height:50px;margin-right:10px}.dropzone-preview-filename{word-wrap:anywhere}.dropzone-preview-button{z-index:1;width:auto;color:inherit;font:inherit;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;background:0 0;border:none;margin:0;padding:0;line-height:normal;position:absolute;top:0;right:0;overflow:visible}.dropzone-preview-button:before{content:"×";cursor:pointer;padding:3px 7px}.dropzone-placeholder{text-align:center;color:#999;flex-grow:1} \ No newline at end of file diff --git a/src/LiveComponent/assets/dist/live.min.css b/src/LiveComponent/assets/dist/live.min.css index 19c9c91a4bb..df7a2da8fe0 100644 --- a/src/LiveComponent/assets/dist/live.min.css +++ b/src/LiveComponent/assets/dist/live.min.css @@ -1 +1 @@ -[data-loading=""],[data-loading="delay|show"],[data-loading=show]{display:none} \ No newline at end of file +[data-loading=""],[data-loading=show],[data-loading=delay\|show]{display:none} \ No newline at end of file diff --git a/src/TogglePassword/assets/dist/style.min.css b/src/TogglePassword/assets/dist/style.min.css index 858d9467aea..899c560e98f 100644 --- a/src/TogglePassword/assets/dist/style.min.css +++ b/src/TogglePassword/assets/dist/style.min.css @@ -1 +1 @@ -.toggle-password-container{position:relative}.toggle-password-icon{height:1rem;width:1rem}.toggle-password-button{align-items:center;background-color:transparent;border:none;column-gap:.25rem;display:flex;flex-direction:row;font-size:.875rem;justify-items:center;height:1rem;line-height:1.25rem;position:absolute;right:.5rem;top:-1.25rem} \ No newline at end of file +.toggle-password-container{position:relative}.toggle-password-icon{width:1rem;height:1rem}.toggle-password-button{background-color:#0000;border:none;flex-direction:row;place-items:center;column-gap:.25rem;height:1rem;font-size:.875rem;line-height:1.25rem;display:flex;position:absolute;top:-1.25rem;right:.5rem} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 27e8d369234..5aeb6d659b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4423,15 +4423,6 @@ __metadata: languageName: node linkType: hard -"clean-css@npm:^5.3.3": - version: 5.3.3 - resolution: "clean-css@npm:5.3.3" - dependencies: - source-map: "npm:~0.6.0" - checksum: 10c0/381de7523e23f3762eb180e327dcc0cedafaf8cb1cd8c26b7cc1fc56e0829a92e734729c4f955394d65ed72fb62f82d8baf78af34b33b8a7d41ebad2accdd6fb - languageName: node - linkType: hard - "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -4903,6 +4894,15 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^1.0.3": + version: 1.0.3 + resolution: "detect-libc@npm:1.0.3" + bin: + detect-libc: ./bin/detect-libc.js + checksum: 10c0/4da0deae9f69e13bc37a0902d78bf7169480004b1fed3c19722d56cff578d16f0e11633b7fbf5fb6249181236c72e90024cbd68f0b9558ae06e281f47326d50d + languageName: node + linkType: hard + "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -7132,6 +7132,116 @@ __metadata: languageName: node linkType: hard +"lightningcss-darwin-arm64@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-darwin-arm64@npm:1.28.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"lightningcss-darwin-x64@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-darwin-x64@npm:1.28.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"lightningcss-freebsd-x64@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-freebsd-x64@npm:1.28.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"lightningcss-linux-arm-gnueabihf@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-linux-arm-gnueabihf@npm:1.28.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"lightningcss-linux-arm64-gnu@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-linux-arm64-gnu@npm:1.28.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"lightningcss-linux-arm64-musl@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-linux-arm64-musl@npm:1.28.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"lightningcss-linux-x64-gnu@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-linux-x64-gnu@npm:1.28.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"lightningcss-linux-x64-musl@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-linux-x64-musl@npm:1.28.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"lightningcss-win32-arm64-msvc@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-win32-arm64-msvc@npm:1.28.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"lightningcss-win32-x64-msvc@npm:1.28.2": + version: 1.28.2 + resolution: "lightningcss-win32-x64-msvc@npm:1.28.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"lightningcss@npm:^1.28.2": + version: 1.28.2 + resolution: "lightningcss@npm:1.28.2" + dependencies: + detect-libc: "npm:^1.0.3" + lightningcss-darwin-arm64: "npm:1.28.2" + lightningcss-darwin-x64: "npm:1.28.2" + lightningcss-freebsd-x64: "npm:1.28.2" + lightningcss-linux-arm-gnueabihf: "npm:1.28.2" + lightningcss-linux-arm64-gnu: "npm:1.28.2" + lightningcss-linux-arm64-musl: "npm:1.28.2" + lightningcss-linux-x64-gnu: "npm:1.28.2" + lightningcss-linux-x64-musl: "npm:1.28.2" + lightningcss-win32-arm64-msvc: "npm:1.28.2" + lightningcss-win32-x64-msvc: "npm:1.28.2" + dependenciesMeta: + lightningcss-darwin-arm64: + optional: true + lightningcss-darwin-x64: + optional: true + lightningcss-freebsd-x64: + optional: true + lightningcss-linux-arm-gnueabihf: + optional: true + lightningcss-linux-arm64-gnu: + optional: true + lightningcss-linux-arm64-musl: + optional: true + lightningcss-linux-x64-gnu: + optional: true + lightningcss-linux-x64-musl: + optional: true + lightningcss-win32-arm64-msvc: + optional: true + lightningcss-win32-x64-msvc: + optional: true + checksum: 10c0/3318770bc7cce1d18acd219ea1e988456b6a5f90a4c09cf12c9ef39c5d4fafff9ba18e798f828131c6d9ece9ae8d544de670becb226ed16e243353c88abc9b41 + languageName: node + linkType: hard + "lines-and-columns@npm:^1.1.6": version: 1.2.4 resolution: "lines-and-columns@npm:1.2.4" @@ -8683,7 +8793,7 @@ __metadata: "@rollup/plugin-typescript": "npm:^11.1.6" "@symfony/stimulus-testing": "npm:^2.0.1" "@vitest/browser": "npm:^2.1.1" - clean-css: "npm:^5.3.3" + lightningcss: "npm:^1.28.2" playwright: "npm:^1.47.0" rollup: "npm:^4.22.5" tslib: "npm:^2.6.3" @@ -9028,7 +9138,7 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.0, source-map@npm:~0.6.1": +"source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1": version: 0.6.1 resolution: "source-map@npm:0.6.1" checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011