diff --git a/.travis.yml b/.travis.yml index 7ccf23744c..f36af0aa4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,24 @@ language: node_js node_js: - 0.10 -before_script: - - gem install jekyll - - npm install -g grunt-cli +before_install: + - time sudo pip install --use-mirrors -r ./test-infra/requirements.txt +install: + - if [ "$TWBS_TEST" = validate-html ]; then time gem install jekyll; fi + - time npm install -g grunt-cli + - time ./test-infra/node_modules_cache.py download || time npm install +after_script: + - if [ "$TWBS_TEST" = core ]; then time ./test-infra/node_modules_cache.py upload; fi env: global: - - SAUCE_USERNAME: bootstrap - - secure: "pJkBwnuae9dKU5tEcCqccfS1QQw7/meEcfz63fM7ba7QJNjoA6BaXj08L5Z3Vb5vBmVPwBawxo5Hp0jC0r/Z/O0hGnAmz/Cz09L+cy7dSAZ9x4hvZePSja/UAusaB5ogMoO8l2b773MzgQeSmrLbExr9BWLeqEfjC2hFgdgHLaQ=" + - SAUCE_USERNAME: bootstrap + - secure: "pJkBwnuae9dKU5tEcCqccfS1QQw7/meEcfz63fM7ba7QJNjoA6BaXj08L5Z3Vb5vBmVPwBawxo5Hp0jC0r/Z/O0hGnAmz/Cz09L+cy7dSAZ9x4hvZePSja/UAusaB5ogMoO8l2b773MzgQeSmrLbExr9BWLeqEfjC2hFgdgHLaQ=" + - secure: "gqjqISbxBJK6byFbsmr1AyP1qoWH+rap06A2gI7v72+Tn2PU2nYkIMUkCvhZw6K889jv+LhQ/ybcBxDOXHpNCExCnSgB4dcnmYp+9oeNZb37jSP0rQ+Ib4OTLjzc3/FawE/fUq5kukZTC7porzc/k0qJNLAZRx3YLALmK1GIdUY=" + - secure: "Gghh/e3Gsbj1+4RR9Lh2aR/xJl35HWiHqlPIeSUqE9D7uDCVTAwNce/dGL3Ew7uJPfJ6Pgr70wD3zgu3stw0Zmzayax0hiDtGwcQCxVIER08wqGANK9C2Q7PYJkNTNtiTo6ehKWbdV4Z+/U+TEYyQfpQTDbAFYk/vVpsdjp0Lmc=" + - secure: "RTbRdx4G/2OTLfrZtP1VbRljxEmd6A1F3GqXboeQTldsnAlwpsES65es5CE3ub/rmixLApOY9ot7OPmNixFgC2Y8xOsV7lNCC62QVpmqQEDyGFFQKb3yO6/dmwQxdsCqGfzf9Np6Wh5V22QFvr50ZLKLd7Uhd9oXMDIk/z1MJ3o=" + matrix: + - TWBS_TEST=core + - TWBS_TEST=validate-html + - TWBS_TEST=sauce-js-unit +matrix: + fast_finish: true diff --git a/Gruntfile.js b/Gruntfile.js index 89e7f42f33..dc301fa272 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -238,13 +238,13 @@ module.exports = function (grunt) { // See https://saucelabs.com/docs/platforms/webdriver { browserName: 'safari', - version: '6', - platform: 'OS X 10.8' + version: '7', + platform: 'OS X 10.9' }, { browserName: 'chrome', - version: '28', - platform: 'OS X 10.6' + version: '31', + platform: 'OS X 10.9' }, /* FIXME: currently fails 1 tooltip test { @@ -331,9 +331,19 @@ module.exports = function (grunt) { grunt.registerTask('validate-html', ['jekyll', 'validation']); // Test task. - var testSubtasks = ['dist-css', 'jshint', 'jscs', 'qunit', 'validate-html']; + var testSubtasks = []; + // Skip core tests if running a different subset of the test suite + if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') { + testSubtasks = testSubtasks.concat(['dist-css', 'jshint', 'jscs', 'qunit']); + } + // Skip HTML validation if running a different subset of the test suite + if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') { + testSubtasks.push('validate-html'); + } // Only run Sauce Labs tests if there's a Sauce access key - if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') { + if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' + // Skip Sauce if running a different subset of the test suite + && (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) { testSubtasks.push('connect'); testSubtasks.push('saucelabs-qunit'); } diff --git a/_includes/nav-css.html b/_includes/nav-css.html index 0228932dd3..531b067e66 100644 --- a/_includes/nav-css.html +++ b/_includes/nav-css.html @@ -87,6 +87,8 @@
Add .pull-right
to a .dropdown-menu
to right align the dropdown menu.
Add .dropdown-menu-right
to a .dropdown-menu
to right align the dropdown menu.
.pull-right
alignmentAs of v3.1, we've deprecated .pull-right
on dropdown menus. To right-align a menu, use .dropdown-menu-right
. Right-aligned nav components in the navbar use a mixin version of this class to automatically align the menu. To override it, use .dropdown-menu-left
.
Make a set of buttons appear vertically stacked rather than horizontally.
+Make a set of buttons appear vertically stacked rather than horizontally. Split button dropdowns are not supported here.
Right aligned text.
{% endhighlight %} -Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.
-Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
-Nullam id dolor id nibh ultricies vehicula ut id elit.
-Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-Maecenas sed diam eget risus varius blandit sit amet non magna.
-Etiam porta sem malesuada magna mollis euismod.
-Donec ullamcorper nulla non metus auctor fringilla.
-...
-...
-...
-...
-...
-...
-{% endhighlight %} -Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <span>
with the class.
<section>
should be wrapped as inline.
Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.
+Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
+Nullam id dolor id nibh ultricies vehicula ut id elit.
+Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+Maecenas sed diam eget risus varius blandit sit amet non magna.
+Etiam porta sem malesuada magna mollis euismod.
+Donec ullamcorper nulla non metus auctor fringilla.
+...
+...
+...
+...
+...
+...
+{% endhighlight %} +Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <span>
with the class.
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.
+Nullam id dolor id nibh ultricies vehicula ut id elit.
+Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+Maecenas sed diam eget risus varius blandit sit amet non magna.
+Etiam porta sem malesuada magna mollis euismod.
+Donec ullamcorper nulla non metus auctor fringilla.
+...
+...
+...
+...
+...
+...
+{% endhighlight %} +Use the generic close icon for dismissing content like modals and alerts.
@@ -2710,3 +2728,496 @@ For example,<section>
should be wrapped as inline.
Bootstrap's CSS is built on LESS, a preprocessor with additional functionality like variables, mixins, and functions for compiling CSS. Thosing looking to use the source LESS files instead of our compiled CSS files can make use of the numerous variables and mixins we use throughout the framework.
+ +Grid variables and mixins are covered within the Grid system section.
+ + +Variables are used throughout the entire project as a way to centralize and share commonly used values like colors, spacing, or font stacks. For a complete breakdown, please see the Customizer.
+ +Easily make use of two color schemes: grayscale and semantic. Grayscale colors provide quick access to commonly used shades of black while semantic include various colors assigned to meaningful contextual values.
+Use any of these color variables as they are or reassign them to more meaningful variables for your project.
+{% highlight css %} +// Use as-is +.masthead { + background-color: @brand-primary; +} + +// Reassigned variables in LESS +@alert-message-background: @brand-info; +.alert { + background-color: @alert-message-background; +} +{% endhighlight %} + +A handful of variables for quickly customizing key elements of your site's skeleton.
+{% highlight css %} +// Scaffolding +@body-bg: #fff; +@text-color: @black-50; +{% endhighlight %} + +Easily style your links with the right color with only one value.
+{% highlight css %} +// Variables +@link-color: @brand-primary; +@link-color-hover: darken(@link-color, 15%); + +// Usage +a { + color: @link-color; + text-decoration: none; + + &:hover { + color: @link-color-hover; + text-decoration: underline; + } +} +{% endhighlight %} +Note that the @link-color-hover
uses a function, another awesome tool from LESS, to automagically create the right hover color. You can use darken
, lighten
, saturate
, and desaturate
.
Easily set your type face, text size, leading, and more with a few quick variables. Bootstrap makes use of these as well to provide easy typographic mixins as well.
+{% highlight css %} +@font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif; +@font-family-serif: Georgia, "Times New Roman", Times, serif; +@font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace; +@font-family-base: @font-family-sans-serif; + +@font-size-base: 14px; +@font-size-large: ceil((@font-size-base * 1.25)); // ~18px +@font-size-small: ceil((@font-size-base * 0.85)); // ~12px + +@font-size-h1: floor((@font-size-base * 2.6)); // ~36px +@font-size-h2: floor((@font-size-base * 2.15)); // ~30px +@font-size-h3: ceil((@font-size-base * 1.7)); // ~24px +@font-size-h4: ceil((@font-size-base * 1.25)); // ~18px +@font-size-h5: @font-size-base; +@font-size-h6: ceil((@font-size-base * 0.85)); // ~12px + +@line-height-base: 1.428571429; // 20/14 +@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px + +@headings-font-family: inherit; +@headings-font-weight: 500; +@headings-line-height: 1.1; +@headings-color: inherit; +{% endhighlight %} + +Two quick variables for customizing the location and filename of your icons.
+{% highlight css %} +@icon-font-path: "../fonts/"; +@icon-font-name: "glyphicons-halflings-regular"; +{% endhighlight %}} + +Components throughout Bootstrap make use of some default variables for setting common values. Here are the most commonly used.
+{% highlight css %} +@padding-base-vertical: 6px; +@padding-base-horizontal: 12px; + +@padding-large-vertical: 10px; +@padding-large-horizontal: 16px; + +@padding-small-vertical: 5px; +@padding-small-horizontal: 10px; + +@padding-xs-vertical: 1px; +@padding-xs-horizontal: 5px; + +@line-height-large: 1.33; +@line-height-small: 1.5; + +@border-radius-base: 4px; +@border-radius-large: 6px; +@border-radius-small: 3px; + +@component-active-color: #fff; +@component-active-bg: @brand-primary; + +@caret-width-base: 4px; +@caret-width-large: 5px; +{% endhighlight %}} + + +Vendor mixins are mixins to help support multiple browsers by including all relevant vendor prefixs in your compiled CSS.
+ + +Reset your components' box model with a single mixin. For context, see this helpful article from Mozilla.
+{% highlight css %} +.box-sizing(@box-model) { + -webkit-box-sizing: @box-model; // Safari <= 5 + -moz-box-sizing: @box-model; // Firefox <= 19 + box-sizing: @box-model; +} +{% endhighlight %} + +Today all modern browsers support the non-prefixed border-radius
property. As such, there is no .border-radius()
mixin, but Preboot does include shortcuts for quickly rounding two corners on a particular side of an object.
If your target audience is using the latest and greatest browsers and devices, be sure to just use the box-shadow
property on it's own. If you need support for older Android (pre-v4) and iOS devices (pre-iOS 5), use of the mixin to pick up the required -webkit
prefix.
Be sure to use rgba()
colors in your box shadows so they blend as seamlessly as possible with backgrounds.
Three mixins for flexibility. Set all transition information with one, or specify a separate delay and duration as needed.
+{% highlight css %} +.transition(@transition) { + -webkit-transition: @transition; + transition: @transition; +} +.transition-property(@transition-property) { + -webkit-transition-property: @transition-property; + transition-property: @transition-property; +} +.transition-delay(@transition-delay) { + -webkit-transition-delay: @transition-delay; + transition-delay: @transition-delay; +} +.transition-duration(@transition-duration) { + -webkit-transition-duration: @transition-duration; + transition-duration: @transition-duration; +} +.transition-transform(@transition) { + -webkit-transition: -webkit-transform @transition; + -moz-transition: -moz-transform @transition; + -o-transition: -o-transform @transition; + transition: transform @transition; +} +{% endhighlight %} + +Rorate, scale, translate (move), or skew any object.
+{% highlight css %} +.rotate(@degrees) { + -webkit-transform: rotate(@degrees); + -ms-transform: rotate(@degrees); // IE9 only + transform: rotate(@degrees); +} +.scale(@ratio; @ratio-y...) { + -webkit-transform: scale(@ratio, @ratio-y); + -ms-transform: scale(@ratio, @ratio-y); // IE9 only + transform: scale(@ratio, @ratio-y); +} +.translate(@x; @y) { + -webkit-transform: translate(@x, @y); + -ms-transform: translate(@x, @y); // IE9 only + transform: translate(@x, @y); +} +.skew(@x; @y) { + -webkit-transform: skew(@x, @y); + -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+ + transform: skew(@x, @y); +} +.translate3d(@x; @y; @z) { + -webkit-transform: translate3d(@x, @y, @z); + transform: translate3d(@x, @y, @z); +} + +.rotateX(@degrees) { + -webkit-transform: rotateX(@degrees); + -ms-transform: rotateX(@degrees); // IE9 only + transform: rotateX(@degrees); +} +.rotateY(@degrees) { + -webkit-transform: rotateY(@degrees); + -ms-transform: rotateY(@degrees); // IE9 only + transform: rotateY(@degrees); +} +.perspective(@perspective) { + -webkit-perspective: @perspective; + -moz-perspective: @perspective; + perspective: @perspective; +} +.perspective-origin(@perspective) { + -webkit-perspective-origin: @perspective; + -moz-perspective-origin: @perspective; + perspective-origin: @perspective; +} +.transform-origin(@origin) { + -webkit-transform-origin: @origin; + -moz-transform-origin: @origin; + -ms-transform-origin: @origin; // IE9 only + transform-origin: @origin; +} +{% endhighlight %} + +A single mixin for using all CSS3's animation properties in one declarations and other mixins for individual properties.
+{% highlight css %} +.animation(@animation) { + -webkit-animation: @animation; + animation: @animation; +} +.animation-name(@name) { + -webkit-animation-name: @name; + animation-name: @name; +} +.animation-duration(@duration) { + -webkit-animation-duration: @duration; + animation-duration: @duration; +} +.animation-timing-function(@timing-function) { + -webkit-animation-timing-function: @timing-function; + animation-timing-function: @timing-function; +} +.animation-delay(@delay) { + -webkit-animation-delay: @delay; + animation-delay: @delay; +} +.animation-iteration-count(@iteration-count) { + -webkit-animation-iteration-count: @iteration-count; + animation-iteration-count: @iteration-count; +} +.animation-direction(@direction) { + -webkit-animation-direction: @direction; + animation-direction: @direction; +} +{% endhighlight %} + +Set the opacity for all browsers and provide a filter
fallback for IE8.
Provide context for form controls within each field.
+{% highlight css %} +.placeholder(@color: @input-color-placeholder) { + &:-moz-placeholder { color: @color; } // Firefox 4-18 + &::-moz-placeholder { color: @color; } // Firefox 19+ + &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+ + &::-webkit-input-placeholder { color: @color; } // Safari and Chrome +} +{% endhighlight %} + +Generate columns via CSS within a single element.
+{% highlight css %} +.content-columns(@width; @count; @gap) { + -webkit-column-width: @width; + -moz-column-width: @width; + column-width: @width; + -webkit-column-count: @count; + -moz-column-count: @count; + column-count: @count; + -webkit-column-gap: @gap; + -moz-column-gap: @gap; + column-gap: @gap; +} +{% endhighlight %} + +Easily turn any two colors into a background gradient. Get more advanced and set a direction, use three colors, or use a radial gradient. With a single mixin you get all the prefixed syntaxes you'll need.
+{% highlight css %} +#gradient > .vertical(#333; #000); +#gradient > .horizontal(#333; #000); +#gradient > .radial(#333; #000); +{% endhighlight %} +You can also specify the angle of a standard two-color, linear gradient:
+{% highlight css %} +#gradient > .directional(#333; #000; 45deg); +{% endhighlight %} +If you need a barber-stripe style gradient, that's easy, too. Just specify a single color and we'll overlay a translucent white stripe.
+{% highlight css %} +#gradient > .striped(#333; #000; 45deg); +{% endhighlight %} +Up the ante and use three colors instead. Set the first color, the second color, the second color's color stop (a decimal value like 0.25), and the third color with these mixins:
+{% highlight css %} +#gradient > .vertical-three-colors(#777; #333; .25; #000); +#gradient > .horizontal-three-colors(#777; #333; .25; #000); +{% endhighlight %} +Heads up! Should you ever need to remove a gradient, be sure to remove any IE-specific filter
you may have added. You can do that by using .reset-filter()
mixin alignside background-image: none;
.
Utility mixins are mixins that combine otherwise unrelated CSS properties to achieve a specific goal or task.
+ +Forget adding class="clearfix"
to any element and instead add the .clearfix()
mixin where appropriate. Uses the micro clearfix from Nicolas Gallager.
Quickly center any element within its parent. Requires width
or max-width
to be set.
Specify the dimensions of an object more easily.
+{% highlight css %} +// Mixins +.size(@width; @height) { + width: @width; + height: @height; +} +.square(@size) { + .size(@size; @size); +} + +// Usage +.image { .size(400px; 300px); } +.avatar { .square(48px); } +{% endhighlight %} + +Easily configure the resize options for any textarea, or any other element. Defaults to normal browser behavior (both
).
Easily truncate text with an ellipsis with a single mixin. Requires element to be block
or inline-block
level.
Specify two image paths and the @1x image dimensions, and Preboot will provide an @2x media query. If you have many images to serve, consider writing your retina image CSS manually in a single media query.
+{% highlight css %} +.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { + background-image: url("@{file-1x}"); + + @media + only screen and (-webkit-min-device-pixel-ratio: 2), + only screen and ( min--moz-device-pixel-ratio: 2), + only screen and ( -o-min-device-pixel-ratio: 2/1), + only screen and ( min-device-pixel-ratio: 2), + only screen and ( min-resolution: 192dpi), + only screen and ( min-resolution: 2dppx) { + background-image: url("@{file-2x}"); + background-size: @width-1x @height-1x; + } +} + +// Usage +.jumbotron { + .retina-image("/img/bg-1x.png", "/img/bg-2x.png", 100px, 100px); +} +{% endhighlight %} +Modal backdrop background color
+Modal backdrop opacity
+Additionally, you may give a description of your modal dialog with aria-describedby
on .modal
.
Modals have two optional sizes, available via modifier classes to be placed on a .modal-dialog
.
The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds .model-open
to the <body>
to override default scrolling behavior and generates a .modal-backdrop
to provide a click area for dismissing shown modals when clicking outside the modal.