carbon-preprocess-svelte 0.14.0 always prunes Carbon's CSS by the props
your app passes, and names the Carbon tokens your CSS reads that
nothing declares.
Changes
-
propAwareis removed: CSS is always pruned by the props the app
passes, aspropAware's default already did (b5430cf).
Itsexcludeandassumeare top-level options now,
and passingpropAwarethrows:carbon-preprocess-svelte: `propAware` was removed in 0.14.0: CSS is always pruned by the props the app passes. Remove it, and use `exclude: ["DataTable"]` for a component that should keep every variant.Move
excludeandassumeup a level, and droppropAware: true.
ForpropAware: false, drop it, andexcludea component whose
styles go missing.
A build that setpropAware: falsetakes about 95 ms longer,
plus about 5 ms per Carbon stylesheet, as the default already did. -
The CLI always prunes by the props the
--contentfiles pass,
and takes--exclude(b5430cf).
--prop-awareexits 2 with what to pass instead.
For one<Button kind="tertiary">,
Carbon'swhite.cssgoes to 33.0 kB, where 0.13.0 left 67.6 kB;
--exclude Buttongives 64.9 kB. -
When the analysis can't read the app,
Carbon's CSS is left unpruned with a warning,
and the CLI exits 2 and changes no file (b5430cf).
0.13.0 pruned by the imported components alone.
Features
Undeclared Carbon tokens are named (#313, bbdc956).
The plugins, createCarbonOptimizer,
and optimizeCarbonCss given sources warn after pruning,
with the v11 name for a v10 one:
carbon-preprocess-svelte: CSS reads Carbon tokens that no stylesheet declares, so they resolve to nothing:
--cds-brand-x
--cds-ui-01: a v10 name, now --cds-layer-01
v10 names were renamed in carbon-components-svelte 0.114: https://github.com/carbon-design-system/carbon-components-svelte/blob/master/docs/migrations/v0.114.x.md#1-color-tokens
Before, a var() without a fallback that read such a token resolved to
nothing, with no message.
Fixes