While our last major version bump (2.0) was a complete rewrite of the docs, CSS, and JavaScript, the move to 3.0 is equally ambitious, but for a different reason: Bootstrap 3 will be mobile-first. This is an ongoing document to identify the changes we'll be making along the way.
Docs and repo
We'll be working to simplify the content of the docs once again. Key changes are around the organization of the pages and the tools powering them.
Repository
- Add new
distfolder.- Includes two subfolders,
cssandjs, each containing a regular and minified version of Bootstrap's CSS and JavaScript.
- Includes two subfolders,
- Separate dependencies from compiled Bootstrap files with new
assetsfolder.- All files within
assetsare documentation assets or third party dependencies.
- All files within
- Switch from Makefile to Grunt.
- Grunt is JavaScript-based
- Helps folks who want to run and compile Bootstrap locally on Windows
- Replaces all existing
makecommands withgruntcommands (all the same functionality, just a different tool)
General docs changes
- Convert docs to Jekyll.
- Instead of Mustache, docs templates are built with Jekyll.
- This greatly simplifies deploying docs changes, isolates our docs from CSS and JavaScript changes, and drastically decreases the amount of code being tracked in the repo.
- It also provides better URLs, page title variables, partials, and code highlighting.
- New repo structure
- Host previous versions of documentation.
- Instead of having folks download release tags, we'll go back and add the docs for the most recent version (2.3.2) to the site. They'll be available at http://getbootstrap.com/2.3.2/ once v3 goes live.
- Move examples to separate repo.
- Fitting with our theme of focus and simplicity in the repo, we're moving all the example templates out into their own repository at twbs/bootstrap-examples.
- This keeps the examples as static files without a Jekyll server in the way, so more folks have easy access to them.
- It also removes a ton of static files (the example screenshots) from the repo and that's a huge win.
- Add "Customizing Bootstrap" section to detail best practices for customizing CSS.
- Remove all i18n tags from Mustache templates. No more
{{_i}}and{{/i}}in the docs templates, just raw HTML in our Mustache files. - Remove Extend page because it's content was not directly applicable to Bootstrap and out of date with info in the readme and Getting Started page.
Homepage
- Point link to the new Bootstrap Expo.
- Remove examples and basically all marketing content from homepage.
Getting started
- Add Bower installation instructions to guide.
- Add new Customization best practices section.
Global JavaScript
- Overhaul CSS transitions and reinforce with JavaScript transitions as necessary.
- Improve noConflict throughout plugins.
- Namespace events to reduce conflict issues.
- Drop bootstrap-typeahead.js.
- For context, see Add typeahead.js from Twitter instead of the old bootstrap-typeahead.js #7805 & 88dd9de.
- Instead, use Twitter's typeahead.js plugin.
Global CSS
At a high level, we're dropping IE7 and FF3.6 support, combining standard and responsive CSS into a single file, and consolidating additional code as appropriate.
Browser support
- Drop support for IE7. Removed all
*hacks, such as*zoom: 1;, and other IE7-specific lines of CSS. - Drop support for Firefox 3.6. Removed
-moz-box-shadowinstances and related hacks.
LESS changes
- Refactor most components to be more mixin-friendly.
- Instead of all component classes being a hodgepodge of un-nested CSS, we'll re-order the code to make it super easy to take any Bootstrap class and use it as a mixin.
- Not all components have been rewritten this way, but those that make sense to rename have.
- Rename variables to use dashes instead of camelCase. For example, it's now
@body-bginstead of@bodyBackground. - More consistent variable naming scheme.
- The format of variables was all over the place and has now been standardized.
- The general approach is element, state, pseudo state. For example,
@navbar-link-color-hover.
- Replace existing color variables with more semantic ones.
- No more
@blue,@orange, and the like, which we weren't using them much anyway. - They've been replaced with
@brand-primary,@brand-success, and others. These are then assigned on a per-component basis (e.g.,@state-warning-text,@btn-background-primary, etc). - Also removed
@blackand@whitebecause#000and#fffare 20% shorter and not something that should be controlled via variable.
- No more
- Remove
.border-radius()and.border-*-*-radiusmixins.- As only Android 2.1, iOS 3.2, and older desktop browsers require a prefixed version, we've removed the base mixin. Since we no longer require prefixes for independent corners, we've dropped those mixins as well. Mixins for a single side, like
.border-left-radius, are still available.
- As only Android 2.1, iOS 3.2, and older desktop browsers require a prefixed version, we've removed the base mixin. Since we no longer require prefixes for independent corners, we've dropped those mixins as well. Mixins for a single side, like
- Use decimal values in
.opacity()mixin instead of whole numbers to match default CSS patterns.- For example, write
.opacity(.5)instead of.opacity(50).
- For example, write
- Add retina image mixin. Declare a standard and 2x image path and set the size for easy retina images anywhere with
.img-retina(). - Add new global
@component-active-bgvariable.- Instead of assigning
@link-colorto multiple variables for backgrounds, we have dedicated a new variable to that. - Change
@component-active-bgand customize the active states of nav pills, dropdowns, and more.
- Instead of assigning
- Update gradient mixins for better color stop support.
- Vertical and horizontal gradients now accept four values, in the following order:
@start-color,@start-percent,@end-color, and@end-percent. - Upgrading means specifying all four values in the above order, or specifying variables directly when calling your mixins.
- To call a gradient but only set two properties, directly assign values to the variables like so:
#gradient > .vertical(@start-color: red; @end-color: blue);. Doing so will include the default values for any unmentioned variables.
- Vertical and horizontal gradients now accept four values, in the following order:
- Drop unused prefixes from several mixins.
- See Remove unneeded prefixes from some mixins #8380 for more information.
Miscellaneous
- Go mobile first. Responsive CSS is no longer separate and all responsive features are now compiled into the core
bootstrap.cssfile near. Separate files are no longer required, and have thus been removed. - Upgrade to latest Normalize, and removed reset.less.
- This includes removing reset.less in favor of a dedicated normalize.less file.
- Print styles and responsive image CSS (the only meaningful modifications from the previous reset file) have been moved to print.less and scaffolding.less, respectfully.
- Moved print styles to separate print.less file.
- Previously print styles were bundled with the scaffolding.less page.
- Now within a separate file for easy removal via the Customizer.
- Remove layouts.less.
- Since it only held a couple layout styles and the fluid container has been removed (see next section), this file is superfluous.
- We've moved the default
.containerstyles togrid.less.
- Add
!importantto.hideand.show.- For these classes to work on every element, the specificity either needed to be higher or we needed the
!importantflag. We opted for the latter for fewer lines of code.
- For these classes to work on every element, the specificity either needed to be higher or we needed the
- Drop
*-importantfor.*-danger.- Some elements had red variations that came from different class naming schemes, so we standardized that by switching all red variations to
*-danger. - Includes buttons, labels, badges, text, alerts. and progress bars.
- Some elements had red variations that came from different class naming schemes, so we standardized that by switching all red variations to
- Refactor responsive utility classes to match new media queries.
Grid system
The grid is drastically simpler, yet more powerful, in BS3. We're transitions back to a single grid system, but with all the awesomeness that was present in the old grids. On top of that, we've also added some new features.
- Overhaul grid systems to make it fluid and mobile-first.
- Removed the separate fluid grid system, container, and layout as we're down to one grid.
- New single grid system (still uses
.row) utilizes percentages over pixels,paddinginstead ofmargin, andbox-sizing: border-boxfor easy math. - The grid is mobile first, meaning it starts out stacked and scales up as necessary to become horizontal via media queries. Previously the grid was built for 940px layouts and scaled up and down.
- Nesting is still 100% supported, but columns will be proportionately sized to their parent, just as the old fluid grid behaved.
- Offsets are still 100% supported.
- Increase specificity of grid classes.
- Instead of
.span*and.offset*, we're now using.col-*and.col-offset-*, respectively.
- Instead of
- Add tiny and small grid systems for phones and tablets.
- Similar to the default grid system, we've added two more sets of grid classes to create more complex layouts for phones and tablets. That means you can optionally utilize 12 columns at two additional important breakpoints.
- Use
.col-*classes for tiny devices (smartphones). - Use
.col-sm-*classes for small devices (tablets). - The small grid classes also include support for offsets and source ordering, but the tiny grid classes do not.
- Simplify required grid variables.
- The
@grid-row-widthand@grid-column-widthvariables have been removed. We didn't use the row width (@gridRowWidthas of v2.3.1) variable anywhere in the source and column widths are now derived via simple calculations in our LESS. - We've added a new
@grid-float-breakpointvariable to customize the point at which the floats and widths kick in for our new mobile-first grid.
- The
- New and improved grid mixins.
- Changed
.makeRow()to.make-row(). - Changed
.makeColumn()to.make-column(). In addition, it includes a media query to apply thefloatandwidthwhen above the@grid-float-breakpointvalue. - Added
.make-column-offset()to generate column gaps, similar to the predefined grid classes.
- Changed
- Add
.col-push-*and.col-pull-*modifier classes for easy column source ordering. - Remove dedicated table grid classes.
- They are no longer necessary given the new grid.
- However, we are still removing the float on
.col-*classes when used within.tableelements.
- Remove dedicated input grid classes.
- Remove input grid mixin and input span classes.
- Given new grid system, inputs are always
width: 100%;to start. - Best practices now are to place 100% wide inputs within grid columns as opposed to using classes directly on input elements.
- Use
max-widthinstead ofwidthon all.containerinstances to help prevent some issues with containers in components like navbars.
Type
Typography in Bootstrap 3 isn't seeing much change, just a decent amount of cleanup and some small improvements.
Headings
- Add support for headings classes (e.g.,
h1, .h1 { … }). - Remove
text-rendering: optimizeLegibilityfrom headings to prevent (inconsistent) broken rendering on some Android and Windows devices.
Lists
- Change
ul.unstyledto.list-unstyled.- No longer dependent on HTML element in the selector.
- Can now be used as mixin.
- Change
ul.inlineto.list-inline.- Uses
.list-unstyledas a mixin to reset default list styles. - Can now be used as a mixin.
- Uses
Text classes
- Changed
.mutedto.text-mutedto match the other contextual text colors. - Fixed bug with text alignment utility classes and tables.
LESS
- Remove all
#fontmixins.- We only used these in one place and they honestly just complicated things.
- Instead of using mixins, just make use of the
@font-family-variables.
- Drop the
@altFontFamilyvariable.
We explored the use of rem units over pixels, but found little benefit to offset the implications of their use. IE8 would still need a pixel fallback, and that's a lot of duplicate lines of code. Moreover, using rems everywhere instead of pixels would exacerbate that problem. Mixing rems and pixels doesn't seem to make sense either right now. However, we can and will continue to evaluate this in future releases.
Tables
- Add support for responsive utility classes on table elements.
- Remove
table.infofrom table state classes. - Added global
text-align: left;for<th>elements (to undo the default center alignment) and removedfont-weight: bold;from them (bold is a browser default). - Improve nesting by scoping all styles to immediate children.
- Using the
>selector, we scope all styles. - Doesn't change much, but does mean you'll need to apply the table classes to all nested tables.
- Using the
Images
- Consolidate image thumbnail styles. No more
.img-polaroidas it duplicated the same styles as.thumbnail. Now you can use.img-thumbnailfor regular inline(-block) images, or.thumbnailfor composite components.
Buttons
Fewer, but better buttons. They're redesigned and we're removing some from the mix because they have no clear and universal semantic purpose.
- Default button now requires
.btn-defaultclass.- The default gray button requires two classes—
class="btn btn-default". - This better matches all our other buttons as well.
- We tried to remove the
.btnclass as well, but given the CSS for creating button groups and dropdowns, it's much simpler to keep it around. - While it does add an extra class, it's specificity great simplifies customization methods in plain CSS, and even more so when extending those classes with LESS mixins.
- The default gray button requires two classes—
- Drop
.btn-inverse.- There really is no semantic reasoning for having it, so it's gone.
- Revamp some of the aesthetics of the buttons (no more outer box-shadow) by default.
- Simplify button mixins and pseudo states.
- Removed the
.buttonBackground()mixin since it was no longer in use. - Added the
.btn-pseudo-states()mixin for setting buttonbackground-colorandborder-colorfor the default and:hover,:focus,:active, and variousdisabledstates.
- Removed the
- Add justified button group option for link buttons.
- This feature is only available for buttons with link tags, e.g.
<a href="#" class="btn">Button</a>, and is not compatible with the<button>element due to some browser lame-itude that keeps buttons from accepting auto widths ontable-cellbuttons.
- This feature is only available for buttons with link tags, e.g.
Tables
- Add
.activecontextual class.- Applies the table hover
background-colorto any row or cell that gets the.activeclass.
- Applies the table hover
- Allow contextual classes to be applied to
<thead>and<tfoot>cells.
Forms
Form controls are now 100% width by default, input groups have been overhauled, and form states simplified.
- Update box model for inputs.
- Switched to
box-sizing: border-box;andwidth: 100%;by default for all textual inputs. - This means you'll need to specify a size for inputs, whereas before 3.0 inputs had a set pixel width (around 220px) to start.
- Switched to
- Remove
input-prependandinput-appendfor singular.input-group. The classes have changed for the elements within, and require a bit more markup to use buttons.- Use
.input-groupas the parent class around the input and addon. - For text based prepends/appends, use
.input-group-addoninstead of.addon. - For button prepends/appends, use
.input-group-btnand place your.btnwithin that element.
- Use
- Drop
.form-search. - Add support for
fieldset[disabled]. All form controls within a<fieldset>with thedisabledattribute will be styled appropriately. - Drop
cursor: pointer;from labels and instead only set them on checkbox and radio label options. - Drop
.controls-rowfor grid inputs.- Given input elements in 3.0 are set to
width: 100%by default, and since we don't want to implement a separate input grid, we've opted to drop the.controls-rowfunctionality. - Instead, folks should wrap inputs in standard grid markup: with a wrapping
.rowand individual.span*columns around each input.
- Given input elements in 3.0 are set to
- Drop
.input-block-levelmixin and class.- Since inputs are already
width: 100%;, this is redundant. - Note: inputs are still
display: inline-block, so if you absolutely need them to be block level, you'll need to independently set that yourself.
- Since inputs are already
- Drop the
.uneditable-inputcontrol. Instead, use a read-only input if you must. - Drop
.inline-helpoption. - Horizontal forms are now mobile-first, meaning at <768px, elements are stacked. Above that, elements are floated and appear side-by-side.
- Checkboxes and radios now require an extra
<div>.- Instead of
label.checkbox, you'll needdiv.checkboxwith a<label>within. - This was done to tighten up the clickable area around labels and avoid potential misclicks.
- Instead of
- New classes for inline radios and checkboxes.
- Instead of
.radio.inline, you now need a single class,.radio-inline, for direct use on a<label>element. - To be clear, inline radios and checkboxes do not need a wrapping
<div>, but the default stacked ones do.
- Instead of
- Added new placeholder syntax to the
.placeholder()mixin for Firefox 19+. - Drop
.help-inline.- Given the 100% wide inputs and focus on mobile, inline help text makes much less sense.
- Block help text via
.help-blockremains.
Icons
- Convert to Glyphicons font and move to separate repository.
- Convert to Glyphicons v1.7 @font-face and drop the old PNGs.
- Change required base class and prefix.
- Instead of using an attribute selector, like
[class^="glyphicon-"], we now require a base class,.glyphicon. - This improves general performance for larger pages while also increasing the durability of our code (as it doesn't enforce a specific order of classes).
- This is in addition to the prefix class (which has also been udpated).
- All classes start with
.glyphicon-instead of.icon-for a more unique class and consistency with the newly required base class.
- Instead of using an attribute selector, like
Responsive utilities
- Refactor responsive-utilities.less to use new mobile-first approach.
- Update the docs to reflect the changes in media queries used.
Button groups
- Add support for dropdowns in button groups (or, nested button groups).
- Update checkbox and radio variations to use form controls.
- Checkbox and radio button groups now use
<input>s in their markup.
- Checkbox and radio button groups now use
Labels and badges
We have differentiated the labels and badges with v3. The gist is that badges no longer have modifier classes and are purely meant as unread counters.
- Dropped all modifier variations on badges, making it as neutral as possible, much like those of Mail.app on OS X.
- Dropped the
.label-inversevariation (in conjunction with the inverse button being removed). - Refactor labels to scale with their parent's
font-size.
Jumbotron (formly hero unit)
- Class changed from
.hero-unitto.jumbotron. Associated variables have also been updated to match. - Lighter
font-weightfor headings. Uses semibold instead of bold for headings. - Scale
font-sizein responsive views. - Now full-width without rounded corners to in mobile viewports.
- Improved type styles—now it starts with normal heading sizes and scales to larger sizes given a larger viewport.
Breadcrumbs
- Remove the trailing
/from the last item.
Navigation
Navs
- Remove
.nav-listoption. Replaced by the new.list-groupcomponent. - Remove tabs on left, right, and bottom.
- Tabs on the left and right, while occasionally useful, have been removed from our CSS.
- You can still use the JavaScript plugin and custom CSS to make left/right tabs, but we will no longer include those in the core.
- Removed parent
<div>in the pagination component and dropped center and right alignment options. See Unnecessary pagination div? #6562 for context.
Navbars
- Drop support for
.navbar-search. We dropped the.navbar-searchform layout, so it doesn't make sense to have this anymore. Also, this is just a slightly fancier.navbar-form, which we plan on keeping. - Overhaul styles of default navbar and its sub-components:
- Dropdown menu carets (those attached to the actual menu, not the indicators) have been removed so that dropdown menus sit flat against the edge of the navbar.
- Navbar vertical dividers have been brought in a smidge, meaning they do not extend the full height of the navbar.
- No more box-shadow or gradients on the navbars.
- Height of navbar has increased from 44px to 62px for mobile devices, and 50px for desktops.
- Removed
.navbar-innerand moved relevant styles to.navbar. The inner div is no longer required, greatly simplifying our shit. - Changed
.navbar > .navto.navbar-nav. - Change
.btn-navbarto.navbar-toggle.- More consistent naming schema
- Redesigned it a bit, lightening the styles and widening it, while also positioning it absolutely to the top right.
- Updated navbar brand component:
- Changed
.brandto.navbar-brandfor a more consistent naming schema. - Center aligned
.navbar-brandin mobile views, with amax-width: 200px;to limit hit area given a likely navbar toggle will be very near by.
- Changed
- Dropped navbar dividers.
- Added support for disabled nav links.
- Includes new variables like
@navbar-link-color-disabledand@navbar-link-bg-disabled, along with the inverse options.
- Includes new variables like
Dropdowns
- Remove submenus suport in dropdown menus.
- Removed
.nav-headerand replaced with.dropdown-headeron account of no more.nav-listand that dropdowns still benefit from section headings.
Progress bars
- Add variables for background colors. Instead of hard-coded (and different) green, red, yellow, and blue colors, we use the new (more semantic) global colors.
- Refactor progress bar classes for simpler CSS.
- New structure is now
.progresson the outer<div>and.progress-baron the inner<div>. - Instead of placing modifier classes on the parent, they are placed directly on the bars (e.g.,
.progress-bar-info) in addition to the required.progress-barclass.
- New structure is now
Modals
- No longer require use of
.hide. We updated the utility classes to use!importantand to avoid clashing, removed the.hideclass from modals. Nowdisplay: none;is set directly in the modals.less file. When upgrading, be sure to remove the.hideclass from existing modals. - Redesign the modals to be mobile-first.
- As BS3 is mobile-first, this new modal also starts at the mobile level and scales up via media queries.
- Reintroduces
.modal-openon the body (so we can nuke the scroll there) - Adds a couple extra levels of markup (namely
.modal-dialogand.modal-content) so we can scroll the entire modal rather than overflow a section within the modal. - Related,
.modalis now the wrapper, and.modal-contentis the modal itself. This is so we can still useposition: fixed;, but make the modal relatively positioned so that scrolling moves the entire modal, not something with it. - Added a
.modal-titlefor more consistent and useful targeting of the heading content (previously this was just an<h3>and selector performance wise that sucked).
- Test on iOS5. Not sure if we need to go older, but I want to check here to see how well fixed is supported.
- Test on Android devices (including native browser and Chrome). I only have a year-old Nexus lying around, so might need help tracking down bugs on older devices.
- Add option to programmatically set width of the modal.
- Prevent
<body>scrollbar and shifting content withoverflow: hidden;.
Thumbnails
- Drop the
.thumbnailsmeta component. Instead of special HTML and CSS for grid sizing, just use the grid system itself. Individual.thumbnailstyles are still available, but for sizing, require a parent with a setwidth(e.g., grid columns).
Alerts
-
<hr>elements within any.alertcomponent will now be styled to match the border color of the alert. - Immediate children links within default alerts, and within paragraph text, are now styled for improved readability. Links are automatically bolded and appear as a slightly darker color than the alert text.
New: List groups
Added a new component, the list group, for creating simple and complex series of components. Perfect for more complex implementations like email inboxes, or simple ones like a list of options.
- Requires
.list-groupas a parent base class (on a<ul>,<ol>, or<div>) - Requires
.list-group-itemfor individual list items - List items can also be easily linked—just change from
<ul class="list-group">and<li class="list-group-item">to<div class="list-group">and<a class="list-group-item">. - Option: include a badge, chevron, or both to any list item for automatic placement.
- Option: use
.list-group-item-headingand.list-group-item-textfor custom content implementations.
Linked list groups replace the nav list component.
List groups can also be used within panels with the .list-group-flush class to take them the full width of the parent panel.
New: Panels
Added a new component, the panel, for easily containing content within a box with an optional heading. Also included are contextual state classes for success, warning, danger, and info.
Tooltips
- Bump font-size from 11px to 12px.
Carousel
- Redesign! Lighter styles for the previous and next controls, as well as the carousel captions.
- Update required markup for carousel controls. The
.carousel-controlclass now requires another element within it for the previous/next characters. Those characters are now Glyhpicons icons for improved styling and positioning across browsers and devices. - Indicators are now bottom-middle aligned.
- Captions are reinforced as optional and, by default, are hidden on mobile views, then shown for >768px viewports.
Customizer
- Redesign the entire thing.
- Highlight dependencies between components and assets.
- Figure out how to load and download the same customizations.