Skip to content
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

Importing bootstrap themes and overriding bootstrap css styles #41

Open
jbweeks opened this issue May 25, 2016 · 1 comment
Open

Importing bootstrap themes and overriding bootstrap css styles #41

jbweeks opened this issue May 25, 2016 · 1 comment

Comments

@jbweeks
Copy link

jbweeks commented May 25, 2016

First of all, thanks for the fantastic contribution!

Anyway, I have been reading both your great doc and intro, as well as the doc here:

https://japgolly.github.io/scalacss/book/quickstart/index.html

However, it isn't clear how to "insert" a bootstrap theme file, or override styles for default bootstrap components (like the nav bar).

If I have a file (e.g. "fooBootStrapTheme.css"), how can I inject that, and then, further, override values it provides?

For example, if I want to change the color of the Nav bar, e.g.:

http://work.smarchal.com/twbscolor/

I can clearly go into GlobalStyles.scala and add my own components with their own styles, e.g.:

  val myNavbar = style(
    addClassName("nav navbar-nav navbar-border"),
    backgroundColor(c"#5432AB")
  )

...but I'd rather pull all this from a main CSS file, and then override the styles surgically as needed. Also, I'd rather not have to specify custom components, but rather have the styles apply to the standard bootstrap components (cascading style sheets, FTW) :)

I apologize in advance if I am completely missing something here...

Thanks!

@ochrons
Copy link
Owner

ochrons commented Jun 15, 2016

You need to load the CSS files in correct order, first the Bootstrap base CSS, then any theming to override the defaults. If you are using LESS (like the tutorial is), just add @import statements into the main.less file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants