This project aims to provide React components based on the Material Web design guidelines originally from https://github.com/material-components/material-web.
The default exported file in src/index.tsx imports the CSS file containing fonts (Roboto, Material Symbols) and additional styles. This import is currently mandatory, but it would be beneficial to make it optional.
Not all projects use Roboto font or Material Symbols.
Material Symbols are imported even if the Icon component isn't used.
Possible solutions:
Export individual components: Instead of just exporting the default (.) and styles, consider exporting each component individually. This allows developers to import specific components without pulling in the entire CSS file.
Remove default CSS import: This is a breaking change, but it removes the mandatory import of styles. Developers would then need to import the CSS file explicitly when needed.
The default exported file in
src/index.tsx
imports the CSS file containing fonts (Roboto, Material Symbols) and additional styles. This import is currently mandatory, but it would be beneficial to make it optional.https://github.com/anthonyleung-dev/react-material-web/blob/3d006c60489105c74899c8661a7afb088e078166/src/index.tsx#L1
Here's why:
Possible solutions:
Thanks for working on this!