2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-05 16:42:29 +03:00

mobile-first navs, navbar, grids, and type

This commit is contained in:
Mark Otto
2013-01-15 17:55:14 -08:00
parent 094767fbfe
commit 85db846b65
12 changed files with 1623 additions and 48 deletions
+12 -2
View File
@@ -15,12 +15,22 @@
// Reset
@import "normalize.less";
// Core CSS
@import "scaffolding.less";
@import "type.less";
@import "code.less";
@import "grid.less";
// Components: common
@import "component-animations.less";
// Components: Nav
@import "navs.less";
@import "navbar.less";
/*
// Grid system and page structure
@import "scaffolding.less";
@import "grid.less";
// Base CSS
+3 -3
View File
@@ -16,9 +16,9 @@ pre {
// Inline code
code {
padding: 2px 4px;
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
white-space: nowrap;
}
+11 -1
View File
@@ -11,7 +11,7 @@
}
}
.collapse {
/*.collapse {
position: relative;
height: 0;
overflow: hidden;
@@ -19,4 +19,14 @@
&.in {
height: auto;
}
}*/
.collapse {
position: relative;
height: 0;
overflow: hidden;
.transition(height .35s ease);
}
.collapse.in {
height: auto;
}
+16 -1
View File
@@ -9,8 +9,23 @@
max-width: 940px;
}
// Mobile-first defaults
.row {
margin-left: -10px;
margin-right: -10px;
.clear_float();
}
[class^="span"] {
padding-left: 10px;
padding-right: 10px;
// Proper box-model (padding doesn't add to width)
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
// Fixed (940px)
#grid > .core(@grid-column-width, @grid-gutter-width, @grid-row-width);
// #grid > .core(@grid-column-width, @grid-gutter-width, @grid-row-width);
// Reset utility classes due to specificity
[class*="span"].pull-right {
+1 -1
View File
@@ -425,7 +425,7 @@
.container-fixed() {
margin-right: auto;
margin-left: auto;
.clearfix();
.clear_float();
}
// Make a Grid
+88 -1
View File
@@ -1,7 +1,92 @@
//
// Navbars (Redux)
// Navbars
// --------------------------------------------------
// Wrapper and base class
.navbar {
padding: 15px;
background-color: #eee;
.clear_float();
}
// Brand/project name
.navbar .brand {
display: inline-block;
padding: 7px 15px;
font-size: 18px;
font-weight: bold;
line-height: 1;
&:hover {
text-decoration: none;
background-color: #ddd;
}
}
// Responsive navbar button
.btn-navbar {
float: right;
padding: 10px 12px;
background-color: #ddd;
border: 0;
border-radius: 4px;
// Bars
.icon-bar {
display: block;
width: 20px;
height: 2px;
background-color: #fff;
border-radius: 1px;
}
.icon-bar + .icon-bar {
margin-top: 3px;
}
}
// Nav links
.navbar {
.nav {
margin-top: 15px; // space out from .navbar .brand and .btn-navbar
}
.nav > li > a {
line-height: 20px;
}
.nav > li > a:hover {
background-color: #ddd;
}
.nav > .active > a {
background-color: #ddd;
}
}
// Inverse navbar
.navbar-inverse {
background-color: #222;
.brand {
color: #fff;
&:hover {
background-color: #333;
}
}
.nav > li > a {
color: #fff;
}
.nav > li > a:hover {
background-color: #333;
}
.nav > .active > a {
background-color: #333;
}
.btn-navbar {
background-color: #444;
}
}
/*
// COMMON STYLES
// -------------
@@ -446,3 +531,5 @@
}
}
*/
+37 -5
View File
@@ -8,22 +8,52 @@
.nav {
margin-left: 0;
margin-bottom: @line-height-base;
margin-bottom: 0;
padding-left: 0; // Override default ul/ol
list-style: none;
.clearfix();
.clear_float();
}
.nav > li {
float: left;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 8px 12px;
padding: 10px 15px;
}
.nav > li > a:hover {
text-decoration: none;
background-color: @grayLighter;
}
// Lists
// -------------------------
.nav-list > li > a {
margin-bottom: -1px; // pull up the following link for a 1px border between
border: 1px solid #e5e5e5;
}
.nav-list > li:first-child > a {
border-top-left-radius: @border-radius-base;
border-top-right-radius: @border-radius-base;
}
.nav-list > li:last-child > a {
border-radius: 0 0 6px 6px;
border-bottom-left-radius: @border-radius-base;
border-bottom-right-radius: @border-radius-base;
}
.nav-list > .active > a,
.nav-list > .active > a:hover {
z-index: 2; // Bring active item forward so border sits on top of next element
color: #fff;
background-color: @link-color;
border-color: @link-color;
}
/*
// Prevent IE8 from misplacing imgs
// See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989
.nav > li > a > img {
@@ -55,9 +85,10 @@
.nav .divider {
.nav-divider();
}
*/
/*
// Tabs
// -------------------------
@@ -269,3 +300,4 @@
background-color: transparent;
cursor: default;
}
*/
+21
View File
@@ -6,9 +6,30 @@
// Body reset
// -------------------------
html {
font-size: 62.5%;
// Touch the Mobile Magic™
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
// Disable iOS/WinMobile font size changes
@media screen and (max-device-width: 480px) {
html {
-ms-text-size-adjust: none;
-webkit-text-size-adjust: none;
}
}
body {
margin: 0;
color: @text-color;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-size: 1.4rem;
line-height: 1.5;
background-color: @body-background;
}
+4 -3
View File
@@ -93,9 +93,10 @@ h4 small { font-size: @font-size-base; }
// --------------------------------------------------
// Unordered and Ordered lists
ul, ol {
ul,
ol {
padding: 0;
margin: 0 0 @line-height-base / 2 25px;
margin: 0 0 (@line-height-base / 2) 25px;
}
ul ul,
ul ol,
@@ -138,7 +139,7 @@ dd {
}
// Horizontal layout (like forms)
.dl-horizontal {
.clearfix(); // Ensure dl clears floats if empty dd elements present
.clear_float(); // Ensure dl clears floats if empty dd elements present
dt {
float: left;
width: @component-offset-horizontal - 20;
+1 -1
View File
@@ -46,7 +46,7 @@
@line-height-base: 20px;
@headings-font-family: inherit; // empty to use BS default, @font-family-base
@headings-font-weight: bold; // instead of browser default, bold
@headings-font-weight: 500;
// Component sizing