CSS splitting not working

Topic: CSS splitting not working

januszveiro free asked 10 months ago

When importing even a single component, for example: import { MDBBtn} from 'mdbreact';

All CSS chunks are imported, for example: table.mdb-dataTable tbody > tr.selected, table.mdb-dataTable tbody > tr > .selected { background-color: #f5f5f5; } and more of the dataTable css

Expected behavior: Only the CSS belonging to imported components should be imported.

januszveiro free answered 10 months ago

Hi Krzysztof,

Thank you!

BTW, is MDB4 React still supported? A few people are waiting for this PR to be merged: https://github.com/mdbootstrap/mdb4-react-ui-kit/pull/17

Krzysztof Wilk staff commented 9 months ago

Yes, we still support this product and have a fix release planned already :)

Krzysztof Wilk staff answered 10 months ago


In the MDB4 we do not support such a feature. To achieve that we recommend:

  1. Using scss instead of CSS (where you can import styles you need): https://mdbootstrap.com/docs/react/getting-started/installation/#sass
  2. Using theming in MDB5 package (only available with pro components): https://mdbootstrap.com/docs/b5/react/content-styles/theme/

Keep coding!

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: MDB4 5.1.0
  • Device: not important
  • Browser: not important
  • OS: not important
  • Provided sample code: No
  • Provided link: No