Customizing Bootstrap CSS template

前端 未结 9 1127
面向向阳花
面向向阳花 2020-11-22 09:03

I am just getting started with Bootstrap from Twitter and am wondering what the ‘best practices’ is for customization. I want to develop a system that will take advantage of

9条回答
  •  隐瞒了意图╮
    2020-11-22 09:41

    The best thing to do is.

    1. fork twitter-bootstrap from github and clone locally.

    they are changing really quickly the library/framework (they diverge internally. Some prefer library, i'd say that it's a framework, because change your layout from the time you load it on your page). Well... forking/cloning will let you fetch the new upcoming versions easily.

    2. Do not modify the bootstrap.css file

    It's gonna complicate your life when you need to upgrade bootstrap (and you will need to do it).

    3. Create your own css file and overwrite whenever you want original bootstrap stuff

    if they set a topbar with, let's say, color: black; but you wan it white, create a new very specific selector for this topbar and use this rule on the specific topbar. For a table for example, it would be

    . If you declare your css file after bootstrap.css, this will overwrite whatever you want to.

    提交回复
    热议问题