mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
471 lines
11 KiB
Plaintext
471 lines
11 KiB
Plaintext
/*!
|
|
* Bootstrap Responsive v2.0.0
|
|
*
|
|
* Copyright 2012 Twitter, Inc
|
|
* Licensed under the Apache License v2.0
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
|
*/
|
|
|
|
// Responsive.less
|
|
// For phone and tablet devices
|
|
// -------------------------------------------------------------
|
|
|
|
|
|
// REPEAT VARIABLES & MIXINS
|
|
// -------------------------
|
|
// Required since we compile the responsive stuff separately
|
|
|
|
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
|
|
@import "mixins.less";
|
|
|
|
|
|
// RESPONSIVE CLASSES
|
|
// ------------------
|
|
|
|
// Hide from screenreaders and browsers
|
|
// Credit: HTML5 Boilerplate
|
|
.hidden {
|
|
display: none;
|
|
visibility: hidden;
|
|
}
|
|
|
|
|
|
|
|
// UP TO LANDSCAPE PHONE
|
|
// ---------------------
|
|
|
|
@media (max-width: 480px) {
|
|
|
|
// Block level the page header small tag for readability
|
|
.page-header h1 small {
|
|
display: block;
|
|
line-height: @baseLineHeight;
|
|
}
|
|
|
|
// Make span* classes full width
|
|
input[class*="span"],
|
|
select[class*="span"],
|
|
textarea[class*="span"],
|
|
.uneditable-input {
|
|
display: block;
|
|
width: 100%;
|
|
height: 28px; /* Make inputs at least the height of their button counterpart */
|
|
/* Makes inputs behave like true block-level elements */
|
|
-webkit-box-sizing: border-box; /* Older Webkit */
|
|
-moz-box-sizing: border-box; /* Older FF */
|
|
-ms-box-sizing: border-box; /* IE8 */
|
|
box-sizing: border-box; /* CSS3 spec*/
|
|
}
|
|
// But don't let it screw up prepend/append inputs
|
|
.input-prepend input[class*="span"],
|
|
.input-append input[class*="span"] {
|
|
width: auto;
|
|
}
|
|
|
|
// Update checkboxes for iOS
|
|
input[type="checkbox"],
|
|
input[type="radio"] {
|
|
border: 1px solid #ccc;
|
|
}
|
|
|
|
// Remove the horizontal form styles
|
|
.form-horizontal .control-group > label {
|
|
float: none;
|
|
width: auto;
|
|
padding-top: 0;
|
|
text-align: left;
|
|
}
|
|
// Move over all input controls and content
|
|
.form-horizontal .controls {
|
|
margin-left: 0;
|
|
}
|
|
// Move the options list down to align with labels
|
|
.form-horizontal .control-list {
|
|
padding-top: 0; // has to be padding because margin collaspes
|
|
}
|
|
// Move over buttons in .form-actions to align with .controls
|
|
.form-horizontal .form-actions {
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
}
|
|
|
|
// Modals
|
|
.modal {
|
|
position: absolute;
|
|
top: 10px;
|
|
left: 10px;
|
|
right: 10px;
|
|
width: auto;
|
|
margin: 0;
|
|
&.fade.in { top: auto; }
|
|
}
|
|
.modal-header .close {
|
|
padding: 10px;
|
|
margin: -10px;
|
|
}
|
|
|
|
// Carousel
|
|
.carousel-caption {
|
|
position: static;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
|
|
// --------------------------------------------------
|
|
|
|
@media (max-width: 768px) {
|
|
// GRID & CONTAINERS
|
|
// -----------------
|
|
// Remove width from containers
|
|
.container {
|
|
width: auto;
|
|
padding: 0 20px;
|
|
}
|
|
// Fluid rows
|
|
.row-fluid {
|
|
width: 100%;
|
|
}
|
|
// Undo negative margin on rows
|
|
.row {
|
|
margin-left: 0;
|
|
}
|
|
// Make all columns even
|
|
.row > [class*="span"] {
|
|
float: none;
|
|
display: block;
|
|
width: auto;
|
|
margin: 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// PORTRAIT TABLET TO DEFAULT DESKTOP
|
|
// ----------------------------------
|
|
|
|
@media (min-width: 768px) and (max-width: 940px) {
|
|
|
|
// Reset grid variables
|
|
@gridColumns: 12;
|
|
@gridColumnWidth: 42px;
|
|
@gridGutterWidth: 20px;
|
|
@siteWidth: 724px;
|
|
|
|
// Bring grid mixins to recalculate widths
|
|
.columns(@columns: 1) {
|
|
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
|
}
|
|
.offset(@columns: 1) {
|
|
margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)) + (@gridGutterWidth * 2);
|
|
}
|
|
|
|
// 12cols at 44px wide with 20px gutters
|
|
.container {
|
|
width: @siteWidth;
|
|
padding-left: 20px;
|
|
padding-right: 20px;
|
|
}
|
|
|
|
// Default columns
|
|
.span1 { .columns(1); }
|
|
.span2 { .columns(2); }
|
|
.span3 { .columns(3); }
|
|
.span4 { .columns(4); }
|
|
.span5 { .columns(5); }
|
|
.span6 { .columns(6); }
|
|
.span7 { .columns(7); }
|
|
.span8 { .columns(8); }
|
|
.span9 { .columns(9); }
|
|
.span10 { .columns(10); }
|
|
.span11 { .columns(11); }
|
|
.span12 { .columns(12); }
|
|
|
|
// Offset column options
|
|
.offset1 { .offset(1); }
|
|
.offset2 { .offset(2); }
|
|
.offset3 { .offset(3); }
|
|
.offset4 { .offset(4); }
|
|
.offset5 { .offset(5); }
|
|
.offset6 { .offset(6); }
|
|
.offset7 { .offset(7); }
|
|
.offset8 { .offset(8); }
|
|
.offset9 { .offset(9); }
|
|
.offset10 { .offset(10); }
|
|
.offset11 { .offset(11); }
|
|
|
|
// FLUID GRID
|
|
// ----------
|
|
.row-fluid {
|
|
@gridColumnWidth: 5.801104972%;
|
|
@gridGutterWidth: 2.762430939%;
|
|
@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
|
|
@gridTotalWidth: @gridRowWidth;
|
|
|
|
width: 100% * ((@gridGutterWidth + @gridRowWidth)/@gridRowWidth);
|
|
margin-left: 0 - @gridGutterWidth;
|
|
|
|
// Redeclare the mixins
|
|
.gridColumn() {
|
|
float: left;
|
|
margin-left: @gridGutterWidth;
|
|
}
|
|
[class*="span"] {
|
|
.gridColumn();
|
|
}
|
|
.fluidColumns(@columns: 1) {
|
|
width: @gridTotalWidth * ((((@gridGutterWidth+@gridColumnWidth)*@columns)-@gridGutterWidth)/(@gridRowWidth+@gridGutterWidth));
|
|
}
|
|
// Redeclare the columns
|
|
.span1 { .fluidColumns(1); }
|
|
.span2 { .fluidColumns(2); }
|
|
.span3 { .fluidColumns(3); }
|
|
.span4 { .fluidColumns(4); }
|
|
.span5 { .fluidColumns(5); }
|
|
.span6 { .fluidColumns(6); }
|
|
.span7 { .fluidColumns(7); }
|
|
.span8 { .fluidColumns(8); }
|
|
.span9 { .fluidColumns(9); }
|
|
.span10 { .fluidColumns(10); }
|
|
.span11 { .fluidColumns(11); }
|
|
.span12 { .fluidColumns(12); }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// TABLETS AND BELOW
|
|
// -----------------
|
|
@media (max-width: 940px) {
|
|
|
|
// UNFIX THE TOPBAR
|
|
// ----------------
|
|
// Remove any padding from the body
|
|
body {
|
|
padding-top: 0;
|
|
}
|
|
// Unfix the navbar
|
|
.navbar-fixed-top {
|
|
position: static;
|
|
margin-bottom: @baseLineHeight;
|
|
}
|
|
.navbar-fixed-top .navbar-inner {
|
|
padding: 5px;
|
|
background-image: none;
|
|
}
|
|
.navbar .container {
|
|
padding: 0;
|
|
}
|
|
// Account for brand name
|
|
.navbar .brand {
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
margin: 0 0 0 -5px;
|
|
}
|
|
// Nav collapse clears brand
|
|
.navbar .nav-collapse {
|
|
clear: left;
|
|
}
|
|
// Block-level the nav
|
|
.navbar .nav {
|
|
float: none;
|
|
margin: 0 0 (@baseLineHeight / 2);
|
|
}
|
|
.navbar .nav > li {
|
|
float: none;
|
|
}
|
|
.navbar .nav > li > a {
|
|
margin-bottom: 2px;
|
|
}
|
|
.navbar .nav > .vertical-divider {
|
|
display: none;
|
|
}
|
|
// Nav and dropdown links in navbar
|
|
.navbar .nav > li > a,
|
|
.navbar .dropdown-menu a {
|
|
padding: 6px 15px;
|
|
font-weight: bold;
|
|
color: @navbarLinkColor;
|
|
.border-radius(3px);
|
|
}
|
|
.navbar .dropdown-menu li + li a {
|
|
margin-bottom: 2px;
|
|
}
|
|
.navbar .nav > li > a:hover,
|
|
.navbar .dropdown-menu a:hover {
|
|
background-color: @navbarBackground;
|
|
}
|
|
// Dropdowns in the navbar
|
|
.navbar .dropdown-menu {
|
|
position: static;
|
|
top: auto;
|
|
left: auto;
|
|
float: none;
|
|
display: block;
|
|
max-width: none;
|
|
margin: 0 15px;
|
|
padding: 0;
|
|
background-color: transparent;
|
|
border: none;
|
|
.border-radius(0);
|
|
.box-shadow(none);
|
|
}
|
|
.navbar .dropdown-menu:before,
|
|
.navbar .dropdown-menu:after {
|
|
display: none;
|
|
}
|
|
.navbar .dropdown-menu .divider {
|
|
display: none;
|
|
}
|
|
// Forms in navbar
|
|
.navbar-form,
|
|
.navbar-search {
|
|
float: none;
|
|
padding: (@baseLineHeight / 2) 15px;
|
|
margin: (@baseLineHeight / 2) 0;
|
|
border-top: 1px solid @navbarBackground;
|
|
border-bottom: 1px solid @navbarBackground;
|
|
@shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
|
|
.box-shadow(@shadow);
|
|
}
|
|
// Pull right (secondary) nav content
|
|
.navbar .nav.pull-right {
|
|
float: none;
|
|
margin-left: 0;
|
|
}
|
|
// Static navbar
|
|
.navbar-static .navbar-inner {
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
}
|
|
// Navbar button
|
|
.btn-navbar {
|
|
display: block;
|
|
}
|
|
|
|
// Hide everything in the navbar save .brand and toggle button */
|
|
.nav-collapse {
|
|
overflow: hidden;
|
|
height: 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// DEFAULT DESKTOP
|
|
// ---------------
|
|
|
|
@media (min-width: 940px) {
|
|
.nav-collapse.collapse {
|
|
height: auto !important;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// LARGE DESKTOP & UP
|
|
// ------------------
|
|
|
|
@media (min-width: 1200px) {
|
|
|
|
// Reset grid variables
|
|
@gridColumns: 12;
|
|
@gridColumnWidth: 70px;
|
|
@gridGutterWidth: 30px;
|
|
@siteWidth: 1170px;
|
|
|
|
// Thumbnails
|
|
.thumbnails {
|
|
margin-left: @gridGutterWidth * -1;
|
|
}
|
|
.thumbnails > li {
|
|
margin-left: @gridGutterWidth;
|
|
}
|
|
|
|
// Bring grid mixins to recalculate widths
|
|
.columns(@columns: 1) {
|
|
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
|
}
|
|
.offset(@columns: 1) {
|
|
margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)) + (@gridGutterWidth * 2);
|
|
}
|
|
.container {
|
|
width: @siteWidth;
|
|
}
|
|
.row {
|
|
margin-left: @gridGutterWidth * -1;
|
|
}
|
|
[class*="span"] {
|
|
margin-left: @gridGutterWidth;
|
|
}
|
|
|
|
// Default columns
|
|
.span1 { .columns(1); }
|
|
.span2 { .columns(2); }
|
|
.span3 { .columns(3); }
|
|
.span4 { .columns(4); }
|
|
.span5 { .columns(5); }
|
|
.span6 { .columns(6); }
|
|
.span7 { .columns(7); }
|
|
.span8 { .columns(8); }
|
|
.span9 { .columns(9); }
|
|
.span10 { .columns(10); }
|
|
.span11 { .columns(11); }
|
|
.span12 { .columns(12); }
|
|
|
|
// Offset column options
|
|
.offset1 { .offset(1); }
|
|
.offset2 { .offset(2); }
|
|
.offset3 { .offset(3); }
|
|
.offset4 { .offset(4); }
|
|
.offset5 { .offset(5); }
|
|
.offset6 { .offset(6); }
|
|
.offset7 { .offset(7); }
|
|
.offset8 { .offset(8); }
|
|
.offset9 { .offset(9); }
|
|
.offset10 { .offset(10); }
|
|
.offset11 { .offset(11); }
|
|
|
|
|
|
// FLUID GRID
|
|
// ----------
|
|
.row-fluid {
|
|
@gridColumnWidth: 5.982%;
|
|
@gridGutterWidth: 2.56%;
|
|
@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
|
|
@gridTotalWidth: @gridRowWidth;
|
|
|
|
width: 100% * ((@gridGutterWidth + @gridRowWidth)/@gridRowWidth);
|
|
margin-left: 0 - @gridGutterWidth;
|
|
|
|
// Redeclare the mixins
|
|
.gridColumn() {
|
|
float: left;
|
|
margin-left: @gridGutterWidth;
|
|
}
|
|
[class*="span"] {
|
|
.gridColumn();
|
|
}
|
|
.fluidColumns(@columns: 1) {
|
|
width: @gridTotalWidth * ((((@gridGutterWidth+@gridColumnWidth)*@columns)-@gridGutterWidth)/(@gridRowWidth+@gridGutterWidth));
|
|
}
|
|
// Redeclare the columns
|
|
.span1 { .fluidColumns(1); }
|
|
.span2 { .fluidColumns(2); }
|
|
.span3 { .fluidColumns(3); }
|
|
.span4 { .fluidColumns(4); }
|
|
.span5 { .fluidColumns(5); }
|
|
.span6 { .fluidColumns(6); }
|
|
.span7 { .fluidColumns(7); }
|
|
.span8 { .fluidColumns(8); }
|
|
.span9 { .fluidColumns(9); }
|
|
.span10 { .fluidColumns(10); }
|
|
.span11 { .fluidColumns(11); }
|
|
.span12 { .fluidColumns(12); }
|
|
}
|
|
}
|