Skip Navigation

[Resolved] Overriding Default Bootstrap Classes when Bootstrap is Loaded by Toolset

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user asks for a way to customize Bootstrap, which is loaded by Toolset, classes.

Solution:
This is out of the scope of Toolset, check this reply for more advice https://toolset.com/forums/topic/overriding-default-bootstrap-classes-when-bootstrap-is-loaded-by-toolset/#post-1717177

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by jonB-5 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1717095

I wish to override the default Bootstrap colour classes using the documentation at hidden link

However, as I have specified that 'Toolset should load Bootstrap 4', the file structure in my theme does not match that of the Bootstrap documentation, so I do not know where to specify that the files should be imported from, similar to the code below.

// Custom.scss
// Option B: Include parts of Bootstrap

// Required
@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";

Please can you advise on how best to override Bootstrap classes when Toolset is loading Bootstrap 4?

#1717177

Hello and thank you for contacting the Toolset support.

Please note that the code that you shared before is not just plain CSS. It has to pass through a preprocessor to generate CSS. Check this article hidden link

The best way to overwrite Bootstrap CSS is to generate your own files, following the theming documentation shared, or another way(check this page https://stackoverflow.com/questions/48415119/what-happened-to-bootstrap-customize) and then loading those files in your theme or plugins, instead of letting Toolset load the default version of Bootstrap 4.

I hope this answers your question. Let me know if you have any doubts.

#1719179

Thanks for the info Jamal, I'll certainly look into it now I know the best way.