Skip to content

[Web] Minify CSS#400

Merged
markmur merged 2 commits into
mainfrom
web-css-minify
Jul 3, 2026
Merged

[Web] Minify CSS#400
markmur merged 2 commits into
mainfrom
web-css-minify

Conversation

@markmur

@markmur markmur commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Web CSS lived in a css tagged template literal inside checkout.styles.ts, so it shipped verbatim and skipped Vite's minifier. Moving the styles into a real checkout.css file imported with ?inline lets Vite minify it, shaving ~1kb off the bundle. The now-unused css helper is dropped in favour of importing the stylesheet directly.

Verify the built bundle in platforms/web/dist still inlines the styles into the shadow template and that the overlay renders correctly in the web sample.

@markmur markmur requested a review from a team as a code owner July 2, 2026 16:09
@markmur markmur self-assigned this Jul 2, 2026
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 43.3 KiB 42.2 KiB -1.1 KiB
Web file breakdown
File Base Head Delta
dist/index.js.map 46.3 KiB 45.7 KiB -571 B
dist/custom-elements.json 36.7 KiB 33.5 KiB -3.3 KiB
src/checkout.ts 30.4 KiB 30.4 KiB +20 B
README.md 16.4 KiB 16.4 KiB 0 B
dist/index.js 14.5 KiB 13.7 KiB -807 B
src/ucp-embed-types.ts 9.6 KiB 9.6 KiB 0 B
dist/ucp-embed-types.d.ts 9.5 KiB 9.5 KiB 0 B
src/checkout.types.ts 7.4 KiB 7.4 KiB 0 B
dist/checkout.d.ts 7.0 KiB 7.0 KiB 0 B
dist/checkout.types.d.ts 6.1 KiB 6.1 KiB 0 B
src/checkout.styles.ts 2.8 KiB -2.8 KiB
package.json 2.8 KiB 2.8 KiB 0 B
src/checkout.css 2.5 KiB +2.5 KiB
src/utils.ts 1.7 KiB 1.6 KiB -145 B
dist/utils.d.ts 1.4 KiB 1.2 KiB -145 B
src/index.ts 1.2 KiB 1.2 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 B
dist/index.d.ts 749 B 749 B 0 B
src/checkout-web-component.ts 271 B 271 B 0 B
dist/checkout-web-component.d.ts 154 B 154 B 0 B
…and 3 smaller files

Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 99%
98.49% (261/265) 88.48% (146/165) 100% (58/58)

@markmur markmur requested review from kiftio and westeezy July 3, 2026 08:16
* Move styles to css file

* Update snapshot

* Drop oprhaned css util helper
@markmur markmur merged commit f235e96 into main Jul 3, 2026
25 checks passed
@markmur markmur deleted the web-css-minify branch July 3, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants