question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add bootstrap and custom themes?

See original GitHub issue

Where should we place the bootstrap and custom themes files?

  • add as vendor files?
  • use webpack to compile a separate .css file?
  • or ??

Thanks!

P.S.: I am using the v3.0.0 branch

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

36reactions
holoiiicommented, May 27, 2016

The solution that worked for me is creating a folder structure like this in the root of the project:

vendor/
  css/
    bootstrap.min.css
  fonts/
    (all the font files)

And inside the entry point of webpack (currently /app/app.js), add the following:

import '!!style-loader!css-loader!../vendor/css/bootstrap.min.css';

What this does is strip out the configured loaders for this specific css file, and then use only the style-loader and css-loader. This is necessary because the configured css-loader had modules turned on, which caused bootstrap’s styles to be namespaced and thus not show up properly.

Hope this helps - took me a while to figure out!

1reaction
mxstbrcommented, Mar 19, 2016

That is a good question, there is a few ways to do this.

The easiest one and what I’d go for is:

  1. Add a separate themes or styles folder.

  2. Import your .css files with the file loader like so

    import 'file?name=[name].[ext]!customstyles.css' from '../styles/customstyles.css';`
    
  3. Reference that CSS file in your HTML:

    <link href='mypath/customstyles.css' />
    

Hope that helps & works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Theming Bootstrap
Now, theming is accomplished by Sass variables, Sass maps, and custom CSS. There's no more dedicated theme stylesheet; instead, you can enable the...
Read more >
How to Create a Custom Bootstrap Theme from Scratch
To do this, go to the Bootstrap download page and download the source files of any theme. Inside the download source files, we...
Read more >
How to Customize Bootstrap - UX Planet
There various reasons to customize Bootstrap. You may want to: · Change the existing Bootstrap styles such as colors, fonts, or borders ·...
Read more >
How To Create Your Custom Bootstrap Theme | by Paul Wolf
Create, create, and create custom rules until the sweet cake is ready . Use variables from the _myVariables.scss file in the _myStyles.scss file...
Read more >
Customize Bootstrap with the theme kit - HackerThemes
Customize Bootstrap with the theme kit · Step 1: Prerequisites · Step 2: Building the theme · Step 3: Displaying the theme in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found