From 782c994060a984c10d73fdd3cc8e3fe33a2e4477 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 20 Jan 2012 21:16:40 +0000 Subject: Remove global reset in favour of contextual reset. Rather than having a partial reset with individual elements having their styles built back up, only elements without replacement styles have specific properties 'reset'. This commit also includes: a correction to the font mixin arguments used on forms (the output is now valid CSS); the removal of `overflow-y:scroll` from the `html` element which is now known to cause some problems for jQuery modal plugins in Firefox. --- lib/forms.less | 13 ++++++++-- lib/reset.less | 69 ++++++++++++++++++---------------------------------- lib/scaffolding.less | 2 -- lib/tables.less | 9 +++++++ lib/type.less | 31 +++++++++++++++++------ 5 files changed, 66 insertions(+), 58 deletions(-) (limited to 'lib') diff --git a/lib/forms.less b/lib/forms.less index e956b0046..0cc7f2035 100644 --- a/lib/forms.less +++ b/lib/forms.less @@ -8,17 +8,25 @@ // Make all forms have space below them form { - margin-bottom: @baseLineHeight; + margin: 0 0 @baseLineHeight; +} + +fieldset { + padding: 0; + margin: 0; + border: 0; } // Groups of fields with labels on top (legends) legend { display: block; width: 100%; + padding: 0; margin-bottom: @baseLineHeight * 1.5; font-size: @baseFontSize * 1.5; line-height: @baseLineHeight * 2; color: @grayDark; + border: 0; border-bottom: 1px solid #eee; -webkit-margin-collapse: separate; } @@ -26,9 +34,10 @@ legend { // Set font for forms label, input, +button, select, textarea { - #font > .sans-serif(normal,@baseFontSize,@baseLineHeight); + #font > .sans-serif(@baseFontSize,normal,@baseLineHeight); } // Identify controls by their labels diff --git a/lib/reset.less b/lib/reset.less index 8fe04d6d1..31e7160f2 100644 --- a/lib/reset.less +++ b/lib/reset.less @@ -1,50 +1,10 @@ // Reset.less -// Props to Eric Meyer (meyerweb.com) for his CSS reset file. -// We're using an adapted version here that cuts out some of the reset HTML -// elements we will never need here (i.e., dfn, samp, etc). +// Adapted from Normalize.css http://github.com/necolas/normalize.css // ------------------------------------------------------------------------ - -// ERIC MEYER RESET -// -------------------------------------------------- - -html, body { margin: 0; padding: 0; } -h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, del, dfn, em, img, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, button, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; font-weight: normal; font-style: normal; font-size: 100%; line-height: 1; font-family: inherit; } -table { - max-width: 100%; - border-collapse: collapse; - border-spacing: 0; -} -ol, ul { list-style: none; } -q:before, q:after, blockquote:before, blockquote:after { content: ""; } - - -// Normalize.css -// Pulling in select resets form the normalize.css project -// -------------------------------------------------- - // Display in IE6-9 and FF3 // ------------------------- -// Source: http://github.com/necolas/normalize.css -html { - overflow-y: scroll; - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} -// Focus states -a:focus { - outline: thin dotted; -} -// Hover & Active -a:hover, -a:active { - outline: 0; -} -// Display in IE6-9 and FF3 -// ------------------------- -// Source: http://github.com/necolas/normalize.css article, aside, details, @@ -60,7 +20,7 @@ section { // Display block in IE6-9 and FF3 // ------------------------- -// Source: http://github.com/necolas/normalize.css + audio, canvas, video { @@ -71,14 +31,32 @@ video { // Prevents modern browsers from displaying 'audio' without controls // ------------------------- -// Source: http://github.com/necolas/normalize.css + audio:not([controls]) { display: none; } +// Base settings +// ------------------------- + +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +// Focus states +a:focus { + outline: thin dotted; +} +// Hover & Active +a:hover, +a:active { + outline: 0; +} + // Prevents sub and sup affecting line-height in all browsers // ------------------------- -// Source: http://github.com/necolas/normalize.css + sub, sup { position: relative; @@ -95,7 +73,7 @@ sub { // Img border in a's and image quality // ------------------------- -// Source: http://github.com/necolas/normalize.css + img { max-width: 100%; height: auto; @@ -105,7 +83,6 @@ img { // Forms // ------------------------- -// Source: http://github.com/necolas/normalize.css // Font size in all browsers, margin changes, misc consistency button, diff --git a/lib/scaffolding.less b/lib/scaffolding.less index a0d54a886..d6fac06f0 100644 --- a/lib/scaffolding.less +++ b/lib/scaffolding.less @@ -60,8 +60,6 @@ body { // Links a { - font-weight: inherit; - line-height: inherit; color: @linkColor; text-decoration: none; &:hover { diff --git a/lib/tables.less b/lib/tables.less index 29e1e2d46..98b2b9f92 100644 --- a/lib/tables.less +++ b/lib/tables.less @@ -4,6 +4,15 @@ // ---------------------------------------- +// BASE TABLES +// ----------------- + +table { + max-width: 100%; + border-collapse: collapse; + border-spacing: 0; +} + // BASELINE STYLES // --------------- diff --git a/lib/type.less b/lib/type.less index 707d2215d..e2049fb71 100644 --- a/lib/type.less +++ b/lib/type.less @@ -7,7 +7,7 @@ // --------- p { - margin-bottom: @baseLineHeight / 2; + margin: 0 0 @baseLineHeight / 2; font-family: @baseFontFamily; font-size: @baseFontSize; line-height: @baseLineHeight; @@ -17,15 +17,16 @@ p { } } - // HEADINGS // -------- h1, h2, h3, h4, h5, h6 { + margin: 0; font-weight: bold; color: @grayDark; text-rendering: optimizelegibility; // Fix the character spacing for headings small { + font-weight: normal; color: @grayLight; } } @@ -74,6 +75,7 @@ h6 { // Unordered and Ordered lists ul, ol { + padding: 0; margin: 0 0 @baseLineHeight / 2 25px; } ul ul, @@ -124,13 +126,10 @@ hr { // Emphasis strong { - font-style: inherit; font-weight: bold; } em { font-style: italic; - font-weight: inherit; - line-height: inherit; } .muted { color: @grayLight; @@ -146,8 +145,8 @@ abbr { // Blockquotes blockquote { - padding-left: 15px; - margin-bottom: @baseLineHeight; + padding: 0 0 0 15px; + margin: 0 0 @baseLineHeight; border-left: 5px solid #eee; p { margin-bottom: 0; @@ -176,11 +175,19 @@ blockquote { } } +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} + // Addresses address { display: block; margin-bottom: @baseLineHeight; line-height: @baseLineHeight; + font-style: normal; } // Inline and block code styles @@ -220,4 +227,12 @@ pre { padding: 0; background-color: transparent; } -} \ No newline at end of file +} + +small { + font-size: 100%; +} + +cite { + font-style: normal; +} -- cgit v1.2.3 From 00d925819405ef46fb09d4bef83761ea121a9364 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 23 Jan 2012 11:35:39 -0800 Subject: revert to negative margin on grid row --- lib/scaffolding.less | 5 +---- lib/thumbnails.less | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/scaffolding.less b/lib/scaffolding.less index 13f55026d..ff029e841 100644 --- a/lib/scaffolding.less +++ b/lib/scaffolding.less @@ -73,13 +73,10 @@ a { // ----------- // To customize the grid system, bring up the variables.less file and change the column count, size, and gutter there .row { + margin-left: @gridGutterWidth * -1; .clearfix(); } -[class*="span"]:first-child{ - margin-left: 0; -} - // Find all .span# classes within .row and give them the necessary properties for grid columns // (supported by all browsers back to IE7) // Credit to @dhg for the idea diff --git a/lib/thumbnails.less b/lib/thumbnails.less index 4f9c5f76d..0ba749059 100644 --- a/lib/thumbnails.less +++ b/lib/thumbnails.less @@ -8,7 +8,7 @@ } .thumbnails > li { float: left; - margin: 0 0 20px 20px; + margin: 0 0 @baseLineHeight 20px; } .thumbnail { display: block; -- cgit v1.2.3 From ff113acba88806380b995fba894d77b562ca0e0a Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 23 Jan 2012 12:21:00 -0800 Subject: cut margin in half on default forms --- lib/forms.less | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/forms.less b/lib/forms.less index 85bf26163..bf3dbe64c 100644 --- a/lib/forms.less +++ b/lib/forms.less @@ -463,13 +463,16 @@ select:focus:required:invalid { // Margin to space out fieldsets .control-group { - margin-bottom: @baseLineHeight; + margin-bottom: @baseLineHeight / 2; } // Horizontal-specific styles // -------------------------- .form-horizontal { + .control-group { + margin-bottom: @baseLineHeight; + } // Float the labels left .control-group > label { float: left; -- cgit v1.2.3 From 1fa2801c2f8ad1e3c319fd6fc0d2e8baddccf6cc Mon Sep 17 00:00:00 2001 From: Olivier Laviale Date: Mon, 23 Jan 2012 21:22:08 +0100 Subject: .alert-message no longer exists --- lib/buttons.less | 1 - 1 file changed, 1 deletion(-) (limited to 'lib') diff --git a/lib/buttons.less b/lib/buttons.less index 5da34a525..f13a9acbf 100644 --- a/lib/buttons.less +++ b/lib/buttons.less @@ -102,7 +102,6 @@ } } // Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons -:root .alert-message, :root .btn { border-radius: 0 \0; } -- cgit v1.2.3 From 1954cf001926a94f7a4d51f16beaf9f2ba671d13 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 23 Jan 2012 13:46:26 -0800 Subject: comment in forms' --- lib/forms.less | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/forms.less b/lib/forms.less index bf3dbe64c..be53c60cb 100644 --- a/lib/forms.less +++ b/lib/forms.less @@ -470,6 +470,7 @@ select:focus:required:invalid { // -------------------------- .form-horizontal { + // Increase spacing between groups .control-group { margin-bottom: @baseLineHeight; } -- cgit v1.2.3 From cd5ffbe39626303a395448a6c9a507f3ad04ff5e Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 23 Jan 2012 13:50:55 -0800 Subject: fix up the modals in responsive a bit --- lib/responsive.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/responsive.less b/lib/responsive.less index f5c23df3c..416a8da7b 100644 --- a/lib/responsive.less +++ b/lib/responsive.less @@ -97,11 +97,12 @@ // Modals .modal { - position: fixed; + position: absolute; top: 20px; left: 20px; right: 20px; width: auto; + margin: 0; &.fade.in { top: auto; } } .modal-header .close { -- cgit v1.2.3