From 63b61eea7fcc90db2f1839bc2cb660fee4f81075 Mon Sep 17 00:00:00 2001 From: Steven Black Date: Wed, 4 Sep 2013 23:39:57 -0400 Subject: [PATCH] Docs - Getting started: refactor 'Customizing Bootstrap' --- getting-started.html | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/getting-started.html b/getting-started.html index 4583e2dd94d7..5890a2ca8924 100644 --- a/getting-started.html +++ b/getting-started.html @@ -89,7 +89,6 @@

jQuery required

-
@@ -127,7 +126,6 @@

Hello, world!

-
@@ -261,7 +259,6 @@

Bootstrap theme

-
@@ -289,7 +286,6 @@

Bootstrap template with responsiveness disabled

-
@@ -645,7 +641,6 @@

Additional notes

-
@@ -760,7 +755,6 @@

Browser zooming

-
@@ -818,7 +812,6 @@

Box-sizing

-
@@ -851,7 +844,6 @@

Additional resources

-
@@ -897,32 +889,32 @@

It does not require you to:

- -
-

Customizing Bootstrap is best accomplished when you treat it as another dependency in your development stack. Doing so ensures future upgrades are as easy as possible while also familiarizing yourself to the intricacies of the framework.

+

A customized instance of Bootstrap is best maintained when you treat it as a separate and independently-versioned dependency in your development environment. Doing this makes future upgrades easier.

-

Once you've downloaded and included Bootstrap's CSS into your templates, you can move on to customizing the included components. To do so, create a new stylesheet (LESS, if you like, or just plain CSS) to house your customizations.

+

Once you've downloaded and included Bootstrap's styles and scripts, you can customize its theme and components. Just create a new stylesheet (LESS, if you like, or just plain CSS) to house your customizations.

Compiled or minified?

-

Unless you plan on reading a good chunk of the compiled CSS, go with the minified. It's the same code, just compacted. Less bandwidth is good, especially in production environments.

+

Unless you plan on reading the CSS, go with minified stylesheets. It's the same code, just compacted. Minified styles use less bandwidth, which is good, especially in production environments.

-

From there, include whatever Bootstrap components and HTML content you need to get your template setup. It's best to have a rough idea in mind of modifications to make and content to include, so be sure to spend a brief amount of time on that before moving on.

+

From there, include whatever Bootstrap components and HTML content you need to create templates for your site's pages.

Customizing components

-

You can customize components to varying degrees, but most fall into two camps: light customizations and complete visual overhauls. Luckily, plenty examples of both are available.

-

We define light customizations as mostly surface layer changes, things like a color and font changes to existing Bootstrap components. A great example of this is the the Twitter Translation Center (coded by @mdo). Let's look at how to implement the custom button we wrote for this site, .btn-ttc.

-

Instead of using the provided Bootstrap buttons, which only require just one class to start, .btn, we'll add our own modifier class, .btn-ttc. This will give us a slightly custom look with minimal effort.

+

You can customize components to varying degrees, but most fall into two camps: light customizations and overhauls. Plenty examples of both are available from third parties.

+

We define light customizations as superficial changes, for example, color and font changes to existing Bootstrap components. A light customization example is the Twitter Translation Center (coded by @mdo). Let's look at how to implement the custom button we wrote for this site, .btn-ttc.

+

The stock Bootstrap buttons require just one class, .btn, to start. Here we extend the .btn style with a new modifier class, .btn-ttc, that we will create. This gives us a distinct custom look with minimal effort.

+

Our customized button will be invoked like this:

{% highlight html %} {% endhighlight %} +

Note how .btn-ttc is added to the standard .btn class.

-

In the custom stylesheet, add the following CSS:

+

To implement this, in the custom stylesheet, add the following CSS:

{% highlight css %} /* Custom button @@ -953,21 +945,23 @@

Customizing components

} {% endhighlight %} -

Customizing Bootstrap components takes time, but should be straightforward. Look to the source code often and duplicate the selectors you need for your modifications. Placing them after the Bootstrap source makes for easy overriding without complication. To recap, here's the basic workflow:

+

In short: Look to the style source and duplicate the selectors you need for your modifications.

+

In summary, here's the basic workflow:

-

Going beyond light customizations and into visual overhauls is just as straightforward as the above custom button. For a site like Karma, which uses Bootstrap as a CSS reset with heavy modifications, more extensive work is involved, but well worth it in the end.

+

Once you are comfortable performing light customizations, visual overhauls are just as straightforward. For a site like Karma, which uses Bootstrap as a CSS reset with heavy modifications, more extensive work is involved. But the same principle applies: invoke Bootstrap's default stylesheet first, then invoke your custom stylesheets.

Alternate customization methods

-

While not recommended for folks new to Bootstrap, you may use one of two alternate methods for customization. The first is modifying the source .less files (making upgrades super difficult), and the second is mapping source LESS code to your own classes via mixins. For the time being, neither of those options are documented here.

+

For more advanced Bootstrap developers, you could use one of two alternate methods for customization. The first is modifying the source .less files (and potentially making upgrades super difficult), and the second is mapping source LESS code to your own classes via mixins. For the time being, neither of those options are documented here.

Removing potential bloat

-

Not all sites and applications need to make use of everything Bootstrap has to offer, especially in production environments where bandwidth literally becomes a financial issue. We encourage folks to remove whatever is unused with our Customizer.

+

Not all sites and applications need to make use of everything Bootstrap has to offer, especially in production environments where optimizing bandwidth is an issue. We encourage you to remove whatever is unused with our Customizer.

Using the Customizer, simply uncheck any component, feature, or asset you don't need. Hit download and swap out the default Bootstrap files with these newly customized ones. You'll get vanilla Bootstrap, but without the features *you* deem unnecessary. All custom builds include compiled and minified versions, so use whichever works for you.