[Resolved] .btn-primary class override bootstrap classes
This thread is resolved. Here is a description of the problem and solution.
Problem:
Toolset Starter theme classes for buttons override bootstrap classes.
For example: In CRED forms 'btn-primary' class in style.css of starter theme is overriding background-color for 'btn-success' and 'btn-danger' standard bootstrap classes.
just wanna warn you that starter theme classes for buttons override bootstrap classes.
I'm trying to add contextual colors for submit buttons on several CRED forms but btn-primary class on style.css of starter them is overriding background-color for btn-success and btn-danger standard bootstrap classes.
Please take a look at this little issue.
Thanks
Carlo
Thank you for contacting Toolset Support and reporting this issue. I think you are correct about this, style.css should be loading at last after the bootstrap css. I am going to check this with our starter theme developer and let you know soon.
Ok, after discussing with our Starter Theme developer we found out that its expected behavior based on how starter theme works. btn-primary is overwritten by Colors option in Appearance >> Customizer. So you can add CSS in Theme Customizer >> Custom CSS section.
Select this option in Toolset >> Settings >> Bootstrap loading >> The theme or another plugin is already loading Bootstrap 3.0.
I have tested now with the following css code and it works fine:
I'm sorry I think I wasn't clear enough: I have no problem at all with .btn-primary behaviour.
I know it can be overwritten by Custom css section in Customizer and yes it works fine... but I really don't need to.
The thing is I'm trying to set the color of my CRED forms using bootstrap classes like btn-success and btn-danger but those classes are overwritten by a rule placed in the style.css file of Starter Theme.
My problem is: my submit button doesn't have btn-primary class. Instead it has btn-success. But its background color is set according to this rule
Okay, to further debug this issue, I need to request temporary access (WP-Admin and FTP Login info) to your staging site. Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
✙ Please add the Links to the [CRED form] Edit Screen, [Page link] and let me know where you have placed this CSS so I can check it there. Thank you
unfortunately I'm on a local environment.
But I can assure you that you have no need to access my environment.
Just make a cred form and add btn-success class to submit button.
You will see the button will be rendered with primary color instead of green.
I have been checking this and found out that it is being added on purpose so that “Submit” buttons have some style on them else they will look ugly if we don’t add any style on submit buttons in Starter theme. The primary color option is for site and not for bootstrap class. There are 2 easy solutions for that:
1. You can disable this effect, please see attached screenshot.
2. OR go to Appearance >> Customize >> Custom CSS and use this code to style submit button:
thanks for your patience and for your support.
I'm gonna mark this as resolved because you are offering some options but I'd like to emphasize that you guys are building a theme on bootstrap and it makes no sense you are using the same class of bootstrap causing an obvious conflict but stating it's not directly related to that class.
Your first suggestion is fine except I'm using that custom value in other places.
From my humble point of view your second option is a total nonsense: those css rules are already loaded in the bootstrap framework. Why should I custom override your rules that are overriding bootstrap ones? It won't be better if you let framework rules to be used freely
I've try to take a look to the styling of submit buttons without btn-primary class applied but actually it looks fine to me either on chrome and firefox.
I really don't want to bother you anymore but please take in consideration the option to change this
I think we can save your custom management of btn-primary class along with bootstrap legit classes.
Maybe rendering the btn-primary class in the CRED submit shortcode by default should be helpful.
By leaving it we can achieve the same result while removing it or change it to another bootstrap class we can change color.
At this point I agree with your suggestions and would like to forward it to our development team for further consideration. Can you please change the ticket status and re-open it? And then I will be happy to report it ahead.
Sadly, our development team has turned down this request. The current solution to use is to disable "Primary Color setting" from theme Customizer >> Advanced Settings, as shown in this screenshot earlier: hidden link
I really wanted to help you here but I am sorry as the decision is in the hands of the higher depart. Please let me know if I can help you with anything else.