How do I update the version 3 load stylesheet to the latest version?

I want my customized bootstrap stylesheet to be updated with the latest version whenever a new version is released.

I would like to be able to easily upgrade from, for example, bootstrap version 3.2.0 to bootstrap version 3.3.4, and then from there to any future version (given that bootstrap does not completely change the structure).

Is there any easy way to achieve this?

Or

Is there any specific way to structure my stylesheet to make it easier to upgrade to newer versions?

I would like to be able to keep up with the latest versions without redoing most of my custom styling changes.

+3


source to share


2 answers


Option 1

Leave the original bootstrap files and override / extend the style in your own css files. This way you will be able to update the boot file without any problem.

Just make sure your custom styling takes precedence over bootstrap classes. Something like:

your html:

<div id="my-website">
    <button class="btn btn-default" type="submit">Button</button>
</div>

      

your css:



#my-website .btn {
    display: inline-block;
    width: 100px;
    height: 100px;
}

      

this way you override the default bootstrap.btn class functionality yourself without changing the bootstrap itself, and since the button is inside a div with an id, you will have higher priority specifying relationships than bootstrap styles and your style modifications will be applied.

Option 2

Collapsing the GitHub repository https://github.com/twbs/bootstrap and committing changes to your fork. This way, whenever you want to update your bootstrap version, all you have to do is sync your repo with the upstream and merge your changes with them.

While this adds more complexity, it will certainly allow you to modify the original bootstrap files without hindering you from hassle-free upgrades.

PS: I would recommend using a separate branch for your own stuff so that if you ever wanted to contribute to bootstrap you could use the same fork and don't need any magic to clean up the master branch. Not to mention, updating the repo would be easier in this case, just drag the master branch upstream into your repository master, and then merge the master branch into your branch.

+2


source


you can do as Hashem Qolami said and whether they save their own styles, of course you can do that! by its own "theme.css". What I do and what I run every time you leave something new on startup, if the make-up and updagrate call on my server is correct but not cdn is not dependent on anyone.

you need to make a bootstrap CDN to keep the latest version ( not recommended )

http://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css

http://maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js

      



and save your own theme.css

<head>
 <link rel="stylesheet" href="asset/css/theme.css">
 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">

 <script type="text/javascript" src="asset/js/jquery-2.1.4.min.js"></script>
 <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js"></script>
</head>

      

+1


source







All Articles