Features
-
fontDisplaysets thefont-displayof the IBM Plex@font-facerules the CSS keeps, underoptimizeCss,OptimizeCssPlugin,createCarbonOptimizerandoptimizeCarbonCss. Carbon shipsauto, which hides text while the font loads from IBM's CDN:optimizeCss({ fontDisplay: "swap" });
Other
@font-facerules stay as they are.
Fixes
optimizeCarbonBunprunes Carbon's stylesheets as Carbon ships them, not as Bun's CSS bundler rewrites them. Bun lowers CSS for older browsers, with targets you can't change, which grewall.cssfrom 847 kB to 1.07 MB before pruning and left the pruned sheet bigger than Vite's. On sveld's playground the inlined CSS goes from 98,369 B to 90,046 B, against 89,857 B with Vite. Each import ofcarbon-components-svelte/css/*.cssnow bundles as a placeholder thatpruneBuildandpruneCssreplace with the file;stylesheet: "bundled"keeps Bun's. (#326)
If your Bun build kept Carbon's stylesheet out of the bundle by hand (the 0.12.4 README's recipe), drop that plugin: pruneCss and pruneBuild do it now.