github carbon-design-system/carbon-preprocess-svelte v0.12.5

18 minutes ago

Features

  • fontDisplay sets the font-display of the IBM Plex @font-face rules the CSS keeps, under optimizeCss, OptimizeCssPlugin, createCarbonOptimizer and optimizeCarbonCss. Carbon ships auto, which hides text while the font loads from IBM's CDN:

    optimizeCss({ fontDisplay: "swap" });

    Other @font-face rules stay as they are.

Fixes

  • optimizeCarbonBun prunes 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 grew all.css from 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 of carbon-components-svelte/css/*.css now bundles as a placeholder that pruneBuild and pruneCss replace 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.

Don't miss a new carbon-preprocess-svelte release

NewReleases is sending notifications on new releases.