8

I use react-bootstrap, but I want to modify some of the elements, so I wrote my own custom.css. However it doesn't make any changes (only when I put !important, but the file is so large so it's not a good option).

import {MenuItem, Nav, Navbar, NavBrand, NavDropdown, NavItem} from "react-bootstrap";
import {LinkContainer, MenuItemLink} from "react-router-bootstrap";
import '../assets/css/custom.css';

This is what I did so far.

4
  • 1
    First of all make sure you're loading your custom.css after that react plugins CSS and also use proper selector , of doing these you won't have to use !important. Commented Oct 9, 2015 at 12:29
  • @vivekkupadhyay what do you mean by after? i import in the following order. Commented Oct 9, 2015 at 12:56
  • then may be its selector issue Commented Oct 9, 2015 at 13:01
  • @vivekkupadhyay but i am also modifying classes, .navbar i.e Commented Oct 9, 2015 at 13:03

1 Answer 1

6

When are you importing the Bootstrap CSS? I have an app which successfully uses Bootstrap with some overrides, which does this at the top of its index.js:

require('bootstrap/dist/css/bootstrap.min.css')
require('./bootstrap-overrides.css')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.