Topic: Customizing primary-color

mudassir_saifi premium asked 4 years ago

Hello, I currently have the free version of MDB (jQuery 4.16.0) and so far been very impressed with the features. I plan to upgrade to pro soon. However i have hit a roadblock while trying to customize primary color. You documentation says to override primary color set $primary-color: in the custom-variables.scss. However on doing that it does not override the primary color and the default blue color is displayed. I even tried going into colors.scss and updating the primary-color variable there, still doesn't work.

_custom-variables.scss: $primary-color: #7e57c2;

<button type="button" class="mt-2 btn btn-sm btn-primary rounded-pill">Create New</button>

mudassir_saifi premium answered 4 years ago

Hello Grzegorz,

Thank you for the response. I saw your snippet and that is overriding the btn-primary class. What i want to do is override the $primary-color variable so all classes that use the variable will then reflect the new color. As per the documentation below i'm trying to update custom-variables.scss. But that's not working.

As for the project configuration. I'm using an Angular 9.1.1 with Bootstrap 4.4. Here's how my angular.json looks like. Let me know what other information you need. Thanks.

"options": {
        "outputPath": "dist/eschool-guru",
        "index": "src/index.html",
        "main": "src/main.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "",
        "aot": true,
        "assets": [
        "styles": [
        "scripts": [

Grzegorz Bujański staff commented 4 years ago

If you are using Angular, why not use MDB Angular instead of MDB jQuery? Note that you import a css file in the configuration, not a SCSS file. That's why it doesn't work.

mudassir_saifi premium commented 4 years ago

Awesome. that worked. imported mdb-free.scss instead of mdb-min.css. Thank you.

Grzegorz Bujański staff commented 4 years ago

I'm glad I could help. Best, Grzegorz.

Grzegorz Bujański staff answered 4 years ago


I have prepared for you a snippet that shows how you can override this color:

You have given too little information to say why it didn't work in your case. But, considering that you are making changes to your scss files and it didn't work, I suppose you just have a badly configured environment. Do you use tools such as webpack in your project? How do you import scss files into your project?

Best, Grzegorz.

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

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.16.0
  • Device: Desktop
  • Browser: Chrom
  • OS: Macbook Pro
  • Provided sample code: No
  • Provided link: No