diff options
| author | Jacob Thornton <[email protected]> | 2011-09-12 21:06:53 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-09-12 21:06:53 -0700 |
| commit | e34bc6e29400e12517fe215bf379f1bab13ab451 (patch) | |
| tree | 3d20f3e5a643c10456488366afba7cbc8e0abec8 /lib | |
| parent | 5ee11ec8bdba2e7d0d1cf95168f75905b61059fb (diff) | |
| parent | 206334ba70c22dc91ec9381f9693ed6356358994 (diff) | |
| download | bootstrap-e34bc6e29400e12517fe215bf379f1bab13ab451.tar.xz bootstrap-e34bc6e29400e12517fe215bf379f1bab13ab451.zip | |
Merge branch '1.3-wip' of github.com:twitter/bootstrap into 1.3-wip
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/adaptive.less | 57 | ||||
| -rw-r--r-- | lib/bootstrap.less | 8 | ||||
| -rw-r--r-- | lib/mixins.less (renamed from lib/preboot.less) | 91 | ||||
| -rw-r--r-- | lib/patterns.less | 39 | ||||
| -rw-r--r-- | lib/scaffolding.less | 1 | ||||
| -rw-r--r-- | lib/theme.less | 62 | ||||
| -rw-r--r-- | lib/variables.less | 60 |
7 files changed, 107 insertions, 211 deletions
diff --git a/lib/adaptive.less b/lib/adaptive.less deleted file mode 100644 index ef3054d3e..000000000 --- a/lib/adaptive.less +++ /dev/null @@ -1,57 +0,0 @@ -/* Responsive.less - * Adjusted grid styles to handle some common screen sizes - * ------------------------------------------------------- */ - - -// MOBILE PORTRAIT & LANDSCAPE -// --------------------------- -// For devices narrower than 480px -@media only screen and (max-width: 480px) { - - // Remove fixed width of containers - .container { - width: auto; - padding: 0 10px; - } - - // Undo the floating of columns - .row { - margin-left: 0; - } - .row [class^="span"] { - float: none; - width: 100%; - display: block; - margin-left: 0; - } - - // Stack form elements instead of floating them - fieldset legend { - margin-left: 0; - } - label { - float: none; - width: auto; - text-align: left; - } - div.input { - margin-left: 0; - width: 100%; - } - .input-xxlarge, - input.xxlarge, - textarea.xxlarge, - select.xxlarge { - width: 80%; - } - - // Adjust modal - .modal-backdrop { - padding: 10px; - } - .modal { - width: 100%; - margin: 0; - left: auto; - } -}
\ No newline at end of file diff --git a/lib/bootstrap.less b/lib/bootstrap.less index 364dafa5d..2f9ee80b8 100644 --- a/lib/bootstrap.less +++ b/lib/bootstrap.less @@ -12,9 +12,11 @@ // CSS Reset @import "reset.less"; -// Core -@import "preboot.less"; -@import "theme.less"; +// Core variables and mixins +@import "variables.less"; // Modify this for custom colors, font-sizes, etc +@import "mixins.less"; + +// Grid system and page structure @import "scaffolding.less"; // Styled patterns and elements diff --git a/lib/preboot.less b/lib/mixins.less index 2e2c21a5d..ca7893daf 100644 --- a/lib/preboot.less +++ b/lib/mixins.less @@ -1,63 +1,10 @@ -/* Preboot.less - * Variables and mixins to pre-ignite any new web development project - * ------------------------------------------------------------------ */ +/* Variables.less + * Snippets of reusable CSS to develop faster and keep code readable + * ----------------------------------------------------------------- */ -// VARIABLES -// --------- - -// Links -@linkColor: #0069d6; -@linkColorHover: darken(@linkColor, 15); - -// Grays -@black: #000; -@grayDark: lighten(@black, 25%); -@gray: lighten(@black, 50%); -@grayLight: lighten(@black, 75%); -@grayLighter: lighten(@black, 90%); -@white: #fff; - -// Accent Colors -@blue: #049CDB; -@blueDark: #0064CD; -@green: #46a546; -@red: #9d261d; -@yellow: #ffc40d; -@orange: #f89406; -@pink: #c3325f; -@purple: #7a43b6; - -// Baseline grid -@basefont: 13px; -@baseline: 18px; - -// Griditude -@gridColumns: 16; -@gridColumnWidth: 40px; -@gridGutterWidth: 20px; -@extraSpace: (@gridGutterWidth * 2); // For our grid calculations -@siteWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); - -// Color Scheme -// Use this to roll your own color schemes if you like (unused by Bootstrap by default) -@baseColor: @blue; // Set a base color -@complement: spin(@baseColor, 180); // Determine a complementary color -@split1: spin(@baseColor, 158); // Split complements -@split2: spin(@baseColor, -158); -@triad1: spin(@baseColor, 135); // Triads colors -@triad2: spin(@baseColor, -135); -@tetra1: spin(@baseColor, 90); // Tetra colors -@tetra2: spin(@baseColor, -90); -@analog1: spin(@baseColor, 22); // Analogs colors -@analog2: spin(@baseColor, -22); - - -// MIXINS -// ------ - // Clearfix for clearing floats like a boss h5bp.com/q -.clearfix { +.clearfix() { zoom: 1; &:before, &:after { @@ -72,7 +19,7 @@ } // Center-align a block level element -.center-block { +.center-block() { display: block; margin-left: auto; margin-right: auto; @@ -207,34 +154,6 @@ border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%); border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%); } -// Shared colors for buttons and alerts -.btn, -.alert-message { - // Set text color - &.danger, - &.danger:hover, - &.error, - &.error:hover, - &.success, - &.success:hover, - &.info, - &.info:hover { - color: @white - } - // Danger and error appear as red - &.danger, - &.error { - .gradientBar(#ee5f5b, #c43c35); - } - // Success appears as green - &.success { - .gradientBar(#62c462, #57a957); - } - // Info appears as a neutral blue - &.info { - .gradientBar(#5bc0de, #339bb9); - } -} // Gradients #gradient { diff --git a/lib/patterns.less b/lib/patterns.less index 82b7790b7..3e5e0114a 100644 --- a/lib/patterns.less +++ b/lib/patterns.less @@ -23,7 +23,9 @@ } // Hover and active states - a:hover, + // h3 for backwards compatibility + h3 a:hover, + .brand a:hover, ul .active > a { background-color: #333; background-color: rgba(255,255,255,.05); @@ -54,6 +56,7 @@ line-height: 40px; a:hover { background-color: transparent; + color: @white; } } @@ -485,6 +488,35 @@ footer { // BUTTON STYLES // ------------- +// Shared colors for buttons and alerts +.btn, +.alert-message { + // Set text color + &.danger, + &.danger:hover, + &.error, + &.error:hover, + &.success, + &.success:hover, + &.info, + &.info:hover { + color: @white + } + // Danger and error appear as red + &.danger, + &.error { + .gradientBar(#ee5f5b, #c43c35); + } + // Success appears as green + &.success { + .gradientBar(#62c462, #57a957); + } + // Info appears as a neutral blue + &.info { + .gradientBar(#5bc0de, #339bb9); + } +} + // Base .btn styles .btn { // Button Base @@ -729,14 +761,15 @@ input[type=submit].btn { // ------ .modal-backdrop { - background-color:#000; - &.fade { opacity: 0; } + background-color: #000; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; + // Fade for backdrop + &.fade { opacity: 0; } } .modal-backdrop, .modal-backdrop.fade.in { diff --git a/lib/scaffolding.less b/lib/scaffolding.less index 2dc67c653..f3cd103f2 100644 --- a/lib/scaffolding.less +++ b/lib/scaffolding.less @@ -75,6 +75,7 @@ a { // GRID SYSTEM // ----------- +// To customize the grid system, bring up the variables.less file and change the column count, size, and gutter there .row { .clearfix(); diff --git a/lib/theme.less b/lib/theme.less deleted file mode 100644 index b56111c06..000000000 --- a/lib/theme.less +++ /dev/null @@ -1,62 +0,0 @@ -/* Theme.less - * Customizable set of settings and tweaks for Bootstrap development - * ----------------------------------------------------------------- */ - - -/* - Why Theme.less? - --------------- - Theme is a layer that has been added to Bootstrap to simplify the customization process for developers and designers. The goal of Theme is to provide a single point of customization within Bootstrap so you don't have to modify the core files. - - How to use it - ------------- - We repeat the default variables' values here for easy replacement. Simply modify any of these values and recompile Bootstrap for a more customize look and feel. - - Extending it - ------------ - Feel free to create and add new variables and mixins here. The goal is to make this your playground and keep the core files intact. -*/ - - -// Font face, size, weight, and more -// --------------------------------- -@baseFontSize: 13px; // base font-size -@baseLineHeight: 18px; // base line-height of elements (incrementally increases with font-size) - - -// Link color -// ---------- -@linkColor: #0069d6; -// No need to specify a link hover color because we'll automatically do that for you in Preboot - - - - - - - - -// COMING SOON... -// -------------- - -@baseFontFace: "Helvetica"; - - -// Primary button color -// ----------------------------- -@primaryButtonColor: #333; - - -// Grid system -// --------------------------------- -// Griditude -@gridColumns: 16; -@gridColumnWidth: 40px; -@gridGutterWidth: 20px; - - -/* -TODO: -- add ability to set app/site-wide base font-face (need better variables: @baseFontSize, @baseFontFace, @baseLineHeight, etc) -- add new docs section for Theme.less -*/
\ No newline at end of file diff --git a/lib/variables.less b/lib/variables.less new file mode 100644 index 000000000..34000d066 --- /dev/null +++ b/lib/variables.less @@ -0,0 +1,60 @@ +/* Variables.less + * Variables to customize the look and feel of Bootstrap + * ----------------------------------------------------- */ + + +// Links +@linkColor: #0069d6; +@linkColorHover: darken(@linkColor, 15); + +// Grays +@black: #000; +@grayDark: lighten(@black, 25%); +@gray: lighten(@black, 50%); +@grayLight: lighten(@black, 75%); +@grayLighter: lighten(@black, 90%); +@white: #fff; + +// Accent Colors +@blue: #049CDB; +@blueDark: #0064CD; +@green: #46a546; +@red: #9d261d; +@yellow: #ffc40d; +@orange: #f89406; +@pink: #c3325f; +@purple: #7a43b6; + +// Baseline grid +@basefont: 13px; +@baseline: 18px; + +// Griditude +// Modify the grid styles in mixins.less +@gridColumns: 16; +@gridColumnWidth: 40px; +@gridGutterWidth: 20px; +@extraSpace: (@gridGutterWidth * 2); // For our grid calculations +@siteWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); + +// Color Scheme +// Use this to roll your own color schemes if you like (unused by Bootstrap by default) +@baseColor: @blue; // Set a base color +@complement: spin(@baseColor, 180); // Determine a complementary color +@split1: spin(@baseColor, 158); // Split complements +@split2: spin(@baseColor, -158); +@triad1: spin(@baseColor, 135); // Triads colors +@triad2: spin(@baseColor, -135); +@tetra1: spin(@baseColor, 90); // Tetra colors +@tetra2: spin(@baseColor, -90); +@analog1: spin(@baseColor, 22); // Analogs colors +@analog2: spin(@baseColor, -22); + + + +// More variables coming soon: +// - @basefont to @baseFontSize +// - @baseline to @baseLineHeight +// - @baseFontFamily +// - @primaryButtonColor +// - anything else? File an issue on GitHub
\ No newline at end of file |
