Topic: Missing CSS: How to build, including all css-classes, not only what is used on page

1Relation premium asked 11 months ago


Hi, due to current way I'm using my application, I'm building the main.js file, and the use it in my project. Somehow this has never been an issue.

Though somehow after upgrading to 6.4, when i build (npm run build) the file, it only contains what classes is used on the page, and not all.

Eg. if i do not use col-8 on the page, when building, it does not exists in file. When I add it, and build again, its there in the main.js

Expected behavior When running npm run build, the file main.js should contain all default classes that are documented in the documentation

Actual behavior Main.js does only contain what is current used in the index.html

Resources (screenshots, code snippets etc.) Can upload folder if needed.


Grzegorz Bujański staff answered 11 months ago


I'm assuming you're using purgeCSS or some other solution that removes classes you don't use.

If you are using one of our starters, simply remove the config for purgeCSS from the postcss.config.js file


1Relation premium commented 11 months ago

Okay thanks! This worked - though might not be the best solution, it will def. work for now.

Now this leads me to another issue: - Loading the main.js at the end of the document, makes the document load without stylesheet at first - Loading the main.js at the beginning makes mdb things like fields, buggy

How can I get a .css version of my build, that I can preload?

Thanks!


Grzegorz Bujański staff commented 11 months ago

I see you've added a new thread: https://mdbootstrap.com/support/standard/build-css-file-with-custom-changes-to-load-in-beginning-of-document/ let's continue the styling issue there



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.0
  • Device: Computer
  • Browser: Firefox
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: No