Skip to content

Change colors of bootstrap theme #1251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
derchirurg opened this issue Jul 31, 2018 · 4 comments
Closed

Change colors of bootstrap theme #1251

derchirurg opened this issue Jul 31, 2018 · 4 comments
Labels

Comments

@derchirurg
Copy link

Are you requesting a feature, reporting a bug or asking a question?

question

What is the current behavior?

With the last used release (1.0.28) I could do something like this:

Survey.cssType = "bootstrap";
defaultBootstrapCss.navigationButton = "btn btn-primary";

const defaultThemeColors = StylesManager.ThemeColors["default"];
defaultThemeColors["$main-color"] = "#054295";
defaultThemeColors["$main-hover-color"] = "#D62020";
defaultThemeColors["$text-color"] = "#000000";
defaultThemeColors["$header-color"] = "white";
defaultThemeColors["$header-background-color"] = "#054295";
StylesManager.applyTheme("default");

This is not possible anymore (in 1.0.35), because of the change in the StyleManager API.

How can I change the theme colors of bootstrap theme?

What is the expected behavior?

I want to change the colors of bootstrap theme.

Specify your

  • browser:
  • browser version:
  • surveyjs platform (angular or react or jquery or knockout or vue): angular
  • surveyjs version: 1.0.35
@dmitry-kurmanov
Copy link
Member

@derchirurg hello! Please try to change the code

Survey.cssType = "bootstrap"; 

to

Survey.StylesManager.applyTheme("bootstrap");

@derchirurg
Copy link
Author

@dmitrykurmanov thanks, thats correct.
But how do I change the colors like:
defaultThemeColors["$main-color"] = "#054295";

@dmitry-kurmanov
Copy link
Member

@derchirurg I understand your scenario for now. We don't have this customization for bootstrap theme. (you don't need to load survey.css styles). Because in bootstrap we have bootstrap's way to change your colors (https://getbootstrap.com/docs/3.3/customize/). Or you can just use css to override any class.

@JaneSjs
Copy link
Contributor

JaneSjs commented May 28, 2025

To customize the appearance of form elements, implement a custom theme. For more information, please refer to the following guide: Themes and Styles.

@JaneSjs JaneSjs closed this as completed May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants