You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
svelte-package helps convert component types and preprocessors into packaged components with separate type declarations files. With this tool, it may be possible to:
Write components in Typescript, and import Carbon Sass within <style lang="sass">
Have output component include separate .svelte and .svelte.d.ts files, and Sass styles be converted to scoped CSS
If proven successful, users of carbon-components-svelte should be able to import components without needing to manually import entire CSS themes, nor have to install Sass just to include component-specific styles. And they can add a global theme if they wish to use a theme other than the default (white).
@laurenceokite Currently, carbon-preprocess-svelte offers a Vite plugin that will prune unused Carbon CSS in the build step. I would recommend trying that if using the pre-generated CSS from this library.
@laurenceokite That's correct; the optimizeCss plugin is cautious in its approach. To minimize false positives, the plugin will only remove Carbon-specific classes (e.g., classes starting with .bx-- prefix) for unused components. For example, .bx--breadcrumbs will be removed if Breadcrumbs is not used.
Why
svelte-package helps convert component types and preprocessors into packaged components with separate type declarations files. With this tool, it may be possible to:
<style lang="sass">
.svelte
and.svelte.d.ts
files, and Sass styles be converted to scoped CSSIf proven successful, users of carbon-components-svelte should be able to import components without needing to manually import entire CSS themes, nor have to install Sass just to include component-specific styles. And they can add a global theme if they wish to use a theme other than the default (white).
Out of scope
Theme
toGlobalTheme
#1702The text was updated successfully, but these errors were encountered: