diff --git a/app/styles/about.sass b/app/styles/about.sass index 7d6889183..00c708381 100644 --- a/app/styles/about.sass +++ b/app/styles/about.sass @@ -3,9 +3,19 @@ @import "bootstrap/variables" .team-column - margin-left: 50px + padding-left: 0 + + ul.thumbnails + margin-left: 40px + padding: 0 + + li + list-style-type: none + padding-bottom: 20px + img float: left width: 150px height: 150px + diff --git a/app/styles/base.sass b/app/styles/base.sass index 136e5289e..9b9840fa6 100644 --- a/app/styles/base.sass +++ b/app/styles/base.sass @@ -7,8 +7,9 @@ h1 h2 h3 h4 #widget-bounds display: none -.navbar a.brand +.navbar a.navbar-brand padding: 4px 20px 0px 20px + margin-left: -20px .main-content-area position: relative @@ -21,7 +22,7 @@ h1 h2 h3 h4 .navbuttontext, .fancy-select .trigger font-family: 'Bangers', cursive font-size: 20px - font-weight: normal + font-weight: 400 letter-spacing: 1px .navbuttontext-user-name @@ -39,6 +40,9 @@ h1 h2 h3 h4 font-weight: normal font-size: 25px letter-spacing: 2px + color: $white + &:hover + color: #f8e413 .navbar .btn, .navbar .btn-group, .navbar .fancy-select margin-top: 13px @@ -55,14 +59,19 @@ h1 h2 h3 h4 #inner-content-wrapper background: url(/images/pages/base/background_texture.png) top center no-repeat -.navbar-inner +.navbar font-size: 25px a:not(.btn) line-height: 25px + .btn + font-size: 20px + padding: 4px 12px + .btn, .fancy-select float: right margin-left: 10px + line-height: 20px select opacity: 0 @@ -110,6 +119,8 @@ h1 h2 h3 h4 color: #ffffff cursor: pointer margin: 0px 10px + &:hover + color: $white a[data-toggle="modal"] cursor: pointer @@ -135,13 +146,16 @@ a[data-toggle="modal"] .selectable cursor: pointer -.modal +.modal-dialog padding: 5px background: transparent url(/images/pages/base/modal_background.png) background-size: 100% 100% border: 0 @include box-shadow(0 0 0 #000) + .modal-content + @include box-shadow(none) + .modal-header margin: 0 14px padding: 8px 0 @@ -214,7 +228,7 @@ table.table background-color: white .ui-autocomplete - z-index: $zindexAutocomplete + //z-index: $zindexAutocomplete div.fancy-select text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25) @@ -248,4 +262,4 @@ div.fancy-select .ui-slider border: 1px solid black .ui-slider-handle - border: 1px solid black !important + border: 1px solid black !important \ No newline at end of file diff --git a/app/styles/bootstrap-responsive.scss b/app/styles/bootstrap-responsive.scss deleted file mode 100644 index 6a1b58000..000000000 --- a/app/styles/bootstrap-responsive.scss +++ /dev/null @@ -1,48 +0,0 @@ -/*! - * Bootstrap Responsive v2.3.1 - * - * 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 -// For phone and tablet devices -// ------------------------------------------------------------- - - -// REPEAT VARIABLES & MIXINS -// ------------------------- -// Required since we compile the responsive stuff separately - -@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc -@import "bootstrap/mixins"; - - -// RESPONSIVE CLASSES -// ------------------ - -@import "bootstrap/responsive-utilities"; - - -// MEDIA QUERIES -// ------------------ - -// Large desktops -@import "bootstrap/responsive-1200px-min"; - -// Tablets to regular desktops -@import "bootstrap/responsive-768px-979px"; - -// Phones to portrait tablets and narrow desktops -@import "bootstrap/responsive-767px-max"; - - -// RESPONSIVE NAVBAR -// ------------------ - -// From 979px and below, show a button to toggle navbar contents -@import "bootstrap/responsive-navbar"; \ No newline at end of file diff --git a/app/styles/bootstrap.scss b/app/styles/bootstrap.scss index 01e64b022..457a7ab36 100644 --- a/app/styles/bootstrap.scss +++ b/app/styles/bootstrap.scss @@ -1,66 +1 @@ -/*! - * Bootstrap v2.3.1 - * - * 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. - */ - -// Core variables and mixins -@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc -@import "bootstrap/mixins"; - -// CSS Reset -@import "bootstrap/reset"; - -// Grid system and page structure -@import "bootstrap/scaffolding"; -@import "bootstrap/grid"; -@import "bootstrap/layouts"; - -// Base CSS -@import "bootstrap/type"; -@import "bootstrap/code"; -@import "bootstrap/forms"; -@import "bootstrap/tables"; - -// Components: common -@import "bootstrap/sprites"; -@import "bootstrap/dropdowns"; -@import "bootstrap/wells"; -@import "bootstrap/component-animations"; -@import "bootstrap/close"; - -// Components: Buttons & Alerts -@import "bootstrap/buttons"; -@import "bootstrap/button-groups"; -@import "bootstrap/alerts"; // Note: alerts share common CSS with buttons and thus have styles in _buttons.scss - -// Components: Nav -@import "bootstrap/navs"; -@import "bootstrap/navbar"; -@import "bootstrap/breadcrumbs"; -@import "bootstrap/pagination"; -@import "bootstrap/pager"; - -// Components: Popovers -@import "bootstrap/modals"; -@import "bootstrap/tooltip"; -@import "bootstrap/popovers"; - -// Components: Misc -@import "bootstrap/thumbnails"; -@import "bootstrap/media"; -@import "bootstrap/labels-badges"; -@import "bootstrap/progress-bars"; -@import "bootstrap/accordion"; -@import "bootstrap/carousel"; -@import "bootstrap/hero-unit"; - -// Addition: Bootswatch structural changes -@import "bootstrap/bootswatch"; - -// Utility classes -@import "bootstrap/utilities"; // Has to be last to override when necessary \ No newline at end of file +@import "bootstrap/bootstrap"; \ No newline at end of file diff --git a/app/styles/bootstrap/_alerts.scss b/app/styles/bootstrap/_alerts.scss index 65335110b..4685ac3a9 100644 --- a/app/styles/bootstrap/_alerts.scss +++ b/app/styles/bootstrap/_alerts.scss @@ -7,73 +7,61 @@ // ------------------------- .alert { - padding: 8px 35px 8px 14px; - margin-bottom: $baseLineHeight; - text-shadow: 0 1px 0 rgba(255,255,255,.5); - background-color: $warningBackground; - border: 1px solid $warningBorder; - @include border-radius($baseBorderRadius); -} -.alert, -.alert h4 { - // Specified for the h4 to prevent conflicts of changing $headingsColor - color: $warningText; -} -.alert h4 { - margin: 0; + padding: $alert-padding; + margin-bottom: $line-height-computed; + border: 1px solid transparent; + border-radius: $alert-border-radius; + + // Headings for larger alerts + h4 { + margin-top: 0; + // Specified for the h4 to prevent conflicts of changing $headings-color + color: inherit; + } + // Provide class for links that match alerts + .alert-link { + font-weight: $alert-link-font-weight; + } + + // Improve alignment and spacing of inner content + > p, + > ul { + margin-bottom: 0; + } + > p + p { + margin-top: 5px; + } } -// Adjust close link position -.alert .close { - position: relative; - top: -2px; - right: -21px; - line-height: $baseLineHeight; -} +// Dismissable alerts +// +// Expand the right padding and account for the close button's positioning. +.alert-dismissable { + padding-right: ($alert-padding + 20); + + // Adjust close link position + .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; + } +} // Alternate styles -// ------------------------- +// +// Generate contextual modifier classes for colorizing the alert. .alert-success { - background-color: $successBackground; - border-color: $successBorder; - color: $successText; -} -.alert-success h4 { - color: $successText; -} -.alert-danger, -.alert-error { - background-color: $errorBackground; - border-color: $errorBorder; - color: $errorText; -} -.alert-danger h4, -.alert-error h4 { - color: $errorText; + @include alert-variant($alert-success-bg, $alert-success-border, $alert-success-text); } .alert-info { - background-color: $infoBackground; - border-color: $infoBorder; - color: $infoText; + @include alert-variant($alert-info-bg, $alert-info-border, $alert-info-text); } -.alert-info h4 { - color: $infoText; +.alert-warning { + @include alert-variant($alert-warning-bg, $alert-warning-border, $alert-warning-text); } - - -// Block alerts -// ------------------------- - -.alert-block { - padding-top: 14px; - padding-bottom: 14px; -} -.alert-block > p, -.alert-block > ul { - margin-bottom: 0; -} -.alert-block p + p { - margin-top: 5px; +.alert-danger { + @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text); } diff --git a/app/styles/bootstrap/_badges.scss b/app/styles/bootstrap/_badges.scss new file mode 100644 index 000000000..1190d4e32 --- /dev/null +++ b/app/styles/bootstrap/_badges.scss @@ -0,0 +1,51 @@ +// +// Badges +// -------------------------------------------------- + + +// Base classes +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: $font-size-small; + font-weight: $badge-font-weight; + color: $badge-color; + line-height: $badge-line-height; + vertical-align: baseline; + white-space: nowrap; + text-align: center; + background-color: $badge-bg; + border-radius: $badge-border-radius; + + // Empty badges collapse automatically (not available in IE8) + &:empty { + display: none; + } + + // Quick fix for badges in buttons + .btn & { + position: relative; + top: -1px; + } +} + +// Hover state, but only for links +a.badge { + &:hover, + &:focus { + color: $badge-link-hover-color; + text-decoration: none; + cursor: pointer; + } +} + +// Account for counters in navs +a.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: $badge-active-color; + background-color: $badge-active-bg; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} diff --git a/app/styles/bootstrap/_bootswatch.scss b/app/styles/bootstrap/_bootswatch.scss index 65dd070ed..3f82b5882 100644 --- a/app/styles/bootstrap/_bootswatch.scss +++ b/app/styles/bootstrap/_bootswatch.scss @@ -14,11 +14,11 @@ // NAVBAR // ----------------------------------------------------- -.navbar { +.navbar { .brand { padding: 14px 20px 16px; - font-family: $headingsFontFamily; + font-family: $headings-font-family; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); } @@ -28,12 +28,12 @@ .nav > li > a { padding: 16px 10px 14px; - font-family: $headingsFontFamily; + font-family: $headings-font-family; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); } .search-query { - border: 1px solid darken($linkColor, 10%); + border: 1px solid darken($link-color, 10%); line-height: normal; } @@ -49,23 +49,22 @@ .navbar-inverse { .navbar-search .search-query { - color: $textColor; + color: $text-color; } } -@media (max-width: $navbarCollapseWidth) { +@media (max-width: $grid-float-breakpoint) { .navbar .nav-collapse { - .nav li > a { + .navbar-nav li > a { - font-family: $headingsFontFamily; + font-family: $headings-font-family; font-weight: normal; color: $white; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); &:hover { - background-color: #2B7CAC; } } @@ -93,7 +92,7 @@ .navbar-inverse .nav-collapse { .nav li > a { - color: $navbarInverseLinkColor; + color: $navbar-inverse-color; &:hover { background-color: rgba(0, 0, 0, 0.1); @@ -110,13 +109,13 @@ div.subnav { - font-family: $headingsFontFamily; + font-family: $headings-font-family; text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.2); } div.subnav-fixed { - top: $navbarHeight + 1; + top: $navbar-height + 1; } @@ -136,28 +135,30 @@ div.subnav-fixed { } } +//The following were oring buttonBackground + .btn-primary { - @include buttonBackground(lighten($btnPrimaryBackground, 5%), $btnPrimaryBackground); + @include button-background(lighten($btn-primary-bg, 5%), $btn-primary-bg); } .btn-info { - @include buttonBackground(lighten($btnInfoBackground, 5%), $btnInfoBackground); + @include button-background(lighten($btn-info-bg, 5%), $btn-info-bg); } .btn-success { - @include buttonBackground(lighten($btnSuccessBackground, 5%), $btnSuccessBackground); + @include button-background(lighten($btn-success-bg, 5%), $btn-success-bg); } .btn-warning { - @include buttonBackground(lighten($btnWarningBackground, 5%), $btnWarningBackground); + @include button-background(lighten($btn-warning-bg, 5%), $btn-warning-bg); } .btn-danger { - @include buttonBackground(lighten($btnDangerBackground, 5%), $btnDangerBackground); + @include button-background(lighten($btn-danger-bg, 5%), $btn-danger-bg); } .btn-inverse { - @include buttonBackground(lighten($btnInverseBackground, 5%), $btnInverseBackground); + @include button-background(lighten($btn-default-color, 5%), $btn-default-color);//this should be btn-inverse but I can't find it at the moment } // TABLES diff --git a/app/styles/bootstrap/_breadcrumbs.scss b/app/styles/bootstrap/_breadcrumbs.scss index cc3f327a5..c35ef9460 100644 --- a/app/styles/bootstrap/_breadcrumbs.scss +++ b/app/styles/bootstrap/_breadcrumbs.scss @@ -5,20 +5,19 @@ .breadcrumb { padding: 8px 15px; - margin: 0 0 $baseLineHeight; + margin-bottom: $line-height-computed; list-style: none; - background-color: #f5f5f5; - @include border-radius($baseBorderRadius); + background-color: $breadcrumb-bg; + border-radius: $border-radius-base; > li { display: inline-block; - @include ie7-inline-block(); - text-shadow: 0 1px 0 $white; - > .divider { + + li:before { + content: "#{$breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space padding: 0 5px; - color: #ccc; + color: $breadcrumb-color; } } - .active { - color: $grayLight; + > .active { + color: $breadcrumb-active-color; } } diff --git a/app/styles/bootstrap/_button-groups.scss b/app/styles/bootstrap/_button-groups.scss index 1b08d50f5..1fc6ae84c 100644 --- a/app/styles/bootstrap/_button-groups.scss +++ b/app/styles/bootstrap/_button-groups.scss @@ -2,90 +2,88 @@ // Button groups // -------------------------------------------------- - // Make the div behave like a button -.btn-group { +.btn-group, +.btn-group-vertical { position: relative; display: inline-block; - @include ie7-inline-block(); - font-size: 0; // remove as part 1 of font-size inline-block hack vertical-align: middle; // match .btn alignment given font-size hack above - white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page) - @include ie7-restore-left-whitespace(); + > .btn { + position: relative; + float: left; + // Bring the "active" button to the front + &:hover, + &:focus, + &:active, + &.active { + z-index: 2; + } + &:focus { + // Remove focus outline when dropdown JS adds it after closing the menu + outline: none; + } + } } -// Space out series of button groups -.btn-group + .btn-group { - margin-left: 5px; +// Prevent double borders when buttons are next to each other +.btn-group { + .btn + .btn, + .btn + .btn-group, + .btn-group + .btn, + .btn-group + .btn-group { + margin-left: -1px; + } } // Optional: Group multiple button groups together for a toolbar .btn-toolbar { - font-size: 0; // Hack to remove whitespace that results from using inline-block - margin-top: $baseLineHeight / 2; - margin-bottom: $baseLineHeight / 2; - > .btn + .btn, - > .btn-group + .btn, - > .btn + .btn-group { - margin-left: 5px; + @include clearfix(); + + .btn-group { + float: left; + } + // Space out series of button groups + > .btn, + > .btn-group { + + .btn, + + .btn-group { + margin-left: 5px; + } } } -// Float them, remove border radius, then re-add to first and last elements -.btn-group > .btn { - position: relative; - @include border-radius(0); -} -.btn-group > .btn + .btn { - margin-left: -1px; -} -.btn-group > .btn, -.btn-group > .dropdown-menu, -.btn-group > .popover { - font-size: $baseFontSize; // redeclare as part 2 of font-size inline-block hack -} - -// Reset fonts for other sizes -.btn-group > .btn-mini { - font-size: $fontSizeMini; -} -.btn-group > .btn-small { - font-size: $fontSizeSmall; -} -.btn-group > .btn-large { - font-size: $fontSizeLarge; +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; } // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match .btn-group > .btn:first-child { margin-left: 0; - @include border-top-left-radius($baseBorderRadius); - @include border-bottom-left-radius($baseBorderRadius); + &:not(:last-child):not(.dropdown-toggle) { + @include border-right-radius(0); + } } // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it -.btn-group > .btn:last-child, -.btn-group > .dropdown-toggle { - @include border-top-right-radius($baseBorderRadius); - @include border-bottom-right-radius($baseBorderRadius); -} -// Reset corners for large buttons -.btn-group > .btn.large:first-child { - margin-left: 0; - @include border-top-left-radius($borderRadiusLarge); - @include border-bottom-left-radius($borderRadiusLarge); -} -.btn-group > .btn.large:last-child, -.btn-group > .large.dropdown-toggle { - @include border-top-right-radius($borderRadiusLarge); - @include border-bottom-right-radius($borderRadiusLarge); +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + @include border-left-radius(0); } -// On hover/focus/active, bring the proper btn to front -.btn-group > .btn:hover, -.btn-group > .btn:focus, -.btn-group > .btn:active, -.btn-group > .btn.active { - z-index: 2; +// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group) +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child { + > .btn:last-child, + > .dropdown-toggle { + @include border-right-radius(0); + } +} +.btn-group > .btn-group:last-child > .btn:first-child { + @include border-left-radius(0); } // On active and open, don't show outline @@ -95,6 +93,14 @@ } +// Sizing +// +// Remix the default button sizing classes into new ones for easier manipulation. + +.btn-group-xs > .btn { @extend .btn-xs; } +.btn-group-sm > .btn { @extend .btn-sm; } +.btn-group-lg > .btn { @extend .btn-lg; } + // Split button dropdowns // ---------------------- @@ -103,127 +109,119 @@ .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; - @include box-shadow(inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)); - *padding-top: 5px; - *padding-bottom: 5px; } -.btn-group > .btn-mini + .dropdown-toggle { - padding-left: 5px; - padding-right: 5px; - *padding-top: 2px; - *padding-bottom: 2px; -} -.btn-group > .btn-small + .dropdown-toggle { - *padding-top: 5px; - *padding-bottom: 4px; -} -.btn-group > .btn-large + .dropdown-toggle { +.btn-group > .btn-lg + .dropdown-toggle { padding-left: 12px; padding-right: 12px; - *padding-top: 7px; - *padding-bottom: 7px; } -.btn-group.open { +// The clickable button for toggling the menu +// Remove the gradient and set the same inset shadow as the :active state +.btn-group.open .dropdown-toggle { + @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); - // The clickable button for toggling the menu - // Remove the gradient and set the same inset shadow as the :active state - .dropdown-toggle { - background-image: none; - @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)); - } - - // Keep the hover's background when dropdown is open - .btn.dropdown-toggle { - background-color: $btnBackgroundHighlight; - } - .btn-primary.dropdown-toggle { - background-color: $btnPrimaryBackgroundHighlight; - } - .btn-warning.dropdown-toggle { - background-color: $btnWarningBackgroundHighlight; - } - .btn-danger.dropdown-toggle { - background-color: $btnDangerBackgroundHighlight; - } - .btn-success.dropdown-toggle { - background-color: $btnSuccessBackgroundHighlight; - } - .btn-info.dropdown-toggle { - background-color: $btnInfoBackgroundHighlight; - } - .btn-inverse.dropdown-toggle { - background-color: $btnInverseBackgroundHighlight; + // Show no shadow for `.btn-link` since it has no other button styles. + &.btn-link { + @include box-shadow(none); } } // Reposition the caret .btn .caret { - margin-top: 8px; margin-left: 0; } // Carets in other button sizes -.btn-large .caret { - margin-top: 6px; -} -.btn-large .caret { - border-left-width: 5px; - border-right-width: 5px; - border-top-width: 5px; -} -.btn-mini .caret, -.btn-small .caret { - margin-top: 8px; +.btn-lg .caret { + border-width: $caret-width-large $caret-width-large 0; + border-bottom-width: 0; } // Upside down carets for .dropup -.dropup .btn-large .caret { - border-bottom-width: 5px; +.dropup .btn-lg .caret { + border-width: 0 $caret-width-large $caret-width-large; } - -// Account for other colors -.btn-primary, -.btn-warning, -.btn-danger, -.btn-info, -.btn-success, -.btn-inverse { - .caret { - border-top-color: $white; - border-bottom-color: $white; - } -} - - - // Vertical button groups // ---------------------- .btn-group-vertical { - display: inline-block; // makes buttons only take up the width they need - @include ie7-inline-block(); + > .btn, + > .btn-group, + > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; + } + + // Clear floats so dropdown menus can be properly placed + > .btn-group { + @include clearfix(); + > .btn { + float: none; + } + } + + > .btn + .btn, + > .btn + .btn-group, + > .btn-group + .btn, + > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; + } } + .btn-group-vertical > .btn { - display: block; - float: none; - max-width: 100%; - @include border-radius(0); + &:not(:first-child):not(:last-child) { + border-radius: 0; + } + &:first-child:not(:last-child) { + border-top-right-radius: $border-radius-base; + @include border-bottom-radius(0); + } + &:last-child:not(:first-child) { + border-bottom-left-radius: $border-radius-base; + @include border-top-radius(0); + } } -.btn-group-vertical > .btn + .btn { - margin-left: 0; - margin-top: -1px; +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; } -.btn-group-vertical > .btn:first-child { - @include border-radius($baseBorderRadius $baseBorderRadius 0 0); +.btn-group-vertical > .btn-group:first-child { + > .btn:last-child, + > .dropdown-toggle { + @include border-bottom-radius(0); + } } -.btn-group-vertical > .btn:last-child { - @include border-radius(0 0 $baseBorderRadius $baseBorderRadius); +.btn-group-vertical > .btn-group:last-child > .btn:first-child { + @include border-top-radius(0); } -.btn-group-vertical > .btn-large:first-child { - @include border-radius($borderRadiusLarge $borderRadiusLarge 0 0); + + + +// Justified button groups +// ---------------------- + +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; + > .btn, + > .btn-group { + float: none; + display: table-cell; + width: 1%; + } + > .btn-group .btn { + width: 100%; + } } -.btn-group-vertical > .btn-large:last-child { - @include border-radius(0 0 $borderRadiusLarge $borderRadiusLarge); + + +// Checkbox and radio options +[data-toggle="buttons"] > .btn > input[type="radio"], +[data-toggle="buttons"] > .btn > input[type="checkbox"] { + display: none; } diff --git a/app/styles/bootstrap/_buttons.scss b/app/styles/bootstrap/_buttons.scss index a92268b5f..0e862f587 100644 --- a/app/styles/bootstrap/_buttons.scss +++ b/app/styles/bootstrap/_buttons.scss @@ -6,109 +6,138 @@ // Base styles // -------------------------------------------------- -// Core .btn { display: inline-block; - @include ie7-inline-block(); - padding: 4px 12px; margin-bottom: 0; // For input.btn - font-size: $baseFontSize; - line-height: $baseLineHeight; + font-weight: $btn-font-weight; text-align: center; vertical-align: middle; cursor: pointer; - @include buttonBackground($btnBackground, $btnBackgroundHighlight, $grayDark, 0 1px 1px rgba(255,255,255,.75)); - border: 1px solid $btnBorder; - *border: 0; // Remove the border to prevent IE7's black border on input:focus - border-bottom-color: darken($btnBorder, 10%); - @include border-radius($baseBorderRadius); - @include ie7-restore-left-whitespace(); // Give IE7 some love - @include box-shadow(inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)); + background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 + border: 1px solid transparent; + white-space: nowrap; + @include button-size($padding-base-vertical, $padding-base-horizontal, $font-size-base, $line-height-base, $border-radius-base); + @include user-select(none); - // Hover/focus state - &:hover, - &:focus { - color: $grayDark; - text-decoration: none; - background-position: 0 -15px; - - // transition is only when going to hover/focus, otherwise the background - // behind the gradient (there for IE<=9 fallback) gets mismatched - @include transition(background-position .1s linear); - } - - // Focus state for keyboard and accessibility &:focus { @include tab-focus(); } - // Active state - &.active, - &:active { - background-image: none; - outline: 0; - @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)); + &:hover, + &:focus { + color: $btn-default-color; + text-decoration: none; } - // Disabled state - &.disabled, - &[disabled] { - cursor: default; + &:active, + &.active { + outline: 0; background-image: none; - @include opacity(65); + @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); + } + + &.disabled, + &[disabled], + fieldset[disabled] & { + cursor: not-allowed; + pointer-events: none; // Future-proof disabling of clicks + @include opacity(.65); @include box-shadow(none); } - } +// Alternate buttons +// -------------------------------------------------- + +.btn-default { + @include button-variant($btn-default-color, $btn-default-bg, $btn-default-border); +} +.btn-primary { + @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border); +} +// Warning appears as orange +.btn-warning { + @include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border); +} +// Danger and error appear as red +.btn-danger { + @include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border); +} +// Success appears as green +.btn-success { + @include button-variant($btn-success-color, $btn-success-bg, $btn-success-border); +} +// Info appears as blue-green +.btn-info { + @include button-variant($btn-info-color, $btn-info-bg, $btn-info-border); +} + + +// Link buttons +// ------------------------- + +// Make a button look and behave like a link +.btn-link { + color: $link-color; + font-weight: normal; + cursor: pointer; + border-radius: 0; + + &, + &:active, + &[disabled], + fieldset[disabled] & { + background-color: transparent; + @include box-shadow(none); + } + &, + &:hover, + &:focus, + &:active { + border-color: transparent; + } + &:hover, + &:focus { + color: $link-hover-color; + text-decoration: underline; + background-color: transparent; + } + &[disabled], + fieldset[disabled] & { + &:hover, + &:focus { + color: $btn-link-disabled-color; + text-decoration: none; + } + } +} + // Button Sizes // -------------------------------------------------- -// Large -.btn-large { - padding: $paddingLarge; - font-size: $fontSizeLarge; - @include border-radius($borderRadiusLarge); +.btn-lg { + // line-height: ensure even-numbered height of button next to large input + @include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large); } -.btn-large [class^="icon-"], -.btn-large [class*=" icon-"] { - margin-top: 4px; +.btn-sm { + // line-height: ensure proper height of button next to small input + @include button-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small); } - -// Small -.btn-small { - padding: $paddingSmall; - font-size: $fontSizeSmall; - @include border-radius($borderRadiusSmall); -} -.btn-small [class^="icon-"], -.btn-small [class*=" icon-"] { - margin-top: 0; -} -.btn-mini [class^="icon-"], -.btn-mini [class*=" icon-"] { - margin-top: -1px; -} - -// Mini -.btn-mini { - padding: $paddingMini; - font-size: $fontSizeMini; - @include border-radius($borderRadiusSmall); +.btn-xs { + @include button-size($padding-xs-vertical, $padding-xs-horizontal, $font-size-small, $line-height-small, $border-radius-small); } // Block button -// ------------------------- +// -------------------------------------------------- .btn-block { display: block; width: 100%; padding-left: 0; padding-right: 0; - @include box-sizing(border-box); } // Vertically space out multiple block buttons @@ -124,105 +153,3 @@ input[type="button"] { width: 100%; } } - - - -// Alternate buttons -// -------------------------------------------------- - -// Provide *some* extra contrast for those who can get it -.btn-primary.active, -.btn-warning.active, -.btn-danger.active, -.btn-success.active, -.btn-info.active, -.btn-inverse.active { - color: rgba(255,255,255,.75); -} - -// Set the backgrounds -// ------------------------- -.btn-primary { - @include buttonBackground($btnPrimaryBackground, $btnPrimaryBackgroundHighlight); -} -// Warning appears are orange -.btn-warning { - @include buttonBackground($btnWarningBackground, $btnWarningBackgroundHighlight); -} -// Danger and error appear as red -.btn-danger { - @include buttonBackground($btnDangerBackground, $btnDangerBackgroundHighlight); -} -// Success appears as green -.btn-success { - @include buttonBackground($btnSuccessBackground, $btnSuccessBackgroundHighlight); -} -// Info appears as a neutral blue -.btn-info { - @include buttonBackground($btnInfoBackground, $btnInfoBackgroundHighlight); -} -// Inverse appears as dark gray -.btn-inverse { - @include buttonBackground($btnInverseBackground, $btnInverseBackgroundHighlight); -} - - -// Cross-browser Jank -// -------------------------------------------------- - -button.btn, -input[type="submit"].btn { - - // Firefox 3.6 only I believe - &::-moz-focus-inner { - padding: 0; - border: 0; - } - - // IE7 has some default padding on button controls - *padding-top: 3px; - *padding-bottom: 3px; - - &.btn-large { - *padding-top: 7px; - *padding-bottom: 7px; - } - &.btn-small { - *padding-top: 3px; - *padding-bottom: 3px; - } - &.btn-mini { - *padding-top: 1px; - *padding-bottom: 1px; - } -} - - -// Link buttons -// -------------------------------------------------- - -// Make a button look and behave like a link -.btn-link, -.btn-link:active, -.btn-link[disabled] { - background-color: transparent; - background-image: none; - @include box-shadow(none); -} -.btn-link { - border-color: transparent; - cursor: pointer; - color: $linkColor; - @include border-radius(0); -} -.btn-link:hover, -.btn-link:focus { - color: $linkColorHover; - text-decoration: underline; - background-color: transparent; -} -.btn-link[disabled]:hover, -.btn-link[disabled]:focus { - color: $grayDark; - text-decoration: none; -} diff --git a/app/styles/bootstrap/_carousel.scss b/app/styles/bootstrap/_carousel.scss index 22eaddb90..1134a8e29 100644 --- a/app/styles/bootstrap/_carousel.scss +++ b/app/styles/bootstrap/_carousel.scss @@ -3,29 +3,25 @@ // -------------------------------------------------- +// Wrapper for the slide container and indicators .carousel { position: relative; - margin-bottom: $baseLineHeight; - line-height: 1; } .carousel-inner { + position: relative; overflow: hidden; width: 100%; - position: relative; -} - -.carousel-inner { > .item { display: none; position: relative; @include transition(.6s ease-in-out left); - // Account for jankitude on images + // Account for jankitude on images > img, > a > img { - display: block; + @include img-responsive(); line-height: 1; } } @@ -70,89 +66,167 @@ .carousel-control { position: absolute; - top: 40%; - left: 15px; - width: 40px; - height: 40px; - margin-top: -20px; - font-size: 60px; - font-weight: 100; - line-height: 30px; - color: $white; + top: 0; + left: 0; + bottom: 0; + width: $carousel-control-width; + @include opacity($carousel-control-opacity); + font-size: $carousel-control-font-size; + color: $carousel-control-color; text-align: center; - background: $grayDarker; - border: 3px solid $white; - @include border-radius(23px); - @include opacity(50); + text-shadow: $carousel-text-shadow; + // We can't have this transition here because WebKit cancels the carousel + // animation if you trip this while in the middle of another animation. - // we can't have this transition here - // because webkit cancels the carousel - // animation if you trip this while - // in the middle of another animation - // ;_; - // .transition(opacity .2s linear); - - // Reposition the right one + // Set gradients for backgrounds + &.left { + @include gradient-horizontal($start-color: rgba(0,0,0,.5), $end-color: rgba(0,0,0,.0001)); + } &.right { left: auto; - right: 15px; + right: 0; + @include gradient-horizontal($start-color: rgba(0,0,0,.0001), $end-color: rgba(0,0,0,.5)); } // Hover/focus state &:hover, &:focus { - color: $white; + outline: none; + color: $carousel-control-color; text-decoration: none; - @include opacity(90); + @include opacity(.9); + } + + // Toggles + .icon-prev, + .icon-next, + .glyphicon-chevron-left, + .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; + } + .icon-prev, + .glyphicon-chevron-left { + left: 50%; + } + .icon-next, + .glyphicon-chevron-right { + right: 50%; + } + .icon-prev, + .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + margin-left: -10px; + font-family: serif; + } + + .icon-prev { + &:before { + content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039) + } + } + .icon-next { + &:before { + content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A) + } } } -// Carousel indicator pips -// ----------------------------- +// Optional indicator pips +// +// Add an unordered list with the following class and add a list item for each +// slide your carousel holds. + .carousel-indicators { position: absolute; - top: 15px; - right: 15px; - z-index: 5; - margin: 0; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; list-style: none; + text-align: center; li { - display: block; - float: left; - width: 10px; + display: inline-block; + width: 10px; height: 10px; - margin-left: 5px; + margin: 1px; text-indent: -999px; - background-color: #ccc; - background-color: rgba(255,255,255,.25); - border-radius: 5px; + border: 1px solid $carousel-indicator-border-color; + border-radius: 10px; + cursor: pointer; + + // IE8-9 hack for event handling + // + // Internet Explorer 8-9 does not support clicks on elements without a set + // `background-color`. We cannot use `filter` since that's not viewed as a + // background color by the browser. Thus, a hack is needed. + // + // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we + // set alpha transparency for the best results possible. + background-color: #000 \9; // IE8 + background-color: rgba(0,0,0,0); // IE9 } .active { - background-color: #fff; + margin: 0; + width: 12px; + height: 12px; + background-color: $carousel-indicator-active-bg; } } -// Caption for text below images +// Optional captions // ----------------------------- - +// Hidden by default for smaller viewports .carousel-caption { position: absolute; - left: 0; - right: 0; - bottom: 0; - padding: 15px; - background: $grayDark; - background: rgba(0,0,0,.75); + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: $carousel-caption-color; + text-align: center; + text-shadow: $carousel-text-shadow; + & .btn { + text-shadow: none; // No shadow for button elements in carousel-caption + } } -.carousel-caption h4, -.carousel-caption p { - color: $white; - line-height: $baseLineHeight; -} -.carousel-caption h4 { - margin: 0 0 5px; -} -.carousel-caption p { - margin-bottom: 0; + + +// Scale up controls for tablets and up +@media screen and (min-width: $screen-sm-min) { + + // Scale up the controls a smidge + .carousel-control { + .glyphicons-chevron-left, + .glyphicons-chevron-right, + .icon-prev, + .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + margin-left: -15px; + font-size: 30px; + } + } + + // Show and left align the captions + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + + // Move up the indicators + .carousel-indicators { + bottom: 20px; + } } diff --git a/app/styles/bootstrap/_close.scss b/app/styles/bootstrap/_close.scss index ee14a6ba9..62ce30fa3 100644 --- a/app/styles/bootstrap/_close.scss +++ b/app/styles/bootstrap/_close.scss @@ -5,19 +5,22 @@ .close { float: right; - font-size: 20px; - font-weight: bold; - line-height: $baseLineHeight; - color: $black; - text-shadow: 0 1px 0 rgba(255,255,255,1); - @include opacity(20); + font-size: ($font-size-base * 1.5); + font-weight: $close-font-weight; + line-height: 1; + color: $close-color; + text-shadow: $close-text-shadow; + @include opacity(.2); + &:hover, &:focus { - color: $black; + color: $close-color; text-decoration: none; cursor: pointer; - @include opacity(40); + @include opacity(.5); } + + // [converter] extracted button& to button.close } // Additional properties for button version diff --git a/app/styles/bootstrap/_code.scss b/app/styles/bootstrap/_code.scss index b9e2f6f22..240dc1d14 100644 --- a/app/styles/bootstrap/_code.scss +++ b/app/styles/bootstrap/_code.scss @@ -1,61 +1,53 @@ // -// Code (inline and blocK) +// Code (inline and block) // -------------------------------------------------- // Inline and block code styles code, -pre { - padding: 0 3px 2px; - @include font-family-monospace; - font-size: $baseFontSize - 2; - color: $grayDark; - @include border-radius(3px); +kbd, +pre, +samp { + font-family: $font-family-monospace; } // Inline code code { padding: 2px 4px; - color: #d14; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; + font-size: 90%; + color: $code-color; + background-color: $code-bg; white-space: nowrap; + border-radius: $border-radius-base; } // Blocks of code pre { display: block; - padding: ($baseLineHeight - 1) / 2; - margin: 0 0 $baseLineHeight / 2; - font-size: $baseFontSize - 1; // 14px to 13px - line-height: $baseLineHeight; + padding: (($line-height-computed - 1) / 2); + margin: 0 0 ($line-height-computed / 2); + font-size: ($font-size-base - 1); // 14px to 13px + line-height: $line-height-base; word-break: break-all; word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; - background-color: #f5f5f5; - border: 1px solid #ccc; // fallback for IE7-8 - border: 1px solid rgba(0,0,0,.15); - @include border-radius($baseBorderRadius); - - // Make prettyprint styles more spaced out for readability - &.prettyprint { - margin-bottom: $baseLineHeight; - } + color: $pre-color; + background-color: $pre-bg; + border: 1px solid $pre-border-color; + border-radius: $border-radius-base; // Account for some code outputs that place code tags in pre tags code { padding: 0; + font-size: inherit; color: inherit; - white-space: pre; white-space: pre-wrap; background-color: transparent; - border: 0; + border-radius: 0; } } // Enable scrollable blocks of code .pre-scrollable { - max-height: 340px; + max-height: $pre-scrollable-max-height; overflow-y: scroll; } diff --git a/app/styles/bootstrap/_component-animations.scss b/app/styles/bootstrap/_component-animations.scss index 5ef86b097..86632fd34 100644 --- a/app/styles/bootstrap/_component-animations.scss +++ b/app/styles/bootstrap/_component-animations.scss @@ -2,6 +2,10 @@ // Component animations // -------------------------------------------------- +// Heads up! +// +// We don't use the `.opacity()` mixin here since it causes a bug with text +// fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. .fade { opacity: 0; @@ -12,11 +16,14 @@ } .collapse { + display: none; + &.in { + display: block; + } +} +.collapsing { position: relative; height: 0; overflow: hidden; @include transition(height .35s ease); - &.in { - height: auto; - } } diff --git a/app/styles/bootstrap/_dropdowns.scss b/app/styles/bootstrap/_dropdowns.scss index dbe1cb708..74502ce60 100644 --- a/app/styles/bootstrap/_dropdowns.scss +++ b/app/styles/bootstrap/_dropdowns.scss @@ -3,62 +3,47 @@ // -------------------------------------------------- -// Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns -.dropup, -.dropdown { - position: relative; -} -.dropdown-toggle { - // The caret makes the toggle a bit too tall in IE7 - *margin-bottom: -3px; -} -.dropdown-toggle:active, -.open .dropdown-toggle { - outline: 0; -} - // Dropdown arrow/caret -// -------------------- .caret { display: inline-block; width: 0; height: 0; - vertical-align: top; - border-top: 4px solid $black; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - content: ""; + margin-left: 2px; + vertical-align: middle; + border-top: $caret-width-base solid; + border-right: $caret-width-base solid transparent; + border-left: $caret-width-base solid transparent; } -// Place the caret -.dropdown .caret { - margin-top: 8px; - margin-left: 2px; +// The dropdown wrapper (div) +.dropdown { + position: relative; +} + +// Prevent the focus on the dropdown toggle when closing dropdowns +.dropdown-toggle:focus { + outline: 0; } // The dropdown menu (ul) -// ---------------------- .dropdown-menu { position: absolute; top: 100%; left: 0; - z-index: $zindexDropdown; + z-index: $zindex-dropdown; display: none; // none by default, but block on "open" of the menu float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; // override default ul list-style: none; - background-color: $dropdownBackground; - border: 1px solid #ccc; // Fallback for IE7-8 - border: 1px solid $dropdownBorder; - *border-right-width: 2px; - *border-bottom-width: 2px; - @include border-radius(6px); - @include box-shadow(0 5px 10px rgba(0,0,0,.2)); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + font-size: $font-size-base; + background-color: $dropdown-bg; + border: 1px solid $dropdown-fallback-border; // IE8 fallback + border: 1px solid $dropdown-border; + border-radius: $border-radius-base; + @include box-shadow(0 6px 12px rgba(0,0,0,.175)); + background-clip: padding-box; // Aligns the dropdown menu to right &.pull-right { @@ -68,7 +53,7 @@ // Dividers (basically an hr) within the dropdown .divider { - @include nav-divider($dropdownDividerTop, $dropdownDividerBottom); + @include nav-divider($dropdown-divider-bg); } // Links within the dropdown menu @@ -77,81 +62,106 @@ padding: 3px 20px; clear: both; font-weight: normal; - line-height: $baseLineHeight; - color: $dropdownLinkColor; - white-space: nowrap; + line-height: $line-height-base; + color: $dropdown-link-color; + white-space: nowrap; // prevent links from randomly breaking onto new lines } } // Hover/Focus state -// ----------- -.dropdown-menu > li > a:hover, -.dropdown-menu > li > a:focus, -.dropdown-submenu:hover > a, -.dropdown-submenu:focus > a { - text-decoration: none; - color: $dropdownLinkColorHover; - @include gradient-vertical($dropdownLinkBackgroundHover, darken($dropdownLinkBackgroundHover, 5%)); -} - -// Active state -// ------------ -.dropdown-menu > .active > a, -.dropdown-menu > .active > a:hover, -.dropdown-menu > .active > a:focus { - color: $dropdownLinkColorActive; - text-decoration: none; - outline: 0; - @include gradient-vertical($dropdownLinkBackgroundActive, darken($dropdownLinkBackgroundActive, 5%)); -} - -// Disabled state -// -------------- -// Gray out text and ensure the hover/focus state remains gray -.dropdown-menu > .disabled > a, -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - color: $grayLight; -} -// Nuke hover/focus effects -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - text-decoration: none; - background-color: transparent; - background-image: none; // Remove CSS gradient - @include reset-filter(); - cursor: default; -} - -// Open state for the dropdown -// --------------------------- -.open { - // IE7's z-index only goes to the nearest positioned ancestor, which would - // make the menu appear below buttons that appeared later on the page - *z-index: $zindexDropdown; - - & > .dropdown-menu { - display: block; +.dropdown-menu > li > a { + &:hover, + &:focus { + text-decoration: none; + color: $dropdown-link-hover-color; + background-color: $dropdown-link-hover-bg; } } +// Active state +.dropdown-menu > .active > a { + &, + &:hover, + &:focus { + color: $dropdown-link-active-color; + text-decoration: none; + outline: 0; + background-color: $dropdown-link-active-bg; + } +} + +// Disabled state +// +// Gray out text and ensure the hover/focus state remains gray + +.dropdown-menu > .disabled > a { + &, + &:hover, + &:focus { + color: $dropdown-link-disabled-color; + } +} +// Nuke hover/focus effects +.dropdown-menu > .disabled > a { + &:hover, + &:focus { + text-decoration: none; + background-color: transparent; + background-image: none; // Remove CSS gradient + @include reset-filter(); + cursor: not-allowed; + } +} + +// Open state for the dropdown +.open { + // Show the menu + > .dropdown-menu { + display: block; + } + + // Remove the outline when :focus is triggered + > a { + outline: 0; + } +} + +// Dropdown section headers +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: $font-size-small; + line-height: $line-height-base; + color: $dropdown-header-color; +} + +// Backdrop to catch body clicks on mobile, etc. +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: $zindex-dropdown - 10; +} + // Right aligned dropdowns -// --------------------------- .pull-right > .dropdown-menu { right: 0; left: auto; } // Allow for dropdowns to go bottom up (aka, dropup-menu) -// ------------------------------------------------------ +// // Just add .dropup after the standard .dropdown class and you're set, bro. // TODO: abstract this so that the navbar fixed styles are not placed here? + .dropup, .navbar-fixed-bottom .dropdown { // Reverse the caret .caret { border-top: 0; - border-bottom: 4px solid $black; + border-bottom: $caret-width-base solid; content: ""; } // Different positioning for bottom up menu @@ -162,76 +172,17 @@ } } -// Sub menus -// --------------------------- -.dropdown-submenu { - position: relative; -} -// Default dropdowns -.dropdown-submenu > .dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - @include border-radius(0 6px 6px 6px); -} -.dropdown-submenu:hover > .dropdown-menu { - display: block; -} -// Dropups -.dropup .dropdown-submenu > .dropdown-menu { - top: auto; - bottom: 0; - margin-top: 0; - margin-bottom: -2px; - @include border-radius(5px 5px 5px 0); -} +// Component alignment +// +// Reiterate per navbar.less and the modified component alignment there. -// Caret to indicate there is a submenu -.dropdown-submenu > a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: darken($dropdownBackground, 20%); - margin-top: 5px; - margin-right: -10px; -} -.dropdown-submenu:hover > a:after { - border-left-color: $dropdownLinkColorHover; -} - -// Left aligned submenus -.dropdown-submenu.pull-left { - // Undo the float - // Yes, this is awkward since .pull-left adds a float, but it sticks to our conventions elsewhere. - float: none; - - // Positioning the submenu - > .dropdown-menu { - left: -100%; - margin-left: 10px; - @include border-radius(6px 0 6px 6px); +@media (min-width: $grid-float-breakpoint) { + .navbar-right { + .dropdown-menu { + right: 0; + left: auto; + } } } -// Tweak nav headers -// ----------------- -// Increase padding from 15px to 20px on sides -.dropdown .dropdown-menu .nav-header { - padding-left: 20px; - padding-right: 20px; -} - -// Typeahead -// --------- -.typeahead { - z-index: 1051; - margin-top: 2px; // give it some space to breathe - @include border-radius($baseBorderRadius); -} diff --git a/app/styles/bootstrap/_forms.scss b/app/styles/bootstrap/_forms.scss index 6b05636cd..6f1383ec7 100644 --- a/app/styles/bootstrap/_forms.scss +++ b/app/styles/bootstrap/_forms.scss @@ -3,13 +3,9 @@ // -------------------------------------------------- -// GENERAL STYLES -// -------------- - -// Make all forms have space below them -form { - margin: 0 0 $baseLineHeight; -} +// Normalize non-controls +// +// Restyle and baseline non-control form elements. fieldset { padding: 0; @@ -17,153 +13,43 @@ fieldset { border: 0; } -// Groups of fields with labels on top (legends) legend { display: block; width: 100%; padding: 0; - margin-bottom: $baseLineHeight; - font-size: $baseFontSize * 1.5; - line-height: $baseLineHeight * 2; - color: $grayDark; + margin-bottom: $line-height-computed; + font-size: ($font-size-base * 1.5); + line-height: inherit; + color: $legend-color; border: 0; - border-bottom: 1px solid #e5e5e5; - - // Small - small { - font-size: $baseLineHeight * .75; - color: $grayLight; - } + border-bottom: 1px solid $legend-border-color; } -// Set font for forms -label, -input, -button, -select, -textarea { - @include font-shorthand($baseFontSize, normal, $baseLineHeight); // Set size, weight, line-height here -} -input, -button, -select, -textarea { - font-family: $baseFontFamily; // And only set font-family here for those that need it (note the missing label element) -} - -// Identify controls by their labels label { - display: block; - margin-bottom: 5px; -} - -// Form controls -// ------------------------- - -// Shared size and type resets -select, -textarea, -input[type="text"], -input[type="password"], -input[type="datetime"], -input[type="datetime-local"], -input[type="date"], -input[type="month"], -input[type="time"], -input[type="week"], -input[type="number"], -input[type="email"], -input[type="url"], -input[type="search"], -input[type="tel"], -input[type="color"], -.uneditable-input { display: inline-block; - height: $baseLineHeight; - padding: 4px 6px; - margin-bottom: $baseLineHeight / 2;; - font-size: $baseFontSize; - line-height: $baseLineHeight; - color: $gray; - @include border-radius($inputBorderRadius); - vertical-align: middle; + margin-bottom: 5px; + font-weight: bold; } -// Reset appearance properties for textual inputs and textarea -// Declare width for legacy (can't be on input[type=*] selectors or it's too specific) -input, -textarea, -.uneditable-input { - width: 206px; // plus 12px padding and 2px border -} -// Reset height since textareas have rows -textarea { - height: auto; -} -// Everything else -textarea, -input[type="text"], -input[type="password"], -input[type="datetime"], -input[type="datetime-local"], -input[type="date"], -input[type="month"], -input[type="time"], -input[type="week"], -input[type="number"], -input[type="email"], -input[type="url"], -input[type="search"], -input[type="tel"], -input[type="color"], -.uneditable-input { - background-color: $inputBackground; - border: 1px solid $inputBorder; - @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); - @include transition(border linear .2s, box-shadow linear .2s); - // Focus state - &:focus { - border-color: rgba(82,168,236,.8); - outline: 0; - outline: thin dotted \9; /* IE6-9 */ - @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)); - } +// Normalize form controls + +// Override content-box in Normalize (* isn't specific enough) +input[type="search"] { + @include box-sizing(border-box); } // Position radios and checkboxes better input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; - *margin-top: 0; /* IE7 */ margin-top: 1px \9; /* IE8-9 */ line-height: normal; } -// Reset width of input images, buttons, radios, checkboxes -input[type="file"], -input[type="image"], -input[type="submit"], -input[type="reset"], -input[type="button"], -input[type="radio"], -input[type="checkbox"] { - width: auto; // Override of generic input selector -} - // Set the height of select and file controls to match text inputs -select, input[type="file"] { - height: $inputHeight; /* In IE7, the height of the select element cannot be changed by height, only font-size */ - *margin-top: 4px; /* For IE7, add top margin to align select with labels */ - line-height: $inputHeight; -} - -// Make select elements obey height by applying a border -select { - width: 220px; // default input width + 10px of padding that doesn't get applied - border: 1px solid $inputBorder; - background-color: $inputBackground; // Chrome on Linux and Mobile Safari need background-color + display: block; } // Make multiple select elements height not fixed @@ -172,518 +58,317 @@ select[size] { height: auto; } +// Fix optgroup Firefox bug per https://github.com/twbs/bootstrap/issues/7611 +select optgroup { + font-size: inherit; + font-style: inherit; + font-family: inherit; +} + // Focus for select, file, radio, and checkbox -select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { @include tab-focus(); } - -// Uneditable inputs -// ------------------------- - -// Make uneditable inputs look inactive -.uneditable-input, -.uneditable-textarea { - color: $grayLight; - background-color: darken($inputBackground, 1%); - border-color: $inputBorder; - @include box-shadow(inset 0 1px 2px rgba(0,0,0,.025)); - cursor: not-allowed; +// Fix for Chrome number input +// Setting certain font-sizes causes the `I` bar to appear on hover of the bottom increment button. +// See https://github.com/twbs/bootstrap/issues/8350 for more. +input[type="number"] { + &::-webkit-outer-spin-button, + &::-webkit-inner-spin-button { + height: auto; + } } -// For text that needs to appear as an input but should not be an input -.uneditable-input { - overflow: hidden; // prevent text from wrapping, but still cut it off like an input does - white-space: nowrap; +// Adjust output element +output { + display: block; + padding-top: ($padding-base-vertical + 1); + font-size: $font-size-base; + line-height: $line-height-base; + color: $input-color; + vertical-align: middle; } -// Make uneditable textareas behave like a textarea -.uneditable-textarea { - width: auto; + +// Common form controls +// +// Shared size and type resets for form controls. Apply `.form-control` to any +// of the following form controls: +// +// select +// textarea +// input[type="text"] +// input[type="password"] +// input[type="datetime"] +// input[type="datetime-local"] +// input[type="date"] +// input[type="month"] +// input[type="time"] +// input[type="week"] +// input[type="number"] +// input[type="email"] +// input[type="url"] +// input[type="search"] +// input[type="tel"] +// input[type="color"] + +.form-control { + display: block; + width: 100%; + height: $input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border) + padding: $padding-base-vertical $padding-base-horizontal; + font-size: $font-size-base; + line-height: $line-height-base; + color: $input-color; + vertical-align: middle; + background-color: $input-bg; + background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 + border: 1px solid $input-border; + border-radius: $input-border-radius; + @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); + @include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s); + + // Customize the `:focus` state to imitate native WebKit styles. + @include form-control-focus(); + + // Placeholder + // + // Placeholder text gets special styles because when browsers invalidate entire + // lines if it doesn't understand a selector/ + @include placeholder(); + + // Disabled and read-only inputs + // Note: HTML5 says that controls under a fieldset > legend:first-child won't + // be disabled if the fieldset is disabled. Due to implementation difficulty, + // we don't honor that edge case; we style them as disabled anyway. + &[disabled], + &[readonly], + fieldset[disabled] & { + cursor: not-allowed; + background-color: $input-bg-disabled; + } + + // [converter] extracted textarea& to textarea.form-control +} + +// Reset height for `textarea`s +textarea.form-control { height: auto; } -// Placeholder -// ------------------------- +// Form groups +// +// Designed to help with the organization and spacing of vertical forms. For +// horizontal forms, use the predefined grid classes. -// Placeholder text gets special styles because when browsers invalidate entire lines if it doesn't understand a selector -input, -textarea { - @include placeholder(); +.form-group { + margin-bottom: 15px; } -// CHECKBOXES & RADIOS -// ------------------- +// Checkboxes and radios +// +// Indent the labels to position radios/checkboxes as hanging controls. -// Indent the labels to position radios/checkboxes as hanging .radio, .checkbox { - min-height: $baseLineHeight; // clear the floating input if there is no label text + display: block; + min-height: $line-height-computed; // clear the floating input if there is no label text + margin-top: 10px; + margin-bottom: 10px; padding-left: 20px; + vertical-align: middle; + label { + display: inline; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; + } } .radio input[type="radio"], -.checkbox input[type="checkbox"] { +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { float: left; margin-left: -20px; } - -// Move the options list down to align with labels -.controls > .radio:first-child, -.controls > .checkbox:first-child { - padding-top: 5px; // has to be padding because margin collaspes +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing } // Radios and checkboxes on same line -// TODO v3: Convert .inline to .control-inline -.radio.inline, -.checkbox.inline { +.radio-inline, +.checkbox-inline { display: inline-block; - padding-top: 5px; + padding-left: 20px; margin-bottom: 0; vertical-align: middle; + font-weight: normal; + cursor: pointer; } -.radio.inline + .radio.inline, -.checkbox.inline + .checkbox.inline { +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; margin-left: 10px; // space out consecutive inline controls } - - -// INPUT SIZES -// ----------- - -// General classes for quick sizes -.input-mini { width: 60px; } -.input-small { width: 90px; } -.input-medium { width: 150px; } -.input-large { width: 210px; } -.input-xlarge { width: 270px; } -.input-xxlarge { width: 530px; } - -// Grid style input sizes -input[class*="span"], -select[class*="span"], -textarea[class*="span"], -.uneditable-input[class*="span"], -// Redeclare since the fluid row class is more specific -.row-fluid input[class*="span"], -.row-fluid select[class*="span"], -.row-fluid textarea[class*="span"], -.row-fluid .uneditable-input[class*="span"] { - float: none; - margin-left: 0; -} -// Ensure input-prepend/append never wraps -.input-append input[class*="span"], -.input-append .uneditable-input[class*="span"], -.input-prepend input[class*="span"], -.input-prepend .uneditable-input[class*="span"], -.row-fluid input[class*="span"], -.row-fluid select[class*="span"], -.row-fluid textarea[class*="span"], -.row-fluid .uneditable-input[class*="span"], -.row-fluid .input-prepend [class*="span"], -.row-fluid .input-append [class*="span"] { - display: inline-block; -} - - - -// GRID SIZING FOR INPUTS -// ---------------------- - -// Grid sizes -@include grid-input($gridColumnWidth, $gridGutterWidth); - -// Control row for multiple inputs per line -.controls-row { - @include clearfix(); // Clear the float from controls -} - -// Float to collapse white-space for proper grid alignment -.controls-row [class*="span"], -// Redeclare the fluid grid collapse since we undo the float for inputs -.row-fluid .controls-row [class*="span"] { - float: left; -} -// Explicity set top padding on all checkboxes/radios, not just first-child -.controls-row .checkbox[class*="span"], -.controls-row .radio[class*="span"] { - padding-top: 5px; -} - - - - -// DISABLED STATE -// -------------- - -// Disabled and read-only inputs -input[disabled], -select[disabled], -textarea[disabled], -input[readonly], -select[readonly], -textarea[readonly] { - cursor: not-allowed; - background-color: $inputDisabledBackground; -} -// Explicitly reset the colors here -input[type="radio"][disabled], -input[type="checkbox"][disabled], -input[type="radio"][readonly], -input[type="checkbox"][readonly] { - background-color: transparent; -} - - - - -// FORM FIELD FEEDBACK STATES -// -------------------------- - -// Warning -.control-group.warning { - @include formFieldState($warningText, $warningText, $warningBackground); -} -// Error -.control-group.error { - @include formFieldState($errorText, $errorText, $errorBackground); -} -// Success -.control-group.success { - @include formFieldState($successText, $successText, $successBackground); -} -// Info -.control-group.info { - @include formFieldState($infoText, $infoText, $infoBackground); -} - -// HTML5 invalid states -// Shares styles with the .control-group.error above -input:focus:invalid, -textarea:focus:invalid, -select:focus:invalid { - color: #b94a48; - border-color: #ee5f5b; - &:focus { - border-color: darken(#ee5f5b, 10%); - @include box-shadow(0 0 6px lighten(#ee5f5b, 20%)); +// Apply same disabled cursor tweak as for inputs +// +// Note: Neither radios nor checkboxes can be readonly. +input[type="radio"], +input[type="checkbox"], +.radio, +.radio-inline, +.checkbox, +.checkbox-inline { + &[disabled], + fieldset[disabled] & { + cursor: not-allowed; } } +// Form control sizing + +@include input-size('.input-sm', $input-height-small, $padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small); + +@include input-size('.input-lg', $input-height-large, $padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large); -// FORM ACTIONS -// ------------ +// Form control feedback states +// +// Apply contextual and semantic states to individual form controls. -.form-actions { - padding: ($baseLineHeight - 1) 20px $baseLineHeight; - margin-top: $baseLineHeight; - margin-bottom: $baseLineHeight; - background-color: $formActionsBackground; - border-top: 1px solid #e5e5e5; - @include clearfix(); // Adding clearfix to allow for .pull-right button containers +// Warning +.has-warning { + @include form-control-validation($state-warning-text, $state-warning-text, $state-warning-bg); +} +// Error +.has-error { + @include form-control-validation($state-danger-text, $state-danger-text, $state-danger-bg); +} +// Success +.has-success { + @include form-control-validation($state-success-text, $state-success-text, $state-success-bg); } +// Static form control text +// +// Apply class to a `p` element to make any string of text align with labels in +// a horizontal form layout. -// HELP TEXT -// --------- - -.help-block, -.help-inline { - color: lighten($textColor, 15%); // lighten the text some for contrast +.form-control-static { + margin-bottom: 0; // Remove default margin from `p` } + +// Help text +// +// Apply to any element you wish to create light text for placement immediately +// below a form control. Use for general help, formatting, or instructional text. + .help-block { display: block; // account for any element using help-block - margin-bottom: $baseLineHeight / 2; -} - -.help-inline { - display: inline-block; - @include ie7-inline-block(); - vertical-align: middle; - padding-left: 5px; + margin-top: 5px; + margin-bottom: 10px; + color: lighten($text-color, 25%); // lighten the text some for contrast } -// INPUT GROUPS -// ------------ +// Inline forms +// +// Make forms appear inline(-block) by adding the `.form-inline` class. Inline +// forms begin stacked on extra small (mobile) devices and then go inline when +// viewports reach <768px. +// +// Requires wrapping inputs and labels with `.form-group` for proper display of +// default HTML form controls and our custom form controls (e.g., input groups). +// +// Heads up! This is mixin-ed into `.navbar-form` in navbars.less. -// Allow us to put symbols and text within the input field for a cleaner look -.input-append, -.input-prepend { - display: inline-block; - margin-bottom: $baseLineHeight / 2; - vertical-align: middle; - font-size: 0; // white space collapse hack - white-space: nowrap; // Prevent span and input from separating +.form-inline { - // Reset the white space collapse hack - input, - select, - .uneditable-input, - .dropdown-menu, - .popover { - font-size: $baseFontSize; - } + // Kick in the inline + @media (min-width: $screen-sm) { + // Inline-block all the things for "inline" + .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } - input, - select, - .uneditable-input { - position: relative; // placed here by default so that on :focus we can place the input above the .add-on for full border and box-shadow goodness - margin-bottom: 0; // prevent bottom margin from screwing up alignment in stacked forms - *margin-left: 0; - vertical-align: top; - @include border-radius(0 $inputBorderRadius $inputBorderRadius 0); - // Make input on top when focused so blue border and shadow always show - &:focus { - z-index: 2; + // In navbar-form, allow folks to *not* use `.form-group` + .form-control { + display: inline-block; + } + + // Override `width: 100%;` when not within a `.form-group` + select.form-control { + width: auto; + } + + // Remove default margin on radios/checkboxes that were used for stacking, and + // then undo the floating of radios and checkboxes to match (which also avoids + // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969). + .radio, + .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + } + .radio input[type="radio"], + .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; } } - .add-on { - display: inline-block; - width: auto; - height: $baseLineHeight; - min-width: 16px; - padding: 4px 5px; - font-size: $baseFontSize; - font-weight: normal; - line-height: $baseLineHeight; - text-align: center; - text-shadow: 0 1px 0 $white; - background-color: $grayLighter; - border: 1px solid #ccc; - } - .add-on, - .btn, - .btn-group > .dropdown-toggle { - vertical-align: top; - @include border-radius(0); - } - .active { - background-color: lighten($green, 30); - border-color: $green; - } -} - -.input-prepend { - .add-on, - .btn { - margin-right: -1px; - } - .add-on:first-child, - .btn:first-child { - // FYI, `.btn:first-child` accounts for a button group that's prepended - @include border-radius($inputBorderRadius 0 0 $inputBorderRadius); - } -} - -.input-append { - input, - select, - .uneditable-input { - @include border-radius($inputBorderRadius 0 0 $inputBorderRadius); - + .btn-group .btn:last-child { - @include border-radius(0 $inputBorderRadius $inputBorderRadius 0); - } - } - .add-on, - .btn, - .btn-group { - margin-left: -1px; - } - .add-on:last-child, - .btn:last-child, - .btn-group:last-child > .dropdown-toggle { - @include border-radius(0 $inputBorderRadius $inputBorderRadius 0); - } -} - -// Remove all border-radius for inputs with both prepend and append -.input-prepend.input-append { - input, - select, - .uneditable-input { - @include border-radius(0); - + .btn-group .btn { - @include border-radius(0 $inputBorderRadius $inputBorderRadius 0); - } - } - .add-on:first-child, - .btn:first-child { - margin-right: -1px; - @include border-radius($inputBorderRadius 0 0 $inputBorderRadius); - } - .add-on:last-child, - .btn:last-child { - margin-left: -1px; - @include border-radius(0 $inputBorderRadius $inputBorderRadius 0); - } - .btn-group:first-child { - margin-left: 0; - } } - - -// SEARCH FORM -// ----------- - -input.search-query { - padding-right: 14px; - padding-right: 4px \9; - padding-left: 14px; - padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */ - margin-bottom: 0; // Remove the default margin on all inputs - @include border-radius(15px); -} - -/* Allow for input prepend/append in search forms */ -.form-search .input-append .search-query, -.form-search .input-prepend .search-query { - @include border-radius(0); // Override due to specificity -} -.form-search .input-append .search-query { - @include border-radius(14px 0 0 14px); -} -.form-search .input-append .btn { - @include border-radius(0 14px 14px 0); -} -.form-search .input-prepend .search-query { - @include border-radius(0 14px 14px 0); -} -.form-search .input-prepend .btn { - @include border-radius(14px 0 0 14px); -} - - - - -// HORIZONTAL & VERTICAL FORMS -// --------------------------- - -// Common properties -// ----------------- - -.form-search, -.form-inline, -.form-horizontal { - input, - textarea, - select, - .help-inline, - .uneditable-input, - .input-prepend, - .input-append { - display: inline-block; - @include ie7-inline-block(); - margin-bottom: 0; - vertical-align: middle; - } - // Re-hide hidden elements due to specifity - .hide { - display: none; - } -} -.form-search label, -.form-inline label, -.form-search .btn-group, -.form-inline .btn-group { - display: inline-block; -} -// Remove margin for input-prepend/-append -.form-search .input-append, -.form-inline .input-append, -.form-search .input-prepend, -.form-inline .input-prepend { - margin-bottom: 0; -} -// Inline checkbox/radio labels (remove padding on left) -.form-search .radio, -.form-search .checkbox, -.form-inline .radio, -.form-inline .checkbox { - padding-left: 0; - margin-bottom: 0; - vertical-align: middle; -} -// Remove float and margin, set to inline-block -.form-search .radio input[type="radio"], -.form-search .checkbox input[type="checkbox"], -.form-inline .radio input[type="radio"], -.form-inline .checkbox input[type="checkbox"] { - float: left; - margin-right: 3px; - margin-left: 0; -} - - -// Margin to space out fieldsets -.control-group { - margin-bottom: $baseLineHeight / 2; -} - -// Legend collapses margin, so next element is responsible for spacing -legend + .control-group { - margin-top: $baseLineHeight; - -webkit-margin-top-collapse: separate; -} - -// Horizontal-specific styles -// -------------------------- +// Horizontal forms +// +// Horizontal forms are built on grid classes and allow you to create forms with +// labels on the left and inputs on the right. .form-horizontal { - // Increase spacing between groups - .control-group { - margin-bottom: $baseLineHeight; - @include clearfix(); - } - // Float the labels left - .control-label { - float: left; - width: $horizontalComponentOffset - 20; - padding-top: 5px; - text-align: right; - } - // Move over all input controls and content - .controls { - // Super jank IE7 fix to ensure the inputs in .input-append and input-prepend - // don't inherit the margin of the parent, in this case .controls - *display: inline-block; - *padding-left: 20px; - margin-left: $horizontalComponentOffset; - *margin-left: 0; - &:first-child { - *padding-left: $horizontalComponentOffset; - } - } - // Remove bottom margin on block level help text since that's accounted for on .control-group - .help-block { + + // Consistent vertical alignment of labels, radios, and checkboxes + .control-label, + .radio, + .checkbox, + .radio-inline, + .checkbox-inline { + margin-top: 0; margin-bottom: 0; + padding-top: ($padding-base-vertical + 1); // Default padding plus a border } - // And apply it only to .help-block instances that follow a form control - input, - select, - textarea, - .uneditable-input, - .input-prepend, - .input-append { - + .help-block { - margin-top: $baseLineHeight / 2; + // Account for padding we're adding to ensure the alignment and of help text + // and other content below items + .radio, + .checkbox { + min-height: $line-height-computed + ($padding-base-vertical + 1); + } + + // Make form groups behave like rows + .form-group { + @include make-row(); + } + + .form-control-static { + padding-top: ($padding-base-vertical + 1); + } + + // Only right align form labels here when the columns stop stacking + @media (min-width: $screen-sm-min) { + .control-label { + text-align: right; } } - // Move over buttons in .form-actions to align with .controls - .form-actions { - padding-left: $horizontalComponentOffset; - } } diff --git a/app/styles/bootstrap/_glyphicons.scss b/app/styles/bootstrap/_glyphicons.scss new file mode 100644 index 000000000..9ba2abd05 --- /dev/null +++ b/app/styles/bootstrap/_glyphicons.scss @@ -0,0 +1,237 @@ +// +// Glyphicons for Bootstrap +// +// Since icons are fonts, they can be placed anywhere text is placed and are +// thus automatically sized to match the surrounding child. To use, create an +// inline element with the appropriate classes, like so: +// +// <a href="#"><span class="glyphicon glyphicon-star"></span> Star</a> + +// Import the fonts +@font-face { + font-family: 'Glyphicons Halflings'; + src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot'), '#{$icon-font-path}#{$icon-font-name}.eot')); + src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot?#iefix'), '#{$icon-font-path}#{$icon-font-name}.eot?#iefix')) format('embedded-opentype'), + url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.woff'), '#{$icon-font-path}#{$icon-font-name}.woff')) format('woff'), + url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.ttf'), '#{$icon-font-path}#{$icon-font-name}.ttf')) format('truetype'), + url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.svg#glyphicons-halflingsregular'), '#{$icon-font-path}#{$icon-font-name}.svg#glyphicons-halflingsregular')) format('svg'); +} + +// Catchall baseclass +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + &:empty { + width: 1em; + } +} + +// Individual icons +.glyphicon-asterisk { &:before { content: "\2a"; } } +.glyphicon-plus { &:before { content: "\2b"; } } +.glyphicon-euro { &:before { content: "\20ac"; } } +.glyphicon-minus { &:before { content: "\2212"; } } +.glyphicon-cloud { &:before { content: "\2601"; } } +.glyphicon-envelope { &:before { content: "\2709"; } } +.glyphicon-pencil { &:before { content: "\270f"; } } +.glyphicon-glass { &:before { content: "\e001"; } } +.glyphicon-music { &:before { content: "\e002"; } } +.glyphicon-search { &:before { content: "\e003"; } } +.glyphicon-heart { &:before { content: "\e005"; } } +.glyphicon-star { &:before { content: "\e006"; } } +.glyphicon-star-empty { &:before { content: "\e007"; } } +.glyphicon-user { &:before { content: "\e008"; } } +.glyphicon-film { &:before { content: "\e009"; } } +.glyphicon-th-large { &:before { content: "\e010"; } } +.glyphicon-th { &:before { content: "\e011"; } } +.glyphicon-th-list { &:before { content: "\e012"; } } +.glyphicon-ok { &:before { content: "\e013"; } } +.glyphicon-remove { &:before { content: "\e014"; } } +.glyphicon-zoom-in { &:before { content: "\e015"; } } +.glyphicon-zoom-out { &:before { content: "\e016"; } } +.glyphicon-off { &:before { content: "\e017"; } } +.glyphicon-signal { &:before { content: "\e018"; } } +.glyphicon-cog { &:before { content: "\e019"; } } +.glyphicon-trash { &:before { content: "\e020"; } } +.glyphicon-home { &:before { content: "\e021"; } } +.glyphicon-file { &:before { content: "\e022"; } } +.glyphicon-time { &:before { content: "\e023"; } } +.glyphicon-road { &:before { content: "\e024"; } } +.glyphicon-download-alt { &:before { content: "\e025"; } } +.glyphicon-download { &:before { content: "\e026"; } } +.glyphicon-upload { &:before { content: "\e027"; } } +.glyphicon-inbox { &:before { content: "\e028"; } } +.glyphicon-play-circle { &:before { content: "\e029"; } } +.glyphicon-repeat { &:before { content: "\e030"; } } +.glyphicon-refresh { &:before { content: "\e031"; } } +.glyphicon-list-alt { &:before { content: "\e032"; } } +.glyphicon-lock { &:before { content: "\e033"; } } +.glyphicon-flag { &:before { content: "\e034"; } } +.glyphicon-headphones { &:before { content: "\e035"; } } +.glyphicon-volume-off { &:before { content: "\e036"; } } +.glyphicon-volume-down { &:before { content: "\e037"; } } +.glyphicon-volume-up { &:before { content: "\e038"; } } +.glyphicon-qrcode { &:before { content: "\e039"; } } +.glyphicon-barcode { &:before { content: "\e040"; } } +.glyphicon-tag { &:before { content: "\e041"; } } +.glyphicon-tags { &:before { content: "\e042"; } } +.glyphicon-book { &:before { content: "\e043"; } } +.glyphicon-bookmark { &:before { content: "\e044"; } } +.glyphicon-print { &:before { content: "\e045"; } } +.glyphicon-camera { &:before { content: "\e046"; } } +.glyphicon-font { &:before { content: "\e047"; } } +.glyphicon-bold { &:before { content: "\e048"; } } +.glyphicon-italic { &:before { content: "\e049"; } } +.glyphicon-text-height { &:before { content: "\e050"; } } +.glyphicon-text-width { &:before { content: "\e051"; } } +.glyphicon-align-left { &:before { content: "\e052"; } } +.glyphicon-align-center { &:before { content: "\e053"; } } +.glyphicon-align-right { &:before { content: "\e054"; } } +.glyphicon-align-justify { &:before { content: "\e055"; } } +.glyphicon-list { &:before { content: "\e056"; } } +.glyphicon-indent-left { &:before { content: "\e057"; } } +.glyphicon-indent-right { &:before { content: "\e058"; } } +.glyphicon-facetime-video { &:before { content: "\e059"; } } +.glyphicon-picture { &:before { content: "\e060"; } } +.glyphicon-map-marker { &:before { content: "\e062"; } } +.glyphicon-adjust { &:before { content: "\e063"; } } +.glyphicon-tint { &:before { content: "\e064"; } } +.glyphicon-edit { &:before { content: "\e065"; } } +.glyphicon-share { &:before { content: "\e066"; } } +.glyphicon-check { &:before { content: "\e067"; } } +.glyphicon-move { &:before { content: "\e068"; } } +.glyphicon-step-backward { &:before { content: "\e069"; } } +.glyphicon-fast-backward { &:before { content: "\e070"; } } +.glyphicon-backward { &:before { content: "\e071"; } } +.glyphicon-play { &:before { content: "\e072"; } } +.glyphicon-pause { &:before { content: "\e073"; } } +.glyphicon-stop { &:before { content: "\e074"; } } +.glyphicon-forward { &:before { content: "\e075"; } } +.glyphicon-fast-forward { &:before { content: "\e076"; } } +.glyphicon-step-forward { &:before { content: "\e077"; } } +.glyphicon-eject { &:before { content: "\e078"; } } +.glyphicon-chevron-left { &:before { content: "\e079"; } } +.glyphicon-chevron-right { &:before { content: "\e080"; } } +.glyphicon-plus-sign { &:before { content: "\e081"; } } +.glyphicon-minus-sign { &:before { content: "\e082"; } } +.glyphicon-remove-sign { &:before { content: "\e083"; } } +.glyphicon-ok-sign { &:before { content: "\e084"; } } +.glyphicon-question-sign { &:before { content: "\e085"; } } +.glyphicon-info-sign { &:before { content: "\e086"; } } +.glyphicon-screenshot { &:before { content: "\e087"; } } +.glyphicon-remove-circle { &:before { content: "\e088"; } } +.glyphicon-ok-circle { &:before { content: "\e089"; } } +.glyphicon-ban-circle { &:before { content: "\e090"; } } +.glyphicon-arrow-left { &:before { content: "\e091"; } } +.glyphicon-arrow-right { &:before { content: "\e092"; } } +.glyphicon-arrow-up { &:before { content: "\e093"; } } +.glyphicon-arrow-down { &:before { content: "\e094"; } } +.glyphicon-share-alt { &:before { content: "\e095"; } } +.glyphicon-resize-full { &:before { content: "\e096"; } } +.glyphicon-resize-small { &:before { content: "\e097"; } } +.glyphicon-exclamation-sign { &:before { content: "\e101"; } } +.glyphicon-gift { &:before { content: "\e102"; } } +.glyphicon-leaf { &:before { content: "\e103"; } } +.glyphicon-fire { &:before { content: "\e104"; } } +.glyphicon-eye-open { &:before { content: "\e105"; } } +.glyphicon-eye-close { &:before { content: "\e106"; } } +.glyphicon-warning-sign { &:before { content: "\e107"; } } +.glyphicon-plane { &:before { content: "\e108"; } } +.glyphicon-calendar { &:before { content: "\e109"; } } +.glyphicon-random { &:before { content: "\e110"; } } +.glyphicon-comment { &:before { content: "\e111"; } } +.glyphicon-magnet { &:before { content: "\e112"; } } +.glyphicon-chevron-up { &:before { content: "\e113"; } } +.glyphicon-chevron-down { &:before { content: "\e114"; } } +.glyphicon-retweet { &:before { content: "\e115"; } } +.glyphicon-shopping-cart { &:before { content: "\e116"; } } +.glyphicon-folder-close { &:before { content: "\e117"; } } +.glyphicon-folder-open { &:before { content: "\e118"; } } +.glyphicon-resize-vertical { &:before { content: "\e119"; } } +.glyphicon-resize-horizontal { &:before { content: "\e120"; } } +.glyphicon-hdd { &:before { content: "\e121"; } } +.glyphicon-bullhorn { &:before { content: "\e122"; } } +.glyphicon-bell { &:before { content: "\e123"; } } +.glyphicon-certificate { &:before { content: "\e124"; } } +.glyphicon-thumbs-up { &:before { content: "\e125"; } } +.glyphicon-thumbs-down { &:before { content: "\e126"; } } +.glyphicon-hand-right { &:before { content: "\e127"; } } +.glyphicon-hand-left { &:before { content: "\e128"; } } +.glyphicon-hand-up { &:before { content: "\e129"; } } +.glyphicon-hand-down { &:before { content: "\e130"; } } +.glyphicon-circle-arrow-right { &:before { content: "\e131"; } } +.glyphicon-circle-arrow-left { &:before { content: "\e132"; } } +.glyphicon-circle-arrow-up { &:before { content: "\e133"; } } +.glyphicon-circle-arrow-down { &:before { content: "\e134"; } } +.glyphicon-globe { &:before { content: "\e135"; } } +.glyphicon-wrench { &:before { content: "\e136"; } } +.glyphicon-tasks { &:before { content: "\e137"; } } +.glyphicon-filter { &:before { content: "\e138"; } } +.glyphicon-briefcase { &:before { content: "\e139"; } } +.glyphicon-fullscreen { &:before { content: "\e140"; } } +.glyphicon-dashboard { &:before { content: "\e141"; } } +.glyphicon-paperclip { &:before { content: "\e142"; } } +.glyphicon-heart-empty { &:before { content: "\e143"; } } +.glyphicon-link { &:before { content: "\e144"; } } +.glyphicon-phone { &:before { content: "\e145"; } } +.glyphicon-pushpin { &:before { content: "\e146"; } } +.glyphicon-usd { &:before { content: "\e148"; } } +.glyphicon-gbp { &:before { content: "\e149"; } } +.glyphicon-sort { &:before { content: "\e150"; } } +.glyphicon-sort-by-alphabet { &:before { content: "\e151"; } } +.glyphicon-sort-by-alphabet-alt { &:before { content: "\e152"; } } +.glyphicon-sort-by-order { &:before { content: "\e153"; } } +.glyphicon-sort-by-order-alt { &:before { content: "\e154"; } } +.glyphicon-sort-by-attributes { &:before { content: "\e155"; } } +.glyphicon-sort-by-attributes-alt { &:before { content: "\e156"; } } +.glyphicon-unchecked { &:before { content: "\e157"; } } +.glyphicon-expand { &:before { content: "\e158"; } } +.glyphicon-collapse-down { &:before { content: "\e159"; } } +.glyphicon-collapse-up { &:before { content: "\e160"; } } +.glyphicon-log-in { &:before { content: "\e161"; } } +.glyphicon-flash { &:before { content: "\e162"; } } +.glyphicon-log-out { &:before { content: "\e163"; } } +.glyphicon-new-window { &:before { content: "\e164"; } } +.glyphicon-record { &:before { content: "\e165"; } } +.glyphicon-save { &:before { content: "\e166"; } } +.glyphicon-open { &:before { content: "\e167"; } } +.glyphicon-saved { &:before { content: "\e168"; } } +.glyphicon-import { &:before { content: "\e169"; } } +.glyphicon-export { &:before { content: "\e170"; } } +.glyphicon-send { &:before { content: "\e171"; } } +.glyphicon-floppy-disk { &:before { content: "\e172"; } } +.glyphicon-floppy-saved { &:before { content: "\e173"; } } +.glyphicon-floppy-remove { &:before { content: "\e174"; } } +.glyphicon-floppy-save { &:before { content: "\e175"; } } +.glyphicon-floppy-open { &:before { content: "\e176"; } } +.glyphicon-credit-card { &:before { content: "\e177"; } } +.glyphicon-transfer { &:before { content: "\e178"; } } +.glyphicon-cutlery { &:before { content: "\e179"; } } +.glyphicon-header { &:before { content: "\e180"; } } +.glyphicon-compressed { &:before { content: "\e181"; } } +.glyphicon-earphone { &:before { content: "\e182"; } } +.glyphicon-phone-alt { &:before { content: "\e183"; } } +.glyphicon-tower { &:before { content: "\e184"; } } +.glyphicon-stats { &:before { content: "\e185"; } } +.glyphicon-sd-video { &:before { content: "\e186"; } } +.glyphicon-hd-video { &:before { content: "\e187"; } } +.glyphicon-subtitles { &:before { content: "\e188"; } } +.glyphicon-sound-stereo { &:before { content: "\e189"; } } +.glyphicon-sound-dolby { &:before { content: "\e190"; } } +.glyphicon-sound-5-1 { &:before { content: "\e191"; } } +.glyphicon-sound-6-1 { &:before { content: "\e192"; } } +.glyphicon-sound-7-1 { &:before { content: "\e193"; } } +.glyphicon-copyright-mark { &:before { content: "\e194"; } } +.glyphicon-registration-mark { &:before { content: "\e195"; } } +.glyphicon-cloud-download { &:before { content: "\e197"; } } +.glyphicon-cloud-upload { &:before { content: "\e198"; } } +.glyphicon-tree-conifer { &:before { content: "\e199"; } } +.glyphicon-tree-deciduous { &:before { content: "\e200"; } } diff --git a/app/styles/bootstrap/_grid.scss b/app/styles/bootstrap/_grid.scss index f2b910a16..3763e024e 100644 --- a/app/styles/bootstrap/_grid.scss +++ b/app/styles/bootstrap/_grid.scss @@ -2,20 +2,78 @@ // Grid system // -------------------------------------------------- +// Set the container width, and override it for fixed navbars in media queries +.container { + @include container-fixed(); -// Fixed (940px) -@include grid-core($gridColumnWidth, $gridGutterWidth); - -// Fluid (940px) -@include grid-fluid($fluidGridColumnWidth, $fluidGridGutterWidth); - -// Reset utility classes due to specificity -[class*="span"].hide, -.row-fluid [class*="span"].hide { - display: none; + @media (min-width: $screen-sm) { + width: $container-sm; + } + @media (min-width: $screen-md) { + width: $container-md; + } + @media (min-width: $screen-lg-min) { + width: $container-lg; + } } -[class*="span"].pull-right, -.row-fluid [class*="span"].pull-right { - float: right; +// mobile first defaults +.row { + @include make-row(); } + +// Common styles for small and large grid columns +@include make-grid-columns(); + + +// Extra small grid +// +// Columns, offsets, pushes, and pulls for extra small devices like +// smartphones. + +@include make-grid-columns-float(xs); +@include make-grid($grid-columns, xs, width); +@include make-grid($grid-columns, xs, pull); +@include make-grid($grid-columns, xs, push); +@include make-grid($grid-columns, xs, offset); + + +// Small grid +// +// Columns, offsets, pushes, and pulls for the small device range, from phones +// to tablets. + +@media (min-width: $screen-sm-min) { + @include make-grid-columns-float(sm); + @include make-grid($grid-columns, sm, width); + @include make-grid($grid-columns, sm, pull); + @include make-grid($grid-columns, sm, push); + @include make-grid($grid-columns, sm, offset); +} + + +// Medium grid +// +// Columns, offsets, pushes, and pulls for the desktop device range. + +@media (min-width: $screen-md-min) { + @include make-grid-columns-float(md); + @include make-grid($grid-columns, md, width); + @include make-grid($grid-columns, md, pull); + @include make-grid($grid-columns, md, push); + @include make-grid($grid-columns, md, offset); +} + + +// Large grid +// +// Columns, offsets, pushes, and pulls for the large desktop device range. + +@media (min-width: $screen-lg-min) { + @include make-grid-columns-float(lg); + @include make-grid($grid-columns, lg, width); + @include make-grid($grid-columns, lg, pull); + @include make-grid($grid-columns, lg, push); + @include make-grid($grid-columns, lg, offset); +} + diff --git a/app/styles/bootstrap/_input-groups.scss b/app/styles/bootstrap/_input-groups.scss new file mode 100644 index 000000000..4be458aa2 --- /dev/null +++ b/app/styles/bootstrap/_input-groups.scss @@ -0,0 +1,136 @@ +// +// Input groups +// -------------------------------------------------- + +// Base styles +// ------------------------- +.input-group { + position: relative; // For dropdowns + display: table; + border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table + + // Undo padding and float of grid classes + &[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; + } + + .form-control { + width: 100%; + margin-bottom: 0; + } +} + +// Sizing options +// +// Remix the default form control sizing classes into new ones for easier +// manipulation. + +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { @extend .input-lg; } +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { @extend .input-sm; } + + +// Display as table-cell +// ------------------------- +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; + + &:not(:first-child):not(:last-child) { + border-radius: 0; + } +} +// Addon and addon wrapper for buttons +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; // Match the inputs +} + +// Text input groups +// ------------------------- +.input-group-addon { + padding: $padding-base-vertical $padding-base-horizontal; + font-size: $font-size-base; + font-weight: normal; + line-height: 1; + color: $input-color; + text-align: center; + background-color: $input-group-addon-bg; + border: 1px solid $input-group-addon-border-color; + border-radius: $border-radius-base; + + // Sizing + &.input-sm { + padding: $padding-small-vertical $padding-small-horizontal; + font-size: $font-size-small; + border-radius: $border-radius-small; + } + &.input-lg { + padding: $padding-large-vertical $padding-large-horizontal; + font-size: $font-size-large; + border-radius: $border-radius-large; + } + + // Nuke default margins from checkboxes and radios to vertically center within. + input[type="radio"], + input[type="checkbox"] { + margin-top: 0; + } +} + +// Reset rounded corners +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) { + @include border-right-radius(0); +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child) { + @include border-left-radius(0); +} +.input-group-addon:last-child { + border-left: 0; +} + +// Button input groups +// ------------------------- +.input-group-btn { + position: relative; + white-space: nowrap; + + // Negative margin to only have a 1px border between the two + &:first-child > .btn { + margin-right: -1px; + } + &:last-child > .btn { + margin-left: -1px; + } +} +.input-group-btn > .btn { + position: relative; + // Jankily prevent input button groups from wrapping + + .btn { + margin-left: -4px; + } + // Bring the "active" button to the front + &:hover, + &:active { + z-index: 2; + } +} diff --git a/app/styles/bootstrap/_jumbotron.scss b/app/styles/bootstrap/_jumbotron.scss new file mode 100644 index 000000000..221a65d14 --- /dev/null +++ b/app/styles/bootstrap/_jumbotron.scss @@ -0,0 +1,46 @@ +// +// Jumbotron +// -------------------------------------------------- + + +.jumbotron { + padding: $jumbotron-padding; + margin-bottom: $jumbotron-padding; + font-size: $jumbotron-font-size; + font-weight: 200; + line-height: ($line-height-base * 1.5); + color: $jumbotron-color; + background-color: $jumbotron-bg; + + h1, + .h1 { + line-height: 1; + color: $jumbotron-heading-color; + } + p { + line-height: 1.4; + } + + .container & { + border-radius: $border-radius-large; // Only round corners at higher resolutions if contained in a container + } + + .container { + max-width: 100%; + } + + @media screen and (min-width: $screen-sm-min) { + padding-top: ($jumbotron-padding * 1.6); + padding-bottom: ($jumbotron-padding * 1.6); + + .container & { + padding-left: ($jumbotron-padding * 2); + padding-right: ($jumbotron-padding * 2); + } + + h1, + .h1 { + font-size: ($font-size-base * 4.5); + } + } +} diff --git a/app/styles/bootstrap/_labels.scss b/app/styles/bootstrap/_labels.scss new file mode 100644 index 000000000..8353eb1a6 --- /dev/null +++ b/app/styles/bootstrap/_labels.scss @@ -0,0 +1,64 @@ +// +// Labels +// -------------------------------------------------- + +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: $label-color; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; + + // Add hover effects, but only for links + &[href] { + &:hover, + &:focus { + color: $label-link-hover-color; + text-decoration: none; + cursor: pointer; + } + } + + // Empty labels collapse automatically (not available in IE8) + &:empty { + display: none; + } + + // Quick fix for labels in buttons + .btn & { + position: relative; + top: -1px; + } +} + +// Colors +// Contextual variations (linked labels get darker on :hover) + +.label-default { + @include label-variant($label-default-bg); +} + +.label-primary { + @include label-variant($label-primary-bg); +} + +.label-success { + @include label-variant($label-success-bg); +} + +.label-info { + @include label-variant($label-info-bg); +} + +.label-warning { + @include label-variant($label-warning-bg); +} + +.label-danger { + @include label-variant($label-danger-bg); +} diff --git a/app/styles/bootstrap/_list-group.scss b/app/styles/bootstrap/_list-group.scss new file mode 100644 index 000000000..19f85d44a --- /dev/null +++ b/app/styles/bootstrap/_list-group.scss @@ -0,0 +1,88 @@ +// +// List groups +// -------------------------------------------------- + +// Base class +// +// Easily usable on <ul>, <ol>, or <div>. +.list-group { + // No need to set list-style: none; since .list-group-item is block level + margin-bottom: 20px; + padding-left: 0; // reset padding because ul and ol +} + +// Individual list items +// ------------------------- + +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + // Place the border on the list items and negative margin up for better styling + margin-bottom: -1px; + background-color: $list-group-bg; + border: 1px solid $list-group-border; + + // Round the first and last items + &:first-child { + @include border-top-radius($list-group-border-radius); + } + &:last-child { + margin-bottom: 0; + @include border-bottom-radius($list-group-border-radius); + } + + // Align badges within list items + > .badge { + float: right; + } + > .badge + .badge { + margin-right: 5px; + } +} + +// Linked list items +a.list-group-item { + color: $list-group-link-color; + + .list-group-item-heading { + color: $list-group-link-heading-color; + } + + // Hover state + &:hover, + &:focus { + text-decoration: none; + background-color: $list-group-hover-bg; + } + + // Active class on item itself, not parent + &.active, + &.active:hover, + &.active:focus { + z-index: 2; // Place active items above their siblings for proper border styling + color: $list-group-active-color; + background-color: $list-group-active-bg; + border-color: $list-group-active-border; + + // Force color to inherit for custom content + .list-group-item-heading { + color: inherit; + } + .list-group-item-text { + color: lighten($list-group-active-bg, 40%); + } + } +} + +// Custom content options +// ------------------------- + +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} diff --git a/app/styles/bootstrap/_media.scss b/app/styles/bootstrap/_media.scss index e461e446d..5ad22cd6d 100644 --- a/app/styles/bootstrap/_media.scss +++ b/app/styles/bootstrap/_media.scss @@ -10,7 +10,6 @@ .media, .media-body { overflow: hidden; - *overflow: visible; zoom: 1; } @@ -37,11 +36,13 @@ // Media image alignment // ------------------------- -.media > .pull-left { - margin-right: 10px; -} -.media > .pull-right { - margin-left: 10px; +.media { + > .pull-left { + margin-right: 10px; + } + > .pull-right { + margin-left: 10px; + } } @@ -50,6 +51,6 @@ // Undo default ul/ol styles .media-list { - margin-left: 0; + padding-left: 0; list-style: none; } diff --git a/app/styles/bootstrap/_mixins.scss b/app/styles/bootstrap/_mixins.scss index 8959ee8e4..d9e1ba660 100644 --- a/app/styles/bootstrap/_mixins.scss +++ b/app/styles/bootstrap/_mixins.scss @@ -3,73 +3,48 @@ // -------------------------------------------------- -// UTILITY MIXINS -// -------------------------------------------------- +// Utilities +// ------------------------- // Clearfix -// -------- -// For clearing floats like a boss h5bp.com/q -@mixin clearfix { - *zoom: 1; +// Source: http://nicolasgallagher.com/micro-clearfix-hack/ +// +// For modern browsers +// 1. The space content is one way to avoid an Opera bug when the +// contenteditable attribute is included anywhere else in the document. +// Otherwise it causes space to appear at the top and bottom of elements +// that are clearfixed. +// 2. The use of `table` rather than `block` is only necessary if using +// `:before` to contain the top-margins of child elements. +@mixin clearfix() { &:before, &:after { - display: table; - content: ""; - // Fixes Opera/contenteditable bug: - // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952 - line-height: 0; + content: " "; // 1 + display: table; // 2 } &:after { clear: both; } } -// Webkit-style focus -// ------------------ +// WebKit-style focus @mixin tab-focus() { // Default - outline: thin dotted #333; - // Webkit + outline: thin dotted; + // WebKit outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } // Center-align a block level element -// ---------------------------------- @mixin center-block() { display: block; margin-left: auto; margin-right: auto; } -// IE7 inline-block -// ---------------- -@mixin ie7-inline-block() { - *display: inline; /* IE7 inline-block hack */ - *zoom: 1; -} - -// IE7 likes to collapse whitespace on either side of the inline-block elements. -// Ems because we're attempting to match the width of a space character. Left -// version is for form buttons, which typically come after other elements, and -// right version is for icons, which come before. Applying both is ok, but it will -// mean that space between those elements will be .6em (~2 space characters) in IE7, -// instead of the 1 space in other browsers. -@mixin ie7-restore-left-whitespace() { - *margin-left: .3em; - - &:first-child { - *margin-left: 0; - } -} - -@mixin ie7-restore-right-whitespace() { - *margin-right: .3em; -} - // Sizing shortcuts -// ------------------------- -@mixin size($height, $width) { +@mixin size($width, $height) { width: $width; height: $height; } @@ -78,21 +53,15 @@ } // Placeholder text -// ------------------------- -@mixin placeholder($color: $placeholderText) { - &:-moz-placeholder { - color: $color; - } - &:-ms-input-placeholder { - color: $color; - } - &::-webkit-input-placeholder { - color: $color; - } +@mixin placeholder($color: $input-color-placeholder) { + &:-moz-placeholder { color: $color; } // Firefox 4-18 + &::-moz-placeholder { color: $color; // Firefox 19+ + opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526 + &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+ + &::-webkit-input-placeholder { color: $color; } // Safari and Chrome } // Text overflow -// ------------------------- // Requires inline-block or block for proper styling @mixin text-overflow() { overflow: hidden; @@ -101,94 +70,25 @@ } // CSS image replacement -// ------------------------- +// +// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for +// mixins being reused as classes with the same name, this doesn't hold up. As +// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note +// that we cannot chain the mixins together in Less, so they are repeated. +// // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 -@mixin hide-text { - font: 0/0 a; + +// Deprecated as of v3.0.1 (will be removed in v4) +@mixin hide-text() { + font: #{0/0} a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } - - -// FONTS -// -------------------------------------------------- - -@mixin font-family-serif() { - font-family: $serifFontFamily; -} -@mixin font-family-sans-serif() { - font-family: $sansFontFamily; -} -@mixin font-family-monospace() { - font-family: $monoFontFamily; -} -@mixin font-shorthand($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) { - font-size: $size; - font-weight: $weight; - line-height: $lineHeight; -} -@mixin font-serif($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) { - @include font-family-serif(); - @include font-shorthand($size, $weight, $lineHeight); -} -@mixin font-sans-serif($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) { - @include font-family-sans-serif(); - @include font-shorthand($size, $weight, $lineHeight); -} -@mixin font-monospace($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) { - @include font-family-monospace(); - @include font-shorthand($size, $weight, $lineHeight); -} - - -// FORMS -// -------------------------------------------------- - -// Block level inputs -@mixin input-block-level { - display: block; - width: 100%; - min-height: $inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border) - @include box-sizing(border-box); // Makes inputs behave like true block-level elements -} - - - -// Mixin for form field states -@mixin formFieldState($textColor: #555, $borderColor: #ccc, $backgroundColor: #f5f5f5) { - // Set the text color - .control-label, - .help-block, - .help-inline { - color: $textColor; - } - // Style inputs accordingly - .checkbox, - .radio, - input, - select, - textarea { - color: $textColor; - } - input, - select, - textarea { - border-color: $borderColor; - @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work - &:focus { - border-color: darken($borderColor, 10%); - @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($borderColor, 20%)); - } - } - // Give a small background color for input-prepend/-append - .input-prepend .add-on, - .input-append .add-on { - color: $textColor; - background-color: $backgroundColor; - border-color: $textColor; - } +// New mixin to use as of v3.0.1 +@mixin text-hide() { + @include hide-text(); } @@ -196,144 +96,121 @@ // CSS3 PROPERTIES // -------------------------------------------------- -// Border Radius -@mixin border-radius($radius) { - -webkit-border-radius: $radius; - -moz-border-radius: $radius; - border-radius: $radius; -} - -// Single Corner Border Radius -@mixin border-top-left-radius($radius) { - -webkit-border-top-left-radius: $radius; - -moz-border-radius-topleft: $radius; - border-top-left-radius: $radius; -} -@mixin border-top-right-radius($radius) { - -webkit-border-top-right-radius: $radius; - -moz-border-radius-topright: $radius; - border-top-right-radius: $radius; -} -@mixin border-bottom-right-radius($radius) { - -webkit-border-bottom-right-radius: $radius; - -moz-border-radius-bottomright: $radius; - border-bottom-right-radius: $radius; -} -@mixin border-bottom-left-radius($radius) { - -webkit-border-bottom-left-radius: $radius; - -moz-border-radius-bottomleft: $radius; - border-bottom-left-radius: $radius; -} - -// Single Side Border Radius +// Single side border-radius @mixin border-top-radius($radius) { - @include border-top-right-radius($radius); - @include border-top-left-radius($radius); + border-top-right-radius: $radius; + border-top-left-radius: $radius; } @mixin border-right-radius($radius) { - @include border-top-right-radius($radius); - @include border-bottom-right-radius($radius); + border-bottom-right-radius: $radius; + border-top-right-radius: $radius; } @mixin border-bottom-radius($radius) { - @include border-bottom-right-radius($radius); - @include border-bottom-left-radius($radius); + border-bottom-right-radius: $radius; + border-bottom-left-radius: $radius; } @mixin border-left-radius($radius) { - @include border-top-left-radius($radius); - @include border-bottom-left-radius($radius); + border-bottom-left-radius: $radius; + border-top-left-radius: $radius; } // Drop shadows @mixin box-shadow($shadow...) { - -webkit-box-shadow: $shadow; - -moz-box-shadow: $shadow; + -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1 box-shadow: $shadow; } // Transitions @mixin transition($transition...) { -webkit-transition: $transition; - -moz-transition: $transition; - -o-transition: $transition; transition: $transition; } +@mixin transition-property($transition-property...) { + -webkit-transition-property: $transition-property; + transition-property: $transition-property; +} @mixin transition-delay($transition-delay) { -webkit-transition-delay: $transition-delay; - -moz-transition-delay: $transition-delay; - -o-transition-delay: $transition-delay; transition-delay: $transition-delay; } -@mixin transition-duration($transition-duration) { +@mixin transition-duration($transition-duration...) { -webkit-transition-duration: $transition-duration; - -moz-transition-duration: $transition-duration; - -o-transition-duration: $transition-duration; transition-duration: $transition-duration; } +@mixin transition-transform($transition...) { + -webkit-transition: -webkit-transform $transition; + -moz-transition: -moz-transform $transition; + -o-transition: -o-transform $transition; + transition: transform $transition; +} // Transformations @mixin rotate($degrees) { -webkit-transform: rotate($degrees); - -moz-transform: rotate($degrees); - -ms-transform: rotate($degrees); - -o-transform: rotate($degrees); + -ms-transform: rotate($degrees); // IE9+ transform: rotate($degrees); } @mixin scale($ratio) { -webkit-transform: scale($ratio); - -moz-transform: scale($ratio); - -ms-transform: scale($ratio); - -o-transform: scale($ratio); + -ms-transform: scale($ratio); // IE9+ transform: scale($ratio); } @mixin translate($x, $y) { -webkit-transform: translate($x, $y); - -moz-transform: translate($x, $y); - -ms-transform: translate($x, $y); - -o-transform: translate($x, $y); + -ms-transform: translate($x, $y); // IE9+ transform: translate($x, $y); } @mixin skew($x, $y) { -webkit-transform: skew($x, $y); - -moz-transform: skew($x, $y); - -ms-transform: skewX($x) skewY($y); // See https://github.com/twitter/bootstrap/issues/4885 - -o-transform: skew($x, $y); + -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+ transform: skew($x, $y); - -webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319 } @mixin translate3d($x, $y, $z) { -webkit-transform: translate3d($x, $y, $z); - -moz-transform: translate3d($x, $y, $z); - -o-transform: translate3d($x, $y, $z); transform: translate3d($x, $y, $z); } +@mixin rotateX($degrees) { + -webkit-transform: rotateX($degrees); + -ms-transform: rotateX($degrees); // IE9+ + transform: rotateX($degrees); +} +@mixin rotateY($degrees) { + -webkit-transform: rotateY($degrees); + -ms-transform: rotateY($degrees); // IE9+ + transform: rotateY($degrees); +} +@mixin perspective($perspective) { + -webkit-perspective: $perspective; + -moz-perspective: $perspective; + perspective: $perspective; +} +@mixin perspective-origin($perspective) { + -webkit-perspective-origin: $perspective; + -moz-perspective-origin: $perspective; + perspective-origin: $perspective; +} +@mixin transform-origin($origin) { + -webkit-transform-origin: $origin; + -moz-transform-origin: $origin; + transform-origin: $origin; +} + +// Animations +@mixin animation($animation) { + -webkit-animation: $animation; + animation: $animation; +} + // Backface visibility // Prevent browsers from flickering when using CSS 3D transforms. -// Default value is `visible`, but can be changed to `hidden -// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples +// Default value is `visible`, but can be changed to `hidden` @mixin backface-visibility($visibility){ -webkit-backface-visibility: $visibility; -moz-backface-visibility: $visibility; backface-visibility: $visibility; } -// Background clipping -// Heads up: FF 3.6 and under need "padding" instead of "padding-box" -@mixin background-clip($clip) { - -webkit-background-clip: $clip; - -moz-background-clip: $clip; - background-clip: $clip; -} - -// Background sizing -@mixin background-size($size) { - -webkit-background-size: $size; - -moz-background-size: $size; - -o-background-size: $size; - background-size: $size; -} - - // Box sizing @mixin box-sizing($boxmodel) { -webkit-box-sizing: $boxmodel; @@ -346,7 +223,7 @@ @mixin user-select($select) { -webkit-user-select: $select; -moz-user-select: $select; - -ms-user-select: $select; + -ms-user-select: $select; // IE10+ -o-user-select: $select; user-select: $select; } @@ -358,13 +235,13 @@ } // CSS3 Content Columns -@mixin content-columns($columnCount, $columnGap: $gridGutterWidth) { - -webkit-column-count: $columnCount; - -moz-column-count: $columnCount; - column-count: $columnCount; - -webkit-column-gap: $columnGap; - -moz-column-gap: $columnGap; - column-gap: $columnGap; +@mixin content-columns($column-count, $column-gap: $grid-gutter-width) { + -webkit-column-count: $column-count; + -moz-column-count: $column-count; + column-count: $column-count; + -webkit-column-gap: $column-gap; + -moz-column-gap: $column-gap; + column-gap: $column-gap; } // Optional hyphenation @@ -372,129 +249,255 @@ word-wrap: break-word; -webkit-hyphens: $mode; -moz-hyphens: $mode; - -ms-hyphens: $mode; + -ms-hyphens: $mode; // IE10+ -o-hyphens: $mode; hyphens: $mode; } // Opacity @mixin opacity($opacity) { - opacity: $opacity / 100; - filter: alpha(opacity=$opacity); + opacity: $opacity; + // IE8 filter + $opacity-ie: ($opacity * 100); + filter: #{alpha(opacity=$opacity-ie)}; } -// BACKGROUNDS +// GRADIENTS // -------------------------------------------------- -// Add an alphatransparency value to any background or border color (via Elyse Holladay) -@mixin translucent-background($color: $white, $alpha: 1) { - background-color: hsla(hue($color), saturation($color), lightness($color), $alpha); + + +// Horizontal gradient, from left to right +// +// Creates two color stops, start and end, by specifying a color and position for each color stop. +// Color stops are not available in IE9 and below. +@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { + background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1-6, Chrome 10+ + background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down } -@mixin translucent-border($color: $white, $alpha: 1) { - border-color: hsla(hue($color), saturation($color), lightness($color), $alpha); - @include background-clip(padding-box); +// Vertical gradient, from top to bottom +// +// Creates two color stops, start and end, by specifying a color and position for each color stop. +// Color stops are not available in IE9 and below. +@mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) { + background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+ + background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down } -// Gradient Bar Colors for buttons and alerts -@mixin gradientBar($primaryColor, $secondaryColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) { - color: $textColor; - text-shadow: $textShadow; - @include gradient-vertical($primaryColor, $secondaryColor); - border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%); - border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fade-in(rgba(0,0,0,.1), 0.15); -} - -// Gradients -@mixin gradient-horizontal($startColor: #555, $endColor: #333) { - background-color: $endColor; - background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+ - background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10 - background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10 +@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) { background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=1); // IE9 and down + background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+ + background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+ } -@mixin gradient-vertical($startColor: #555, $endColor: #333) { - background-color: mix($startColor, $endColor, 60%); - background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+ - background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), to($endColor)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10 - background-image: linear-gradient(to bottom, $startColor, $endColor); // Standard, IE10 - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=0); // IE9 and down -} -@mixin gradient-directional($startColor: #555, $endColor: #333, $deg: 45deg) { - background-color: $endColor; - background-repeat: repeat-x; - background-image: -moz-linear-gradient($deg, $startColor, $endColor); // FF 3.6+ - background-image: -webkit-linear-gradient($deg, $startColor, $endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient($deg, $startColor, $endColor); // Opera 11.10 - background-image: linear-gradient($deg, $startColor, $endColor); // Standard, IE10 -} -@mixin gradient-vertical-three-colors($startColor: #00b3ee, $midColor: #7a43b6, $colorStop: 50%, $endColor: #c3325f) { - background-color: mix($midColor, $endColor, 80%); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), color-stop($colorStop, $midColor), to($endColor)); - background-image: -webkit-linear-gradient($startColor, $midColor $colorStop, $endColor); - background-image: -moz-linear-gradient(top, $startColor, $midColor $colorStop, $endColor); - background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor); - background-image: linear-gradient($startColor, $midColor $colorStop, $endColor); +@mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { + background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color); + background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color); background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback } -@mixin gradient-radial($innerColor: #555, $outerColor: #333) { - background-color: $outerColor; - background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($innerColor), to($outerColor)); - background-image: -webkit-radial-gradient(circle, $innerColor, $outerColor); - background-image: -moz-radial-gradient(circle, $innerColor, $outerColor); - background-image: -o-radial-gradient(circle, $innerColor, $outerColor); +@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { + background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color); + background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback +} +@mixin gradient-radial($inner-color: #555, $outer-color: #333) { + background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color); + background-image: radial-gradient(circle, $inner-color, $outer-color); background-repeat: no-repeat; } -@mixin gradient-striped($color: #555, $angle: 45deg) { - background-color: $color; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); +@mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) { + background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); + background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent); } // Reset filters for IE +// +// When you need to remove a gradient background, do not forget to use this to reset +// the IE filter for IE9 and below. @mixin reset-filter() { - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } +// Retina images +// +// Short retina mixin for setting background-image and -size + +@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) { + background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$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(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}")); + background-size: $width-1x $height-1x; + } +} + + +// Responsive image +// +// Keep images from scaling beyond the width of their parents. + +@mixin img-responsive($display: block) { + display: $display; + max-width: 100%; // Part 1: Set a maximum relative to the parent + height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching +} + + // COMPONENT MIXINS // -------------------------------------------------- // Horizontal dividers // ------------------------- // Dividers (basically an hr) within dropdowns and nav lists -@mixin nav-divider($top: #e5e5e5, $bottom: $white) { - // IE7 needs a set width since we gave a height. Restricting just - // to IE7 to keep the 1px left/right space in other browsers. - // It is unclear where IE is getting the extra space that we need - // to negative-margin away, but so it goes. - *width: 100%; +@mixin nav-divider($color: #e5e5e5) { height: 1px; - margin: (($baseLineHeight / 2) - 1) 1px; // 8px 1px - *margin: -5px 0 5px; + margin: (($line-height-computed / 2) - 1) 0; overflow: hidden; - background-color: $top; - border-bottom: 1px solid $bottom; + background-color: $color; +} + +// Panels +// ------------------------- +@mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) { + border-color: $border; + + & > .panel-heading { + color: $heading-text-color; + background-color: $heading-bg-color; + border-color: $heading-border; + + + .panel-collapse .panel-body { + border-top-color: $border; + } + } + & > .panel-footer { + + .panel-collapse .panel-body { + border-bottom-color: $border; + } + } +} + +// Alerts +// ------------------------- +@mixin alert-variant($background, $border, $text-color) { + background-color: $background; + border-color: $border; + color: $text-color; + + hr { + border-top-color: darken($border, 5%); + } + .alert-link { + color: darken($text-color, 10%); + } +} + +// Tables +// ------------------------- +@mixin table-row-variant($state, $background) { + // Exact selectors below required to override `.table-striped` and prevent + // inheritance to nested tables. + .table { + > thead, + > tbody, + > tfoot { + > tr > .#{$state}, + > .#{$state} > td, + > .#{$state} > th { + background-color: $background; + } + } + } + + // Hover states for `.table-hover` + // Note: this is not available for cells or rows within `thead` or `tfoot`. + .table-hover > tbody { + > tr > .#{$state}:hover, + > .#{$state}:hover > td, + > .#{$state}:hover > th { + background-color: darken($background, 5%); + } + } +} + +// Button variants +// ------------------------- +// Easily pump out default styles, as well as :hover, :focus, :active, +// and disabled options for all buttons +@mixin button-variant($color, $background, $border) { + color: $color; + background-color: $background; + border-color: $border; + + &:hover, + &:focus, + &:active, + &.active { + color: $color; + background-color: darken($background, 8%); + border-color: darken($border, 12%); + } + .open & { &.dropdown-toggle { + color: $color; + background-color: darken($background, 8%); + border-color: darken($border, 12%); + } } + &:active, + &.active { + background-image: none; + } + .open & { &.dropdown-toggle { + background-image: none; + } } + &.disabled, + &[disabled], + fieldset[disabled] & { + &, + &:hover, + &:focus, + &:active, + &.active { + background-color: $background; + border-color: $border; + } + } + + .badge { + color: $background; + background-color: #fff; + } +} + +// Button sizes +// ------------------------- +@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { + padding: $padding-vertical $padding-horizontal; + font-size: $font-size; + line-height: $line-height; + border-radius: $border-radius; } // Button backgrounds // ------------------ -@mixin buttonBackground($startColor, $endColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) { +@mixin button-background($startColor, $endColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) { // gradientBar will set the background to a pleasing blend of these, to support IE<=9 - @include gradientBar($startColor, $endColor, $textColor, $textShadow); + @include gradient-bar($startColor, $endColor, $textColor, $textShadow); *background-color: $endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ @include reset-filter(); @@ -512,14 +515,89 @@ } } +// Gradient Bar Colors for buttons and alerts +@mixin gradient-bar($primaryColor, $secondaryColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) { + color: $textColor; + text-shadow: $textShadow; + @include gradient-vertical($primaryColor, $secondaryColor); + border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%); + border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fade-in(rgba(0,0,0,.1), 0.15); +} + + +// Pagination +// ------------------------- +@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) { + > li { + > a, + > span { + padding: $padding-vertical $padding-horizontal; + font-size: $font-size; + } + &:first-child { + > a, + > span { + @include border-left-radius($border-radius); + } + } + &:last-child { + > a, + > span { + @include border-right-radius($border-radius); + } + } + } +} + +// Labels +// ------------------------- +@mixin label-variant($color) { + background-color: $color; + &[href] { + &:hover, + &:focus { + background-color: darken($color, 10%); + } + } +} + // Navbar vertical align // ------------------------- // Vertically center elements in the navbar. -// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin. -@mixin navbarVerticalAlign($elementHeight) { - margin-top: ($navbarHeight - $elementHeight) / 2; +// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. +@mixin navbar-vertical-align($element-height) { + margin-top: (($navbar-height - $element-height) / 2); + margin-bottom: (($navbar-height - $element-height) / 2); } +// Progress bars +// ------------------------- +@mixin progress-bar-variant($color) { + background-color: $color; + .progress-striped & { + @include gradient-striped(); + } +} + +// Responsive utilities +// ------------------------- +// More easily include all the states for responsive-utilities.less. +// [converter] $parent hack +@mixin responsive-visibility($parent) { + #{$parent} { display: block !important; } + table#{$parent} { display: table; } + tr#{$parent} { display: table-row !important; } + th#{$parent}, + td#{$parent} { display: table-cell !important; } +} + +// [converter] $parent hack +@mixin responsive-invisibility($parent) { + #{$parent}, + tr#{$parent}, + th#{$parent}, + td#{$parent} { display: none !important; } +} // Grid System @@ -529,162 +607,274 @@ @mixin container-fixed() { margin-right: auto; margin-left: auto; + padding-left: ($grid-gutter-width / 2); + padding-right: ($grid-gutter-width / 2); @include clearfix(); } -// Table columns -@mixin tableColumns($columnSpan: 1) { - float: none; // undo default grid column styles - width: (($gridColumnWidth) * $columnSpan) + ($gridGutterWidth * ($columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells - margin-left: 0; // undo default grid column styles -} - -// Make a Grid -// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior -@mixin makeRow() { - margin-left: $gridGutterWidth * -1; +// Creates a wrapper for a series of columns +@mixin make-row($gutter: $grid-gutter-width) { + margin-left: ($gutter / -2); + margin-right: ($gutter / -2); @include clearfix(); } -@mixin makeColumn($columns: 1, $offset: 0) { + +// Generate the extra small columns +@mixin make-xs-column($columns, $gutter: $grid-gutter-width) { + position: relative; float: left; - margin-left: ($gridColumnWidth * $offset) + ($gridGutterWidth * ($offset - 1)) + ($gridGutterWidth * 2); - width: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns - 1)); + width: percentage(($columns / $grid-columns)); + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); } -// The Grid -@mixin grid-core($gridColumnWidth, $gridGutterWidth) { - .row { - margin-left: $gridGutterWidth * -1; - @include clearfix(); - } +// Generate the small columns +@mixin make-sm-column($columns, $gutter: $grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); - [class*="span"] { + // Calculate width based on number of columns available + @media (min-width: $screen-sm-min) { float: left; - min-height: 1px; // prevent collapsing columns - margin-left: $gridGutterWidth; - } - - // Set the container width, and override it for fixed navbars in media queries - .container, - .navbar-static-top .container, - .navbar-fixed-top .container, - .navbar-fixed-bottom .container { - @include grid-core-span($gridColumns, $gridColumnWidth, $gridGutterWidth); - } - - // generate .spanX and .offsetX - @include grid-core-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth); - @include grid-core-offset-x($gridColumns, $gridColumnWidth, $gridGutterWidth); -} - -@mixin grid-core-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth) { - @while $gridColumns > 0 { - .span#{$gridColumns} { @include grid-core-span($gridColumns, $gridColumnWidth, $gridGutterWidth); } - $gridColumns: $gridColumns - 1; + width: percentage(($columns / $grid-columns)); } } -@mixin grid-core-offset-x($gridColumns, $gridColumnWidth, $gridGutterWidth) { - @while $gridColumns > 0 { - .offset#{$gridColumns} { @include grid-core-offset($gridColumns, $gridColumnWidth, $gridGutterWidth); } - $gridColumns: $gridColumns - 1; +// Generate the small column offsets +@mixin make-sm-column-offset($columns) { + @media (min-width: $screen-sm-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-sm-column-push($columns) { + @media (min-width: $screen-sm-min) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-sm-column-pull($columns) { + @media (min-width: $screen-sm-min) { + right: percentage(($columns / $grid-columns)); } } -@mixin grid-core-span($columns, $gridColumnWidth, $gridGutterWidth) { - width: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns - 1)); +// Generate the medium columns +@mixin make-md-column($columns, $gutter: $grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); + + // Calculate width based on number of columns available + @media (min-width: $screen-md-min) { + float: left; + width: percentage(($columns / $grid-columns)); + } } -@mixin grid-core-offset($columns, $gridColumnWidth, $gridGutterWidth) { - margin-left: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns + 1)); +// Generate the medium column offsets +@mixin make-md-column-offset($columns) { + @media (min-width: $screen-md-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-md-column-push($columns) { + @media (min-width: $screen-md) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-md-column-pull($columns) { + @media (min-width: $screen-md-min) { + right: percentage(($columns / $grid-columns)); + } +} + +// Generate the large columns +@mixin make-lg-column($columns, $gutter: $grid-gutter-width) { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: ($gutter / 2); + padding-right: ($gutter / 2); + + // Calculate width based on number of columns available + @media (min-width: $screen-lg-min) { + float: left; + width: percentage(($columns / $grid-columns)); + } +} + +// Generate the large column offsets +@mixin make-lg-column-offset($columns) { + @media (min-width: $screen-lg-min) { + margin-left: percentage(($columns / $grid-columns)); + } +} +@mixin make-lg-column-push($columns) { + @media (min-width: $screen-lg-min) { + left: percentage(($columns / $grid-columns)); + } +} +@mixin make-lg-column-pull($columns) { + @media (min-width: $screen-lg-min) { + right: percentage(($columns / $grid-columns)); + } } +// Framework grid generation +// +// Used only by Bootstrap to generate the correct number of grid classes given +// any value of `$grid-columns`. -@mixin grid-fluid($fluidGridColumnWidth, $fluidGridGutterWidth) { - .row-fluid { - width: 100%; - @include clearfix(); - [class*="span"] { - @include input-block-level(); - float: left; - margin-left: $fluidGridGutterWidth; - *margin-left: $fluidGridGutterWidth - (.5 / $gridRowWidth * 100px * 1%); +// [converter] Grid converted to use SASS cycles (LESS uses recursive nested mixin defs not supported by SASS) +@mixin make-grid-columns() { + $list: ''; + $i: 1; + $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}"; + @for $i from 2 through $grid-columns { + $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}, #{$list}"; + } + #{$list} { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-left: ($grid-gutter-width / 2); + padding-right: ($grid-gutter-width / 2); + } +} + + +// [converter] Grid converted to use SASS cycles (LESS uses recursive nested mixin defs not supported by SASS) +@mixin make-grid-columns-float($class) { + $list: ''; + $i: 1; + $list: ".col-#{$class}-#{$i}"; + @for $i from 2 through $grid-columns { + $list: ".col-#{$class}-#{$i}, #{$list}"; + } + #{$list} { + float: left; + } +} + + +@mixin calc-grid($index, $class, $type) { + @if ($type == width) and ($index > 0) { + .col-#{$class}-#{$index} { + width: percentage(($index / $grid-columns)); } - [class*="span"]:first-child { - margin-left: 0; + } + @if ($type == push) { + .col-#{$class}-push-#{$index} { + left: percentage(($index / $grid-columns)); } - - // Space grid-sized controls properly if multiple per line - .controls-row [class*="span"] + [class*="span"] { - margin-left: $fluidGridGutterWidth; + } + @if ($type == pull) { + .col-#{$class}-pull-#{$index} { + right: percentage(($index / $grid-columns)); } - - // generate .spanX and .offsetX - @include grid-fluid-span-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); - @include grid-fluid-offset-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); } -} - -@mixin grid-fluid-span-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth) { - @while $gridColumns > 0 { - .span#{$gridColumns} { @include grid-fluid-span($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); } - $gridColumns: $gridColumns - 1; - } -} - -@mixin grid-fluid-offset-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth) { - @while $gridColumns > 0 { - .offset#{$gridColumns} { @include grid-fluid-offset($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); } - .offset#{$gridColumns}:first-child { @include grid-fluid-offset-first-child($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); } - $gridColumns: $gridColumns - 1; - } -} - -@mixin grid-fluid-span($columns, $fluidGridColumnWidth, $fluidGridGutterWidth) { - width: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)); - *width: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%); -} - -@mixin grid-fluid-offset($columns, $fluidGridColumnWidth, $fluidGridGutterWidth) { - margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) + ($fluidGridGutterWidth * 2); - *margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%) + ($fluidGridGutterWidth * 2) - (.5 / $gridRowWidth * 100px * 1%); -} - -@mixin grid-fluid-offset-first-child($columns, $fluidGridColumnWidth, $fluidGridGutterWidth) { - margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) + ($fluidGridGutterWidth); - *margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%) + $fluidGridGutterWidth - (.5 / $gridRowWidth * 100px * 1%); -} - - - -@mixin grid-input($gridColumnWidth, $gridGutterWidth) { - input, - textarea, - .uneditable-input { - margin-left: 0; // override margin-left from core grid system - } - - // Space grid-sized controls properly if multiple per line - .controls-row [class*="span"] + [class*="span"] { - margin-left: $gridGutterWidth; - } - - // generate .spanX - @include grid-input-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth); -} - -@mixin grid-input-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth) { - @while $gridColumns > 0 { - input.span#{$gridColumns}, - textarea.span#{$gridColumns}, - .uneditable-input.span#{$gridColumns} { - @include grid-input-span($gridColumns, $gridColumnWidth, $gridGutterWidth); + @if ($type == offset) { + .col-#{$class}-offset-#{$index} { + margin-left: percentage(($index / $grid-columns)); } - $gridColumns: $gridColumns - 1; } } -@mixin grid-input-span($columns, $gridColumnWidth, $gridGutterWidth) { - width: (($gridColumnWidth) * $columns) + ($gridGutterWidth * ($columns - 1)) - 14; +// [converter] This is defined recursively in LESS, but SASS supports real loops +@mixin make-grid($columns, $class, $type) { + @for $i from 0 through $columns { + @include calc-grid($i, $class, $type); + } +} + + + +// Form validation states +// +// Used in forms.less to generate the form validation CSS for warnings, errors, +// and successes. + +@mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) { + // Color the label and help text + .help-block, + .control-label, + .radio, + .checkbox, + .radio-inline, + .checkbox-inline { + color: $text-color; + } + // Set the border and box shadow on specific inputs to match + .form-control { + border-color: $border-color; + @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work + &:focus { + border-color: darken($border-color, 10%); + $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%); + @include box-shadow($shadow); + } + } + // Set validation states also for addons + .input-group-addon { + color: $text-color; + border-color: $border-color; + background-color: $background-color; + } +} + +// Form control focus state +// +// Generate a customized focus state and for any input with the specified color, +// which defaults to the `$input-focus-border` variable. +// +// We highly encourage you to not customize the default value, but instead use +// this to tweak colors on an as-needed basis. This aesthetic change is based on +// WebKit's default styles, but applicable to a wider range of browsers. Its +// usability and accessibility should be taken into account with any change. +// +// Example usage: change the default blue border and shadow to white for better +// contrast against a dark gray background. + +@mixin form-control-focus($color: $input-border-focus) { + $color-rgba: rgba(red($color), green($color), blue($color), .6); + &:focus { + border-color: $color; + outline: 0; + @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba); + } +} + +// Form control sizing +// +// Relative text size, padding, and border-radii changes for form controls. For +// horizontal sizing, wrap controls in the predefined grid classes. `<select>` +// element gets special love because it's special, and that's a fact! + +// [converter] $parent hack +@mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { + #{$parent} { height: $input-height; + padding: $padding-vertical $padding-horizontal; + font-size: $font-size; + line-height: $line-height; + border-radius: $border-radius; } + select#{$parent} { + height: $input-height; + line-height: $input-height; + } + + textarea#{$parent} { + height: auto; + } } diff --git a/app/styles/bootstrap/_modals.scss b/app/styles/bootstrap/_modals.scss index 749baa6a8..c79be9283 100644 --- a/app/styles/bootstrap/_modals.scss +++ b/app/styles/bootstrap/_modals.scss @@ -2,81 +2,102 @@ // Modals // -------------------------------------------------- -// Background +// .modal-open - body class for killing the scroll +// .modal - container to scroll within +// .modal-dialog - positioning shell for the actual modal +// .modal-content - actual modal w/ bg and corners and shit + +// Kill the scroll on the body +.modal-open { + overflow: hidden; +} + +// Container that the modal scrolls within +.modal { + display: none; + overflow: auto; + overflow-y: scroll; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: $zindex-modal-background; + + // When fading in the modal, animate it to slide down + &.fade .modal-dialog { + @include translate(0, -25%); + @include transition-transform(0.3s ease-out); + } + &.in .modal-dialog { @include translate(0, 0)} +} + +// Shell div to position the modal with bottom padding +.modal-dialog { + position: relative; + width: auto; + margin: 10px; + z-index: ($zindex-modal-background + 10); +} + +// Actual modal +.modal-content { + position: relative; + background-color: $modal-content-bg; + border: 1px solid $modal-content-fallback-border-color; //old browsers fallback (ie8 etc) + border: 1px solid $modal-content-border-color; + border-radius: $border-radius-large; + @include box-shadow(0 3px 9px rgba(0,0,0,.5)); + background-clip: padding-box; + // Remove focus outline from opened modal + outline: none; +} + +// Modal background .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; - z-index: $zindexModalBackdrop; - background-color: $black; + z-index: ($zindex-modal-background - 10); + background-color: $modal-backdrop-bg; // Fade for backdrop - &.fade { opacity: 0; } + &.fade { @include opacity(0); } + &.in { @include opacity(.5); } } -.modal-backdrop, -.modal-backdrop.fade.in { - @include opacity(80); -} - -// Base modal -.modal { - position: fixed; - top: 10%; - left: 50%; - z-index: $zindexModal; - width: 560px; - margin-left: -280px; - background-color: $white; - border: 1px solid #999; - border: 1px solid rgba(0,0,0,.3); - *border: 1px solid #999; /* IE6-7 */ - @include border-radius(6px); - @include box-shadow(0 3px 7px rgba(0,0,0,0.3)); - @include background-clip(padding-box); - // Remove focus outline from opened modal - outline: none; - - &.fade { - @include transition(opacity .3s linear, top .3s ease-out); - top: -25%; - } - &.fade.in { top: 10%; } -} +// Modal header +// Top section of the modal w/ title and dismiss .modal-header { - padding: 9px 15px; - border-bottom: 1px solid #eee; - // Close icon - .close { margin-top: 2px; } - // Heading - h3 { - margin: 0; - line-height: 30px; - } + padding: $modal-title-padding; + border-bottom: 1px solid $modal-header-border-color; + min-height: ($modal-title-padding + $modal-title-line-height); +} +// Close icon +.modal-header .close { + margin-top: -2px; } -// Body (where all modal content resides) +// Title text within header +.modal-title { + margin: 0; + line-height: $modal-title-line-height; +} + +// Modal body +// Where all modal content resides (sibling of .modal-header and .modal-footer) .modal-body { position: relative; - overflow-y: auto; - max-height: 400px; - padding: 15px; -} -// Remove bottom margin if need be -.modal-form { - margin-bottom: 0; + padding: $modal-inner-padding; } // Footer (for actions) .modal-footer { - padding: 14px 15px 15px; - margin-bottom: 0; + margin-top: 15px; + padding: ($modal-inner-padding - 1) $modal-inner-padding $modal-inner-padding; text-align: right; // right align buttons - background-color: #f5f5f5; - border-top: 1px solid #ddd; - @include border-radius(0 0 6px 6px); - @include box-shadow(inset 0 1px 0 $white); + border-top: 1px solid $modal-footer-border-color; @include clearfix(); // clear it in case folks use .pull-* classes on buttons // Properly space out buttons @@ -93,3 +114,16 @@ margin-left: 0; } } + +// Scale up the modal +@media screen and (min-width: $screen-sm-min) { + + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + @include box-shadow(0 5px 15px rgba(0,0,0,.5)); + } + +} diff --git a/app/styles/bootstrap/_navbar.scss b/app/styles/bootstrap/_navbar.scss index a65aa4abe..d00068a1d 100644 --- a/app/styles/bootstrap/_navbar.scss +++ b/app/styles/bootstrap/_navbar.scss @@ -1,497 +1,620 @@ // -// Navbars (Redux) +// Navbars // -------------------------------------------------- -// COMMON STYLES -// ------------- +// Wrapper and base class +// +// Provide a static navbar from which we expand to create full-width, fixed, and +// other navbar variations. -// Base class and wrapper .navbar { - overflow: visible; - margin-bottom: $baseLineHeight; + position: relative; + min-height: $navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode) + margin-bottom: $navbar-margin-bottom; - // Fix for IE7's bad z-indexing so dropdowns don't appear below content that follows the navbar - *position: relative; - *z-index: 2; -} + border-color: $navbar-default-border; + + @include gradient-vertical($navbar-highlight-bg, $navbar-default-bg); -// Inner for background effects -// Gradient is applied to its own element because overflow visible is not honored by IE when filter is present -.navbar-inner { - min-height: $navbarHeight; - padding-left: 20px; - padding-right: 20px; - @include gradient-vertical($navbarBackgroundHighlight, $navbarBackground); - border: 1px solid $navbarBorder; - @include border-radius($baseBorderRadius); @include box-shadow(0 1px 4px rgba(0,0,0,.065)); // Prevent floats from breaking the navbar @include clearfix(); -} -// Set width to auto for default container -// We then reset it for fixed navbars in the #gridSystem mixin -.navbar .container { - width: auto; -} - -// Override the default collapsed state -.nav-collapse.collapse { - height: auto; - overflow: visible; -} - - -// Brand: website or project name -// ------------------------- -.navbar .brand { - float: left; - display: block; - // Vertically center the text given $navbarHeight - padding: (($navbarHeight - $baseLineHeight) / 2) 20px (($navbarHeight - $baseLineHeight) / 2); - margin-left: -20px; // negative indent to left-align the text down the page - font-size: 20px; - font-weight: 200; - color: $navbarBrandColor; - text-shadow: 0 1px 0 $navbarBackgroundHighlight; - &:hover, - &:focus { - text-decoration: none; + @media (min-width: $grid-float-breakpoint) { + border-radius: $navbar-border-radius; } } -// Plain text in topbar -// ------------------------- -.navbar-text { - margin-bottom: 0; - line-height: $navbarHeight; - color: $navbarText; -} -// Janky solution for now to account for links outside the .nav -// ------------------------- -.navbar-link { - color: $navbarLinkColor; - &:hover, - &:focus { - color: $navbarLinkColorHover; +// Navbar heading +// +// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy +// styling of responsive aspects. + +.navbar-header { + @include clearfix(); + + @media (min-width: $grid-float-breakpoint) { + float: left; } } -// Dividers in navbar -// ------------------------- -.navbar .divider-vertical { - height: $navbarHeight; - margin: 0 9px; - border-left: 1px solid $navbarBackground; - border-right: 1px solid $navbarBackgroundHighlight; -} -// Buttons in navbar -// ------------------------- -.navbar .btn, -.navbar .btn-group { - @include navbarVerticalAlign(30px); // Vertically center in navbar -} -.navbar .btn-group .btn, -.navbar .input-prepend .btn, -.navbar .input-append .btn, -.navbar .input-prepend .btn-group, -.navbar .input-append .btn-group { - margin-top: 0; // then undo the margin here so we don't accidentally double it -} +// Navbar collapse (body) +// +// Group your navbar content into this for easy collapsing and expanding across +// various device sizes. By default, this content is collapsed when <768px, but +// will expand past that for a horizontal display. +// +// To start (on mobile devices) the navbar links, forms, and buttons are stacked +// vertically and include a `max-height` to overflow in case you have too much +// content for the user's viewport. -// Navbar forms -// ------------------------- -.navbar-form { - margin-bottom: 0; // remove default bottom margin +.navbar-collapse { + max-height: 340px; + overflow-x: visible; + padding-right: $navbar-padding-horizontal; + padding-left: $navbar-padding-horizontal; + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255,255,255,.1); @include clearfix(); - input, - select, - .radio, - .checkbox { - @include navbarVerticalAlign(30px); // Vertically center in navbar + -webkit-overflow-scrolling: touch; + + &.in { + overflow-y: auto; } - input, - select, - .btn { - display: inline-block; - margin-bottom: 0; - } - input[type="image"], - input[type="checkbox"], - input[type="radio"] { - margin-top: 3px; - } - .input-append, - .input-prepend { - margin-top: 5px; - white-space: nowrap; // preven two items from separating within a .navbar-form that has .pull-left - input { - margin-top: 0; // remove the margin on top since it's on the parent + + @media (min-width: $grid-float-breakpoint) { + width: auto; + border-top: 0; + box-shadow: none; + + &.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; // Override default setting + overflow: visible !important; + } + + &.in { + overflow-y: visible; + } + + // Undo the collapse side padding for navbars with containers to ensure + // alignment of right-aligned contents. + .navbar-fixed-top &, + .navbar-static-top &, + .navbar-fixed-bottom & { + padding-left: 0; + padding-right: 0; } } } -// Navbar search -// ------------------------- -.navbar-search { - position: relative; - float: left; - @include navbarVerticalAlign(30px); // Vertically center in navbar - margin-bottom: 0; - .search-query { - margin-bottom: 0; - padding: 4px 14px; - @include font-sans-serif(13px, normal, 1); - @include border-radius(15px); // redeclare because of specificity of the type attribute + +// Both navbar header and collapse +// +// When a container is present, change the behavior of the header and collapse. + +.container > .navbar-header, +.container > .navbar-collapse { + margin-right: -$navbar-padding-horizontal; + margin-left: -$navbar-padding-horizontal; + + @media (min-width: $grid-float-breakpoint) { + margin-right: 0; + margin-left: 0; } } +// +// Navbar alignment options +// +// Display the navbar across the entirety of the page or fixed it to the top or +// bottom of the page. -// Static navbar -// ------------------------- - +// Static top (unfixed, but 100% wide) navbar .navbar-static-top { - position: static; - margin-bottom: 0; // remove 18px margin for default navbar - .navbar-inner { - @include border-radius(0); + z-index: $zindex-navbar; + border-width: 0 0 1px; + + @media (min-width: $grid-float-breakpoint) { + border-radius: 0; } } - - -// Fixed navbar -// ------------------------- - -// Shared (top/bottom) styles +// Fix the top/bottom navbars when screen real estate supports it .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; - z-index: $zindexFixedNavbar; - margin-bottom: 0; // remove 18px margin for default navbar -} -.navbar-fixed-top .navbar-inner, -.navbar-static-top .navbar-inner { - border-width: 0 0 1px; -} -.navbar-fixed-bottom .navbar-inner { - border-width: 1px 0 0; -} -.navbar-fixed-top .navbar-inner, -.navbar-fixed-bottom .navbar-inner { - padding-left: 0; - padding-right: 0; - @include border-radius(0); -} + z-index: $zindex-navbar-fixed; -// Reset container width -// Required here as we reset the width earlier on and the grid mixins don't override early enough -.navbar-static-top .container, -.navbar-fixed-top .container, -.navbar-fixed-bottom .container { - @include grid-core-span($gridColumns, $gridColumnWidth, $gridGutterWidth); + // Undo the rounded corners + @media (min-width: $grid-float-breakpoint) { + border-radius: 0; + } } - -// Fixed to top .navbar-fixed-top { top: 0; + border-width: 0 0 1px; } -.navbar-fixed-top, -.navbar-static-top { - .navbar-inner { - @include box-shadow(0 1px 10px rgba(0,0,0,.1)); - } -} - -// Fixed to bottom .navbar-fixed-bottom { bottom: 0; - .navbar-inner { - @include box-shadow(0 -1px 10px rgba(0,0,0,.1)); + margin-bottom: 0; // override .navbar defaults + border-width: 1px 0 0; +} + + +// Brand/project name + +.navbar-brand { + float: left; + padding: $navbar-padding-vertical $navbar-padding-horizontal; + font-size: $font-size-large; + line-height: $line-height-computed; + + &:hover, + &:focus { + text-decoration: none; + } + + @media (min-width: $grid-float-breakpoint) { + .navbar > .container & { + margin-left: -$navbar-padding-horizontal; + } } } +// Navbar toggle +// +// Custom button for toggling the `.navbar-collapse`, powered by the collapse +// JavaScript plugin. -// NAVIGATION -// ---------- - -.navbar .nav { +.navbar-toggle { position: relative; - left: 0; - display: block; - float: left; - margin: 0 10px 0 0; -} -.navbar .nav.pull-right { - float: right; // redeclare due to specificity - margin-right: 0; // remove margin on float right nav -} -.navbar .nav > li { - float: left; -} - -// Links -.navbar .nav > li > a { - float: none; - // Vertically center the text given $navbarHeight - padding: (($navbarHeight - $baseLineHeight) / 2) 15px (($navbarHeight - $baseLineHeight) / 2); - color: $navbarLinkColor; - text-decoration: none; - text-shadow: 0 1px 0 $navbarBackgroundHighlight; -} -.navbar .nav .dropdown-toggle .caret { - margin-top: 8px; -} - -// Hover/focus -.navbar .nav > li > a:focus, -.navbar .nav > li > a:hover { - background-color: $navbarLinkBackgroundHover; // "transparent" is default to differentiate :hover/:focus from .active - color: $navbarLinkColorHover; - text-decoration: none; -} - -// Active nav items -.navbar .nav > .active > a, -.navbar .nav > .active > a:hover, -.navbar .nav > .active > a:focus { - color: $navbarLinkColorActive; - text-decoration: none; - background-color: $navbarLinkBackgroundActive; - @include box-shadow(inset 0 3px 8px rgba(0,0,0,.125)); -} - -// Navbar button for toggling navbar items in responsive layouts -// These definitions need to come after '.navbar .btn' -.navbar .btn-navbar { - display: none; float: right; - padding: 7px 10px; - margin-left: 5px; - margin-right: 5px; - @include buttonBackground(darken($navbarBackgroundHighlight, 5%), darken($navbarBackground, 5%)); - @include box-shadow(inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075)); -} -.navbar .btn-navbar .icon-bar { - display: block; - width: 18px; - height: 2px; - background-color: #f5f5f5; - @include border-radius(1px); - @include box-shadow(0 1px 0 rgba(0,0,0,.25)); -} -.btn-navbar .icon-bar + .icon-bar { - margin-top: 3px; -} + margin-right: $navbar-padding-horizontal; + padding: 9px 10px; + @include navbar-vertical-align(34px); + background-color: transparent; + background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 + border: 1px solid transparent; + border-radius: $border-radius-base; - - -// Dropdown menus -// -------------- - -// Menu position and menu carets -.navbar .nav > li > .dropdown-menu { - &:before { - content: ''; - display: inline-block; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-bottom-color: $dropdownBorder; - position: absolute; - top: -7px; - left: 9px; + // Bars + .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; } - &:after { - content: ''; - display: inline-block; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid $dropdownBackground; - position: absolute; - top: -6px; - left: 10px; + .icon-bar + .icon-bar { + margin-top: 4px; } -} -// Menu position and menu caret support for dropups via extra dropup class -.navbar-fixed-bottom .nav > li > .dropdown-menu { - &:before { - border-top: 7px solid #ccc; - border-top-color: $dropdownBorder; - border-bottom: 0; - bottom: -7px; - top: auto; - } - &:after { - border-top: 6px solid $dropdownBackground; - border-bottom: 0; - bottom: -6px; - top: auto; - } -} -// Caret should match text color on hover/focus -.navbar .nav li.dropdown > a:hover .caret, -.navbar .nav li.dropdown > a:focus .caret { - border-top-color: $navbarLinkColorActive; - border-bottom-color: $navbarLinkColorActive; -} - -// Remove background color from open dropdown -.navbar .nav li.dropdown.open > .dropdown-toggle, -.navbar .nav li.dropdown.active > .dropdown-toggle, -.navbar .nav li.dropdown.open.active > .dropdown-toggle { - background-color: $navbarLinkBackgroundActive; - color: $navbarLinkColorActive; -} -.navbar .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: $navbarLinkColor; - border-bottom-color: $navbarLinkColor; -} -.navbar .nav li.dropdown.open > .dropdown-toggle .caret, -.navbar .nav li.dropdown.active > .dropdown-toggle .caret, -.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: $navbarLinkColorActive; - border-bottom-color: $navbarLinkColorActive; -} - -// Right aligned menus need alt position -.navbar .pull-right > li > .dropdown-menu, -.navbar .nav > li > .dropdown-menu.pull-right { - left: auto; - right: 0; - &:before { - left: auto; - right: 12px; - } - &:after { - left: auto; - right: 13px; - } - .dropdown-menu { - left: auto; - right: 100%; - margin-left: 0; - margin-right: -1px; - @include border-radius(6px 0 6px 6px); + @media (min-width: $grid-float-breakpoint) { + display: none; } } -// Inverted navbar -// ------------------------- +// Navbar nav links +// +// Builds on top of the `.nav` components with it's own modifier class to make +// the nav the full height of the horizontal nav (above 768px). -.navbar-inverse { +.navbar-nav { + margin: ($navbar-padding-vertical / 2) (-$navbar-padding-horizontal); - .navbar-inner { - @include gradient-vertical($navbarInverseBackgroundHighlight, $navbarInverseBackground); - border-color: $navbarInverseBorder; + > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: $line-height-computed; } - .brand, - .nav > li > a { - color: $navbarInverseLinkColor; - text-shadow: 0 -1px 0 rgba(0,0,0,.25); - &:hover, - &:focus { - color: $navbarInverseLinkColorHover; - } - } - - .brand { - color: $navbarInverseBrandColor; - } - - .navbar-text { - color: $navbarInverseText; - } - - .nav > li > a:focus, - .nav > li > a:hover { - background-color: $navbarInverseLinkBackgroundHover; - color: $navbarInverseLinkColorHover; - } - - .nav .active > a, - .nav .active > a:hover, - .nav .active > a:focus { - color: $navbarInverseLinkColorActive; - background-color: $navbarInverseLinkBackgroundActive; - } - - // Inline text links - .navbar-link { - color: $navbarInverseLinkColor; - &:hover, - &:focus { - color: $navbarInverseLinkColorHover; - } - } - - // Dividers in navbar - .divider-vertical { - border-left-color: $navbarInverseBackground; - border-right-color: $navbarInverseBackgroundHighlight; - } - - // Dropdowns - .nav li.dropdown.open > .dropdown-toggle, - .nav li.dropdown.active > .dropdown-toggle, - .nav li.dropdown.open.active > .dropdown-toggle { - background-color: $navbarInverseLinkBackgroundActive; - color: $navbarInverseLinkColorActive; - } - .nav li.dropdown > a:hover .caret, - .nav li.dropdown > a:focus .caret { - border-top-color: $navbarInverseLinkColorActive; - color: $navbarInverseLinkColorActive; - } - .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: $navbarInverseLinkColor; - border-bottom-color: $navbarInverseLinkColor; - } - .nav li.dropdown.open > .dropdown-toggle .caret, - .nav li.dropdown.active > .dropdown-toggle .caret, - .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: $navbarInverseLinkColorActive; - border-bottom-color: $navbarInverseLinkColorActive; - } - - // Navbar search - .navbar-search { - .search-query { - color: $white; - background-color: $navbarInverseSearchBackground; - border-color: $navbarInverseSearchBorder; - @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15)); - @include transition(none); - @include placeholder($navbarInverseSearchPlaceholderColor); - - // Focus states (we use .focused since IE7-8 and down doesn't support :focus) - &:focus, - &.focused { - padding: 5px 15px; - color: $grayDark; - text-shadow: 0 1px 0 $white; - background-color: $navbarInverseSearchBackgroundFocus; - border: 0; - @include box-shadow(0 0 3px rgba(0,0,0,.15)); - outline: 0; + @media (max-width: $grid-float-breakpoint-max) { + // Dropdowns get custom display when collapsed + .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; + > li > a, + .dropdown-header { + padding: 5px 15px 5px 25px; + } + > li > a { + line-height: $line-height-computed; + &:hover, + &:focus { + background-image: none; + } } } } - // Navbar collapse button - .btn-navbar { - @include buttonBackground(darken($navbarInverseBackgroundHighlight, 5%), darken($navbarInverseBackground, 5%)); + // Uncollapse the nav + @media (min-width: $grid-float-breakpoint) { + float: left; + margin: 0; + + > li { + float: left; + > a { + padding-top: $navbar-padding-vertical; + padding-bottom: $navbar-padding-vertical; + } + } + + &.navbar-right:last-child { + margin-right: -$navbar-padding-horizontal; + } + } +} + + +// Component alignment +// +// Repurpose the pull utilities as their own navbar utilities to avoid specificity +// issues with parents and chaining. Only do this when the navbar is uncollapsed +// though so that navbar contents properly stack and align in mobile. + +@media (min-width: $grid-float-breakpoint) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + } +} + + +// Navbar form +// +// Extension of the `.form-inline` with some extra flavor for optimum display in +// our navbars. + +.navbar-form { + margin-left: -$navbar-padding-horizontal; + margin-right: -$navbar-padding-horizontal; + padding: 10px $navbar-padding-horizontal; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + $shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); + @include box-shadow($shadow); + + // Mixin behavior for optimum display + @extend .form-inline; + + .form-group { + @media (max-width: $grid-float-breakpoint-max) { + margin-bottom: 5px; + } + } + + // Vertically center in expanded, horizontal navbar + @include navbar-vertical-align($input-height-base); + + // Undo 100% width for pull classes + @media (min-width: $grid-float-breakpoint) { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + @include box-shadow(none); + + // Outdent the form if last child to line up with content down the page + &.navbar-right:last-child { + margin-right: -$navbar-padding-horizontal; + } + } +} + + +// Dropdown menus + +// Menu position and menu carets +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + @include border-top-radius(0); +} +// Menu position and menu caret support for dropups via extra dropup class +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + @include border-bottom-radius(0); +} + +// Right aligned menus need alt position +.navbar-nav.pull-right > li > .dropdown-menu, +.navbar-nav > li > .dropdown-menu.pull-right { + left: auto; + right: 0; +} + + +// Buttons in navbars +// +// Vertically center a button within a navbar (when *not* in a form). + +.navbar-btn { + @include navbar-vertical-align($input-height-base); + + &.btn-sm { + @include navbar-vertical-align($input-height-small); + } + &.btn-xs { + @include navbar-vertical-align(22); + } +} + + +// Text in navbars +// +// Add a class to make any element properly align itself vertically within the navbars. + +.navbar-text { + @include navbar-vertical-align($line-height-computed); + + @media (min-width: $grid-float-breakpoint) { + float: left; + margin-left: $navbar-padding-horizontal; + margin-right: $navbar-padding-horizontal; + + // Outdent the form if last child to line up with content down the page + &.navbar-right:last-child { + margin-right: 0; + } + } +} + +// Alternate navbars +// -------------------------------------------------- + +// Default navbar +.navbar-default { + background-color: $navbar-default-bg; + + .navbar-brand { + color: $navbar-default-brand-color; + &:hover, + &:focus { + color: $navbar-default-brand-hover-color; + background-color: $navbar-default-brand-hover-bg; + } + } + + .navbar-text { + color: $navbar-default-color; + } + + .navbar-nav { + > li > a { + color: $navbar-default-link-color; + + &:hover, + &:focus { + color: $navbar-default-link-hover-color; + background-color: $navbar-default-link-hover-bg; + } + } + > .active > a { + &, + &:hover, + &:focus { + color: $navbar-default-link-active-color; + background-color: $navbar-default-link-active-bg; + } + } + > .disabled > a { + &, + &:hover, + &:focus { + color: $navbar-default-link-disabled-color; + background-color: $navbar-default-link-disabled-bg; + } + } + } + + .navbar-toggle { + border-color: $navbar-default-toggle-border-color; + &:hover, + &:focus { + background-color: $navbar-default-toggle-hover-bg; + } + .icon-bar { + background-color: $navbar-default-toggle-icon-bar-bg; + } + } + + .navbar-collapse, + .navbar-form { + border-color: $navbar-default-border; + } + + // Dropdown menu items + .navbar-nav { + // Remove background color from open dropdown + > .open > a { + &, + &:hover, + &:focus { + background-color: $navbar-default-link-active-bg; + color: $navbar-default-link-active-color; + } + } + + @media (max-width: $grid-float-breakpoint-max) { + // Dropdowns get custom display when collapsed + .open .dropdown-menu { + > li > a { + color: $navbar-default-link-color; + &:hover, + &:focus { + color: $navbar-default-link-hover-color; + background-color: $navbar-default-link-hover-bg; + } + } + > .active > a { + &, + &:hover, + &:focus { + color: $navbar-default-link-active-color; + background-color: $navbar-default-link-active-bg; + } + } + > .disabled > a { + &, + &:hover, + &:focus { + color: $navbar-default-link-disabled-color; + background-color: $navbar-default-link-disabled-bg; + } + } + } + } + } + + + // Links in navbars + // + // Add a class to ensure links outside the navbar nav are colored correctly. + + .navbar-link { + color: $navbar-default-link-color; + &:hover { + color: $navbar-default-link-hover-color; + } + } + +} + +// Inverse navbar + +.navbar-inverse { + background-color: $navbar-inverse-bg; + border-color: $navbar-inverse-border; + + .navbar-brand { + color: $navbar-inverse-brand-color; + &:hover, + &:focus { + color: $navbar-inverse-brand-hover-color; + background-color: $navbar-inverse-brand-hover-bg; + } + } + + .navbar-text { + color: $navbar-inverse-color; + } + + .navbar-nav { + > li > a { + color: $navbar-inverse-link-color; + + &:hover, + &:focus { + color: $navbar-inverse-link-hover-color; + background-color: $navbar-inverse-link-hover-bg; + } + } + > .active > a { + &, + &:hover, + &:focus { + color: $navbar-inverse-link-active-color; + background-color: $navbar-inverse-link-active-bg; + } + } + > .disabled > a { + &, + &:hover, + &:focus { + color: $navbar-inverse-link-disabled-color; + background-color: $navbar-inverse-link-disabled-bg; + } + } + } + + // Darken the responsive nav toggle + .navbar-toggle { + border-color: $navbar-inverse-toggle-border-color; + &:hover, + &:focus { + background-color: $navbar-inverse-toggle-hover-bg; + } + .icon-bar { + background-color: $navbar-inverse-toggle-icon-bar-bg; + } + } + + .navbar-collapse, + .navbar-form { + border-color: darken($navbar-inverse-bg, 7%); + } + + // Dropdowns + .navbar-nav { + > .open > a { + &, + &:hover, + &:focus { + background-color: $navbar-inverse-link-active-bg; + color: $navbar-inverse-link-active-color; + } + } + + @media (max-width: $grid-float-breakpoint-max) { + // Dropdowns get custom display + .open .dropdown-menu { + > .dropdown-header { + border-color: $navbar-inverse-border; + } + .divider { + background-color: $navbar-inverse-border; + } + > li > a { + color: $navbar-inverse-link-color; + &:hover, + &:focus { + color: $navbar-inverse-link-hover-color; + background-color: $navbar-inverse-link-hover-bg; + } + } + > .active > a { + &, + &:hover, + &:focus { + color: $navbar-inverse-link-active-color; + background-color: $navbar-inverse-link-active-bg; + } + } + > .disabled > a { + &, + &:hover, + &:focus { + color: $navbar-inverse-link-disabled-color; + background-color: $navbar-inverse-link-disabled-bg; + } + } + } + } + } + + .navbar-link { + color: $navbar-inverse-link-color; + &:hover { + color: $navbar-inverse-link-hover-color; + } } } diff --git a/app/styles/bootstrap/_navs.scss b/app/styles/bootstrap/_navs.scss index 31c4451d1..735b55e74 100644 --- a/app/styles/bootstrap/_navs.scss +++ b/app/styles/bootstrap/_navs.scss @@ -3,407 +3,253 @@ // -------------------------------------------------- -// BASE CLASS -// ---------- +// Base class +// -------------------------------------------------- .nav { - margin-left: 0; - margin-bottom: $baseLineHeight; - list-style: none; -} - -// Make links block level -.nav > li > a { - display: block; -} -.nav > li > a:hover, -.nav > li > a:focus { - text-decoration: none; - background-color: $grayLighter; -} - -// Prevent IE8 from misplacing imgs -// See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989 -.nav > li > a > img { - max-width: none; -} - -// Redeclare pull classes because of specifity -.nav > .pull-right { - float: right; -} - -// Nav headers (for dropdowns and lists) -.nav-header { - display: block; - padding: 3px 15px; - font-size: 11px; - font-weight: bold; - line-height: $baseLineHeight; - color: $grayLight; - text-shadow: 0 1px 0 rgba(255,255,255,.5); - text-transform: uppercase; -} -// Space them out when they follow another list item (link) -.nav li + .nav-header { - margin-top: 9px; -} - - - -// NAV LIST -// -------- - -.nav-list { - padding-left: 15px; - padding-right: 15px; margin-bottom: 0; -} -.nav-list > li > a, -.nav-list .nav-header { - margin-left: -15px; - margin-right: -15px; - text-shadow: 0 1px 0 rgba(255,255,255,.5); -} -.nav-list > li > a { - padding: 3px 15px; -} -.nav-list > .active > a, -.nav-list > .active > a:hover, -.nav-list > .active > a:focus { - color: $white; - text-shadow: 0 -1px 0 rgba(0,0,0,.2); - background-color: $linkColor; -} -.nav-list [class^="icon-"], -.nav-list [class*=" icon-"] { - margin-right: 2px; -} -// Dividers (basically an hr) within the dropdown -.nav-list .divider { - @include nav-divider(); -} - - - -// TABS AND PILLS -// ------------- - -// Common styles -.nav-tabs, -.nav-pills { + padding-left: 0; // Override default ul/ol + list-style: none; @include clearfix(); -} -.nav-tabs > li, -.nav-pills > li { - float: left; -} -.nav-tabs > li > a, -.nav-pills > li > a { - padding-right: 12px; - padding-left: 12px; - margin-right: 2px; - line-height: 14px; // keeps the overall height an even number + + > li { + position: relative; + display: block; + + > a { + position: relative; + display: block; + padding: $nav-link-padding; + &:hover, + &:focus { + text-decoration: none; + background-color: $nav-link-hover-bg; + } + } + + // Disabled state sets text to gray and nukes hover/tab effects + &.disabled > a { + color: $nav-disabled-link-color; + + &:hover, + &:focus { + color: $nav-disabled-link-hover-color; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; + } + } + } + + // Open dropdowns + .open > a { + &, + &:hover, + &:focus { + background-color: $nav-link-hover-bg; + border-color: $link-color; + } + } + + // Nav dividers (deprecated with v3.0.1) + // + // This should have been removed in v3 with the dropping of `.nav-list`, but + // we missed it. We don't currently support this anywhere, but in the interest + // of maintaining backward compatibility in case you use it, it's deprecated. + .nav-divider { + @include nav-divider(); + } + + // Prevent IE8 from misplacing imgs + // + // See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989 + > li > a > img { + max-width: none; + } } -// TABS -// ---- + +// Tabs +// ------------------------- // Give the tabs something to sit on .nav-tabs { - border-bottom: 1px solid #ddd; -} -// Make the list-items overlay the bottom border -.nav-tabs > li { - margin-bottom: -1px; -} -// Actual tabs (as links) -.nav-tabs > li > a { - padding-top: 8px; - padding-bottom: 8px; - line-height: $baseLineHeight; - border: 1px solid transparent; - @include border-radius(4px 4px 0 0); - &:hover, - &:focus { - border-color: $grayLighter $grayLighter #ddd; + border-bottom: 1px solid $nav-tabs-border-color; + > li { + float: left; + // Make the list-items overlay the bottom border + margin-bottom: -1px; + + // Actual tabs (as links) + > a { + margin-right: 2px; + line-height: $line-height-base; + border: 1px solid transparent; + border-radius: $border-radius-base $border-radius-base 0 0; + &:hover { + border-color: $nav-tabs-link-hover-border-color $nav-tabs-link-hover-border-color $nav-tabs-border-color; + } + } + + // Active state, and it's :hover to override normal :hover + &.active > a { + &, + &:hover, + &:focus { + color: $nav-tabs-active-link-hover-color; + background-color: $nav-tabs-active-link-hover-bg; + border: 1px solid $nav-tabs-active-link-hover-border-color; + border-bottom-color: transparent; + cursor: default; + } + } + } + // pulling this in mainly for less shorthand + &.nav-justified { + @extend .nav-justified; + @extend .nav-tabs-justified; } } -// Active state, and it's :hover/:focus to override normal :hover/:focus -.nav-tabs > .active > a, -.nav-tabs > .active > a:hover, -.nav-tabs > .active > a:focus { - color: $gray; - background-color: $bodyBackground; - border: 1px solid #ddd; - border-bottom-color: transparent; - cursor: default; -} -// PILLS -// ----- - -// Links rendered as pills -.nav-pills > li > a { - padding-top: 8px; - padding-bottom: 8px; - margin-top: 2px; - margin-bottom: 2px; - @include border-radius(5px); -} - -// Active state -.nav-pills > .active > a, -.nav-pills > .active > a:hover, -.nav-pills > .active > a:focus { - color: $white; - background-color: $linkColor; -} - - - -// STACKED NAV -// ----------- - -// Stacked tabs and pills -.nav-stacked > li { - float: none; -} -.nav-stacked > li > a { - margin-right: 0; // no need for the gap between nav items -} - -// Tabs -.nav-tabs.nav-stacked { - border-bottom: 0; -} -.nav-tabs.nav-stacked > li > a { - border: 1px solid #ddd; - @include border-radius(0); -} -.nav-tabs.nav-stacked > li:first-child > a { - @include border-top-radius(4px); -} -.nav-tabs.nav-stacked > li:last-child > a { - @include border-bottom-radius(4px); -} -.nav-tabs.nav-stacked > li > a:hover, -.nav-tabs.nav-stacked > li > a:focus { - border-color: #ddd; - z-index: 2; -} - // Pills -.nav-pills.nav-stacked > li > a { - margin-bottom: 3px; -} -.nav-pills.nav-stacked > li:last-child > a { - margin-bottom: 1px; // decrease margin to match sizing of stacked tabs -} - - - -// DROPDOWNS -// --------- - -.nav-tabs .dropdown-menu { - @include border-radius(0 0 6px 6px); // remove the top rounded corners here since there is a hard edge above the menu -} -.nav-pills .dropdown-menu { - @include border-radius(6px); // make rounded corners match the pills -} - -// Default dropdown links // ------------------------- -// Make carets use linkColor to start -.nav .dropdown-toggle .caret { - border-top-color: $linkColor; - border-bottom-color: $linkColor; - margin-top: 6px; -} -.nav .dropdown-toggle:hover .caret, -.nav .dropdown-toggle:focus .caret { - border-top-color: $linkColorHover; - border-bottom-color: $linkColorHover; -} -/* move down carets for tabs */ -.nav-tabs .dropdown-toggle .caret { - margin-top: 8px; -} +.nav-pills { + > li { + float: left; -// Active dropdown links -// ------------------------- -.nav .active .dropdown-toggle .caret { - border-top-color: #fff; - border-bottom-color: #fff; -} -.nav-tabs .active .dropdown-toggle .caret { - border-top-color: $gray; - border-bottom-color: $gray; -} + // Links rendered as pills + > a { + border-radius: $nav-pills-border-radius; + } + + li { + margin-left: 2px; + } -// Active:hover/:focus dropdown links -// ------------------------- -.nav > .dropdown.active > a:hover, -.nav > .dropdown.active > a:focus { - cursor: pointer; -} - -// Open dropdowns -// ------------------------- -.nav-tabs .open .dropdown-toggle, -.nav-pills .open .dropdown-toggle, -.nav > li.dropdown.open.active > a:hover, -.nav > li.dropdown.open.active > a:focus { - color: $white; - background-color: $grayLight; - border-color: $grayLight; -} -.nav li.dropdown.open .caret, -.nav li.dropdown.open.active .caret, -.nav li.dropdown.open a:hover .caret, -.nav li.dropdown.open a:focus .caret { - border-top-color: $white; - border-bottom-color: $white; - @include opacity(100); -} - -// Dropdowns in stacked tabs -.tabs-stacked .open > a:hover, -.tabs-stacked .open > a:focus { - border-color: $grayLight; -} - - - -// TABBABLE -// -------- - - -// COMMON STYLES -// ------------- - -// Clear any floats -.tabbable { - @include clearfix(); -} -.tab-content { - overflow: auto; // prevent content from running below tabs -} - -// Remove border on bottom, left, right -.tabs-below > .nav-tabs, -.tabs-right > .nav-tabs, -.tabs-left > .nav-tabs { - border-bottom: 0; -} - -// Show/hide tabbable areas -.tab-content > .tab-pane, -.pill-content > .pill-pane { - display: none; -} -.tab-content > .active, -.pill-content > .active { - display: block; -} - - -// BOTTOM -// ------ - -.tabs-below > .nav-tabs { - border-top: 1px solid #ddd; -} -.tabs-below > .nav-tabs > li { - margin-top: -1px; - margin-bottom: 0; -} -.tabs-below > .nav-tabs > li > a { - @include border-radius(0 0 4px 4px); - &:hover, - &:focus { - border-bottom-color: transparent; - border-top-color: #ddd; + // Active state + &.active > a { + &, + &:hover, + &:focus { + color: $nav-pills-active-link-hover-color; + background-color: $nav-pills-active-link-hover-bg; + } + } } } -.tabs-below > .nav-tabs > .active > a, -.tabs-below > .nav-tabs > .active > a:hover, -.tabs-below > .nav-tabs > .active > a:focus { - border-color: transparent #ddd #ddd #ddd; -} -// LEFT & RIGHT -// ------------ -// Common styles -.tabs-left > .nav-tabs > li, -.tabs-right > .nav-tabs > li { - float: none; -} -.tabs-left > .nav-tabs > li > a, -.tabs-right > .nav-tabs > li > a { - min-width: 74px; - margin-right: 0; - margin-bottom: 3px; -} - -// Tabs on the left -.tabs-left > .nav-tabs { - float: left; - margin-right: 19px; - border-right: 1px solid #ddd; -} -.tabs-left > .nav-tabs > li > a { - margin-right: -1px; - @include border-radius(4px 0 0 4px); -} -.tabs-left > .nav-tabs > li > a:hover, -.tabs-left > .nav-tabs > li > a:focus { - border-color: $grayLighter #ddd $grayLighter $grayLighter; -} -.tabs-left > .nav-tabs .active > a, -.tabs-left > .nav-tabs .active > a:hover, -.tabs-left > .nav-tabs .active > a:focus { - border-color: #ddd transparent #ddd #ddd; - *border-right-color: $white; -} - -// Tabs on the right -.tabs-right > .nav-tabs { - float: right; - margin-left: 19px; - border-left: 1px solid #ddd; -} -.tabs-right > .nav-tabs > li > a { - margin-left: -1px; - @include border-radius(0 4px 4px 0); -} -.tabs-right > .nav-tabs > li > a:hover, -.tabs-right > .nav-tabs > li > a:focus { - border-color: $grayLighter $grayLighter $grayLighter #ddd; -} -.tabs-right > .nav-tabs .active > a, -.tabs-right > .nav-tabs .active > a:hover, -.tabs-right > .nav-tabs .active > a:focus { - border-color: #ddd #ddd #ddd transparent; - *border-left-color: $white; +// Stacked pills +.nav-stacked { + > li { + float: none; + + li { + margin-top: 2px; + margin-left: 0; // no need for this gap between nav items + } + } } +// Nav variations +// -------------------------------------------------- -// DISABLED STATES -// --------------- +#contribute-nav { + padding-left: 35; + >li { + >a { + padding: 5px 0; + &:hover { + background: none; + } + } + } +} -// Gray out text -.nav > .disabled > a { - color: $grayLight; + +// Justified nav links +// ------------------------- + +.nav-justified { + width: 100%; + + > li { + float: none; + > a { + text-align: center; + margin-bottom: 5px; + } + } + + > .dropdown .dropdown-menu { + top: auto; + left: auto; + } + + @media (min-width: $screen-sm-min) { + > li { + display: table-cell; + width: 1%; + > a { + margin-bottom: 0; + } + } + } } -// Nuke hover/focus effects -.nav > .disabled > a:hover, -.nav > .disabled > a:focus { - text-decoration: none; - background-color: transparent; - cursor: default; + +// Move borders to anchors instead of bottom of list +// +// Mixin for adding on top the shared `.nav-justified` styles for our tabs +.nav-tabs-justified { + border-bottom: 0; + + > li > a { + // Override margin from .nav-tabs + margin-right: 0; + border-radius: $border-radius-base; + } + + > .active > a, + > .active > a:hover, + > .active > a:focus { + border: 1px solid $nav-tabs-justified-link-border-color; + } + + @media (min-width: $screen-sm-min) { + > li > a { + border-bottom: 1px solid $nav-tabs-justified-link-border-color; + border-radius: $border-radius-base $border-radius-base 0 0; + } + > .active > a, + > .active > a:hover, + > .active > a:focus { + border-bottom-color: $nav-tabs-justified-active-link-border-color; + } + } +} + + +// Tabbable tabs +// ------------------------- + +// Hide tabbable panes to start, show them when `.active` +.tab-content { + > .tab-pane { + display: none; + } + > .active { + display: block; + } +} + + +// Dropdowns +// ------------------------- + +// Specific dropdowns +.nav-tabs .dropdown-menu { + // make dropdown border overlap tab border + margin-top: -1px; + // Remove the top rounded corners here since there is a hard edge above the menu + @include border-top-radius(0); } diff --git a/app/styles/bootstrap/_normalize.scss b/app/styles/bootstrap/_normalize.scss new file mode 100644 index 000000000..42a393fc0 --- /dev/null +++ b/app/styles/bootstrap/_normalize.scss @@ -0,0 +1,406 @@ +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ + +// ========================================================================== +// HTML5 display definitions +// ========================================================================== + +// +// Correct `block` display not defined in IE 8/9. +// + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +// +// Correct `inline-block` display not defined in IE 8/9. +// + +audio, +canvas, +video { + display: inline-block; +} + +// +// Prevent modern browsers from displaying `audio` without controls. +// Remove excess height in iOS 5 devices. +// + +audio:not([controls]) { + display: none; + height: 0; +} + +// +// Address `[hidden]` styling not present in IE 8/9. +// Hide the `template` element in IE, Safari, and Firefox < 22. +// + +[hidden], +template { + display: none; +} + +// ========================================================================== +// Base +// ========================================================================== + +// +// 1. Set default font family to sans-serif. +// 2. Prevent iOS text size adjust after orientation change, without disabling +// user zoom. +// + +html { + font-family: sans-serif; // 1 + -ms-text-size-adjust: 100%; // 2 + -webkit-text-size-adjust: 100%; // 2 +} + +// +// Remove default margin. +// + +body { + margin: 0; +} + +// ========================================================================== +// Links +// ========================================================================== + +// +// Remove the gray background color from active links in IE 10. +// + +a { + background: transparent; +} + +// +// Address `outline` inconsistency between Chrome and other browsers. +// + +a:focus { + outline: thin dotted; +} + +// +// Improve readability when focused and also mouse hovered in all browsers. +// + +a:active, +a:hover { + outline: 0; +} + +// ========================================================================== +// Typography +// ========================================================================== + +// +// Address variable `h1` font-size and margin within `section` and `article` +// contexts in Firefox 4+, Safari 5, and Chrome. +// + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +// +// Address styling not present in IE 8/9, Safari 5, and Chrome. +// + +abbr[title] { + border-bottom: 1px dotted; +} + +// +// Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. +// + +b, +strong { + font-weight: bold; +} + +// +// Address styling not present in Safari 5 and Chrome. +// + +dfn { + font-style: italic; +} + +// +// Address differences between Firefox and other browsers. +// + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +// +// Address styling not present in IE 8/9. +// + +mark { + background: #ff0; + color: #000; +} + +// +// Correct font family set oddly in Safari 5 and Chrome. +// + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +// +// Improve readability of pre-formatted text in all browsers. +// + +pre { + white-space: pre-wrap; +} + +// +// Set consistent quote types. +// + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +// +// Address inconsistent and variable font size in all browsers. +// + +small { + font-size: 80%; +} + +// +// Prevent `sub` and `sup` affecting `line-height` in all browsers. +// + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +// ========================================================================== +// Embedded content +// ========================================================================== + +// +// Remove border when inside `a` element in IE 8/9. +// + +img { + border: 0; +} + +// +// Correct overflow displayed oddly in IE 9. +// + +svg:not(:root) { + overflow: hidden; +} + +// ========================================================================== +// Figures +// ========================================================================== + +// +// Address margin not present in IE 8/9 and Safari 5. +// + +figure { + margin: 0; +} + +// ========================================================================== +// Forms +// ========================================================================== + +// +// Define consistent border, margin, and padding. +// + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +// +// 1. Correct `color` not being inherited in IE 8/9. +// 2. Remove padding so people aren't caught out if they zero out fieldsets. +// + +legend { + border: 0; // 1 + padding: 0; // 2 +} + +// +// 1. Correct font family not being inherited in all browsers. +// 2. Correct font size not being inherited in all browsers. +// 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. +// + +button, +input, +select, +textarea { + font-family: inherit; // 1 + font-size: 100%; // 2 + margin: 0; // 3 +} + +// +// Address Firefox 4+ setting `line-height` on `input` using `!important` in +// the UA stylesheet. +// + +button, +input { + line-height: normal; +} + +// +// Address inconsistent `text-transform` inheritance for `button` and `select`. +// All other form control elements do not inherit `text-transform` values. +// Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. +// Correct `select` style inheritance in Firefox 4+ and Opera. +// + +button, +select { + text-transform: none; +} + +// +// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` +// and `video` controls. +// 2. Correct inability to style clickable `input` types in iOS. +// 3. Improve usability and consistency of cursor style between image-type +// `input` and others. +// + +button, +html input[type="button"], // 1 +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; // 2 + cursor: pointer; // 3 +} + +// +// Re-set default cursor for disabled elements. +// + +button[disabled], +html input[disabled] { + cursor: default; +} + +// +// 1. Address box sizing set to `content-box` in IE 8/9/10. +// 2. Remove excess padding in IE 8/9/10. +// + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; // 1 + padding: 0; // 2 +} + +// +// 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. +// 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome +// (include `-moz` to future-proof). +// + +input[type="search"] { + -webkit-appearance: textfield; // 1 + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; // 2 + box-sizing: content-box; +} + +// +// Remove inner padding and search cancel button in Safari 5 and Chrome +// on OS X. +// + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +// +// Remove inner padding and border in Firefox 4+. +// + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +// +// 1. Remove default vertical scrollbar in IE 8/9. +// 2. Improve readability and alignment in all browsers. +// + +textarea { + overflow: auto; // 1 + vertical-align: top; // 2 +} + +// ========================================================================== +// Tables +// ========================================================================== + +// +// Remove most spacing between table cells. +// + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/app/styles/bootstrap/_pager.scss b/app/styles/bootstrap/_pager.scss index 46df08f79..e067a3da2 100644 --- a/app/styles/bootstrap/_pager.scss +++ b/app/styles/bootstrap/_pager.scss @@ -4,40 +4,52 @@ .pager { - margin: $baseLineHeight 0; + padding-left: 0; + margin: $line-height-computed 0; list-style: none; text-align: center; @include clearfix(); -} -.pager li { - display: inline; -} -.pager li > a, -.pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - @include border-radius(15px); -} -.pager li > a:hover, -.pager li > a:focus { - text-decoration: none; - background-color: #f5f5f5; -} -.pager .next > a, -.pager .next > span { - float: right; -} -.pager .previous > a, -.pager .previous > span { - float: left; -} -.pager .disabled > a, -.pager .disabled > a:hover, -.pager .disabled > a:focus, -.pager .disabled > span { - color: $grayLight; - background-color: #fff; - cursor: default; + li { + display: inline; + > a, + > span { + display: inline-block; + padding: 5px 14px; + background-color: $pagination-bg; + border: 1px solid $pagination-border; + border-radius: $pager-border-radius; + } + + > a:hover, + > a:focus { + text-decoration: none; + background-color: $pagination-hover-bg; + } + } + + .next { + > a, + > span { + float: right; + } + } + + .previous { + > a, + > span { + float: left; + } + } + + .disabled { + > a, + > a:hover, + > a:focus, + > span { + color: $pager-disabled-color; + background-color: $pagination-bg; + cursor: not-allowed; + } + } + } diff --git a/app/styles/bootstrap/_pagination.scss b/app/styles/bootstrap/_pagination.scss index 8ab33baff..44d4c2397 100644 --- a/app/styles/bootstrap/_pagination.scss +++ b/app/styles/bootstrap/_pagination.scss @@ -1,123 +1,85 @@ // // Pagination (multiple pages) // -------------------------------------------------- - -// Space out pagination from surrounding content .pagination { - margin: $baseLineHeight 0; -} - -.pagination ul { - // Allow for text-based alignment display: inline-block; - @include ie7-inline-block(); - // Reset default ul styles - margin-left: 0; - margin-bottom: 0; - // Visuals - @include border-radius($baseBorderRadius); - @include box-shadow(0 1px 2px rgba(0,0,0,.05)); -} -.pagination ul > li { - display: inline; // Remove list-style and block-level defaults -} -.pagination ul > li > a, -.pagination ul > li > span { - float: left; // Collapse white-space - padding: 4px 12px; - line-height: $baseLineHeight; - text-decoration: none; - background-color: $paginationBackground; - border: 1px solid $paginationBorder; - border-left-width: 0; -} -.pagination ul > li > a:hover, -.pagination ul > li > a:focus, -.pagination ul > .active > a, -.pagination ul > .active > span { - background-color: $paginationActiveBackground; -} -.pagination ul > .active > a, -.pagination ul > .active > span { - color: $grayLight; - cursor: default; -} -.pagination ul > .disabled > span, -.pagination ul > .disabled > a, -.pagination ul > .disabled > a:hover, -.pagination ul > .disabled > a:focus { - color: $grayLight; - background-color: transparent; - cursor: default; -} -.pagination ul > li:first-child > a, -.pagination ul > li:first-child > span { - border-left-width: 1px; - @include border-left-radius($baseBorderRadius); -} -.pagination ul > li:last-child > a, -.pagination ul > li:last-child > span { - @include border-right-radius($baseBorderRadius); -} + padding-left: 0; + margin: $line-height-computed 0; + border-radius: $border-radius-base; + > li { + display: inline; // Remove list-style and block-level defaults + > a, + > span { + position: relative; + float: left; // Collapse white-space + padding: $padding-base-vertical $padding-base-horizontal; + line-height: $line-height-base; + text-decoration: none; + background-color: $pagination-bg; + border: 1px solid $pagination-border; + margin-left: -1px; + } + &:first-child { + > a, + > span { + margin-left: 0; + @include border-left-radius($border-radius-base); + } + } + &:last-child { + > a, + > span { + @include border-right-radius($border-radius-base); + } + } + } -// Alignment -// -------------------------------------------------- + > li > a, + > li > span { + &:hover, + &:focus { + background-color: $pagination-hover-bg; + } + } -.pagination-centered { - text-align: center; + > .active > a, + > .active > span { + &, + &:hover, + &:focus { + z-index: 2; + color: $pagination-active-color; + background-color: $pagination-active-bg; + border-color: $pagination-active-bg; + cursor: default; + } + } + + > .disabled { + > span, + > span:hover, + > span:focus, + > a, + > a:hover, + > a:focus { + color: $pagination-disabled-color; + background-color: $pagination-bg; + border-color: $pagination-border; + cursor: not-allowed; + } + } } -.pagination-right { - text-align: right; -} - // Sizing // -------------------------------------------------- // Large -.pagination-large { - ul > li > a, - ul > li > span { - padding: $paddingLarge; - font-size: $fontSizeLarge; - } - ul > li:first-child > a, - ul > li:first-child > span { - @include border-left-radius($borderRadiusLarge); - } - ul > li:last-child > a, - ul > li:last-child > span { - @include border-right-radius($borderRadiusLarge); - } -} - -// Small and mini -.pagination-mini, -.pagination-small { - ul > li:first-child > a, - ul > li:first-child > span { - @include border-left-radius($borderRadiusSmall); - } - ul > li:last-child > a, - ul > li:last-child > span { - @include border-right-radius($borderRadiusSmall); - } +.pagination-lg { + @include pagination-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $border-radius-large); } // Small -.pagination-small { - ul > li > a, - ul > li > span { - padding: $paddingSmall; - font-size: $fontSizeSmall; - } -} -// Mini -.pagination-mini { - ul > li > a, - ul > li > span { - padding: $paddingMini; - font-size: $fontSizeMini; - } +.pagination-sm { + @include pagination-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $border-radius-small); } diff --git a/app/styles/bootstrap/_panels.scss b/app/styles/bootstrap/_panels.scss new file mode 100644 index 000000000..6b0ec1feb --- /dev/null +++ b/app/styles/bootstrap/_panels.scss @@ -0,0 +1,182 @@ +// +// Panels +// -------------------------------------------------- + + +// Base class +.panel { + margin-bottom: $line-height-computed; + background-color: $panel-bg; + border: 1px solid transparent; + border-radius: $panel-border-radius; + @include box-shadow(0 1px 1px rgba(0,0,0,.05)); +} + +// Panel contents +.panel-body { + padding: 15px; + @include clearfix(); +} + + +// List groups in panels +// +// By default, space out list group content from panel headings to account for +// any kind of custom content between the two. + +.panel { + > .list-group { + margin-bottom: 0; + + .list-group-item { + border-width: 1px 0; + + // Remove border radius for top one + &:first-child { + @include border-top-radius(0); + } + // But keep it for the last one + &:last-child { + border-bottom: 0; + } + } + } +} +// Collapse space between when there's no additional content. +.panel-heading + .list-group { + .list-group-item:first-child { + border-top-width: 0; + } +} + + +// Tables in panels +// +// Place a non-bordered `.table` within a panel (not within a `.panel-body`) and +// watch it go full width. + +.panel { + > .table, + > .table-responsive > .table { + margin-bottom: 0; + } + > .panel-body + .table, + > .panel-body + .table-responsive { + border-top: 1px solid $table-border-color; + } + > .table > tbody:first-child th, + > .table > tbody:first-child td { + border-top: 0; + } + > .table-bordered, + > .table-responsive > .table-bordered { + border: 0; + > thead, + > tbody, + > tfoot { + > tr { + > th:first-child, + > td:first-child { + border-left: 0; + } + > th:last-child, + > td:last-child { + border-right: 0; + } + + &:last-child > th, + &:last-child > td { + border-bottom: 0; + } + } + } + } + > .table-responsive { + border: 0; + margin-bottom: 0; + } +} + + +// Optional heading +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + @include border-top-radius($panel-border-radius - 1); + + > .dropdown .dropdown-toggle { + color: inherit; + } +} + +// Within heading, strip any `h*` tag of it's default margins for spacing. +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: ceil(($font-size-base * 1.125)); + color: inherit; + + > a { + color: inherit; + } +} + +// Optional footer (stays gray in every modifier class) +.panel-footer { + padding: 10px 15px; + background-color: $panel-footer-bg; + border-top: 1px solid $panel-inner-border; + @include border-bottom-radius($panel-border-radius - 1); +} + + +// Collapsable panels (aka, accordion) +// +// Wrap a series of panels in `.panel-group` to turn them into an accordion with +// the help of our collapse JavaScript plugin. + +.panel-group { + // Tighten up margin so it's only between panels + .panel { + margin-bottom: 0; + border-radius: $panel-border-radius; + overflow: hidden; // crop contents when collapsed + + .panel { + margin-top: 5px; + } + } + + .panel-heading { + border-bottom: 0; + + .panel-collapse .panel-body { + border-top: 1px solid $panel-inner-border; + } + } + .panel-footer { + border-top: 0; + + .panel-collapse .panel-body { + border-bottom: 1px solid $panel-inner-border; + } + } +} + + +// Contextual variations +.panel-default { + @include panel-variant($panel-default-border, $panel-default-text, $panel-default-heading-bg, $panel-default-border); +} +.panel-primary { + @include panel-variant($panel-primary-border, $panel-primary-text, $panel-primary-heading-bg, $panel-primary-border); +} +.panel-success { + @include panel-variant($panel-success-border, $panel-success-text, $panel-success-heading-bg, $panel-success-border); +} +.panel-warning { + @include panel-variant($panel-warning-border, $panel-warning-text, $panel-warning-heading-bg, $panel-warning-border); +} +.panel-danger { + @include panel-variant($panel-danger-border, $panel-danger-text, $panel-danger-heading-bg, $panel-danger-border); +} +.panel-info { + @include panel-variant($panel-info-border, $panel-info-text, $panel-info-heading-bg, $panel-info-border); +} diff --git a/app/styles/bootstrap/_popovers.scss b/app/styles/bootstrap/_popovers.scss index 18a1ca0c8..7ebb0a008 100644 --- a/app/styles/bootstrap/_popovers.scss +++ b/app/styles/bootstrap/_popovers.scss @@ -7,18 +7,16 @@ position: absolute; top: 0; left: 0; - z-index: $zindexPopover; + z-index: $zindex-popover; display: none; - max-width: 276px; + max-width: $popover-max-width; padding: 1px; text-align: left; // Reset given new insertion method - background-color: $popoverBackground; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0,0,0,.2); - @include border-radius(6px); + background-color: $popover-bg; + background-clip: padding-box; + border: 1px solid $popover-fallback-border-color; + border: 1px solid $popover-border-color; + border-radius: $border-radius-large; @include box-shadow(0 5px 10px rgba(0,0,0,.2)); // Overrides for proper insertion @@ -34,16 +32,12 @@ .popover-title { margin: 0; // reset heading margin padding: 8px 14px; - font-size: 14px; + font-size: $font-size-base; font-weight: normal; line-height: 18px; - background-color: $popoverTitleBackground; - border-bottom: 1px solid darken($popoverTitleBackground, 5%); - @include border-radius(5px 5px 0 0); - - &:empty { - display: none; - } + background-color: $popover-title-bg; + border-bottom: 1px solid darken($popover-title-bg, 5%); + border-radius: 5px 5px 0 0; } .popover-content { @@ -54,79 +48,85 @@ // // .arrow is outer, .arrow:after is inner -.popover .arrow, -.popover .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; +.popover .arrow { + &, + &:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + } } .popover .arrow { - border-width: $popoverArrowOuterWidth; + border-width: $popover-arrow-outer-width; } .popover .arrow:after { - border-width: $popoverArrowWidth; + border-width: $popover-arrow-width; content: ""; } .popover { &.top .arrow { left: 50%; - margin-left: -$popoverArrowOuterWidth; + margin-left: -$popover-arrow-outer-width; border-bottom-width: 0; - border-top-color: #999; // IE8 fallback - border-top-color: $popoverArrowOuterColor; - bottom: -$popoverArrowOuterWidth; + border-top-color: $popover-arrow-outer-fallback-color; // IE8 fallback + border-top-color: $popover-arrow-outer-color; + bottom: -$popover-arrow-outer-width; &:after { + content: " "; bottom: 1px; - margin-left: -$popoverArrowWidth; + margin-left: -$popover-arrow-width; border-bottom-width: 0; - border-top-color: $popoverArrowColor; + border-top-color: $popover-arrow-color; } } &.right .arrow { top: 50%; - left: -$popoverArrowOuterWidth; - margin-top: -$popoverArrowOuterWidth; + left: -$popover-arrow-outer-width; + margin-top: -$popover-arrow-outer-width; border-left-width: 0; - border-right-color: #999; // IE8 fallback - border-right-color: $popoverArrowOuterColor; + border-right-color: $popover-arrow-outer-fallback-color; // IE8 fallback + border-right-color: $popover-arrow-outer-color; &:after { + content: " "; left: 1px; - bottom: -$popoverArrowWidth; + bottom: -$popover-arrow-width; border-left-width: 0; - border-right-color: $popoverArrowColor; + border-right-color: $popover-arrow-color; } } &.bottom .arrow { left: 50%; - margin-left: -$popoverArrowOuterWidth; + margin-left: -$popover-arrow-outer-width; border-top-width: 0; - border-bottom-color: #999; // IE8 fallback - border-bottom-color: $popoverArrowOuterColor; - top: -$popoverArrowOuterWidth; + border-bottom-color: $popover-arrow-outer-fallback-color; // IE8 fallback + border-bottom-color: $popover-arrow-outer-color; + top: -$popover-arrow-outer-width; &:after { + content: " "; top: 1px; - margin-left: -$popoverArrowWidth; + margin-left: -$popover-arrow-width; border-top-width: 0; - border-bottom-color: $popoverArrowColor; + border-bottom-color: $popover-arrow-color; } } &.left .arrow { top: 50%; - right: -$popoverArrowOuterWidth; - margin-top: -$popoverArrowOuterWidth; + right: -$popover-arrow-outer-width; + margin-top: -$popover-arrow-outer-width; border-right-width: 0; - border-left-color: #999; // IE8 fallback - border-left-color: $popoverArrowOuterColor; + border-left-color: $popover-arrow-outer-fallback-color; // IE8 fallback + border-left-color: $popover-arrow-outer-color; &:after { + content: " "; right: 1px; border-right-width: 0; - border-left-color: $popoverArrowColor; - bottom: -$popoverArrowWidth; + border-left-color: $popover-arrow-color; + bottom: -$popover-arrow-width; } } diff --git a/app/styles/bootstrap/_print.scss b/app/styles/bootstrap/_print.scss new file mode 100644 index 000000000..07277a3ca --- /dev/null +++ b/app/styles/bootstrap/_print.scss @@ -0,0 +1,105 @@ +// +// Basic print styles +// -------------------------------------------------- +// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css + +@media print { + + * { + text-shadow: none !important; + color: #000 !important; // Black prints faster: h5bp.com/s + background: transparent !important; + box-shadow: none !important; + } + + a, + a:visited { + text-decoration: underline; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + // Don't show links for images, or javascript/internal links + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; // h5bp.com/t + } + + tr, + img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + @page { + margin: 2cm .5cm; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } + + // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 + // Once fixed, we can just straight up remove this. + select { + background: #fff !important; + } + + // Bootstrap components + .navbar { + display: none; + } + .table { + td, + th { + background-color: #fff !important; + } + } + .btn, + .dropup > .btn { + > .caret { + border-top-color: #000 !important; + } + } + .label { + border: 1px solid #000; + } + + .table { + border-collapse: collapse !important; + } + .table-bordered { + th, + td { + border: 1px solid #ddd !important; + } + } + +} diff --git a/app/styles/bootstrap/_progress-bars.scss b/app/styles/bootstrap/_progress-bars.scss index 6d9e70b24..7302b729d 100644 --- a/app/styles/bootstrap/_progress-bars.scss +++ b/app/styles/bootstrap/_progress-bars.scss @@ -3,34 +3,16 @@ // -------------------------------------------------- -// ANIMATIONS -// ---------- +// Bar animations +// ------------------------- -// Webkit +// WebKit @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } -// Firefox -@-moz-keyframes progress-bar-stripes { - from { background-position: 40px 0; } - to { background-position: 0 0; } -} - -// IE9 -@-ms-keyframes progress-bar-stripes { - from { background-position: 40px 0; } - to { background-position: 0 0; } -} - -// Opera -@-o-keyframes progress-bar-stripes { - from { background-position: 0 0; } - to { background-position: 40px 0; } -} - -// Spec +// Spec and IE10+ @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } @@ -38,85 +20,61 @@ -// THE BARS -// -------- +// Bar itself +// ------------------------- // Outer container .progress { overflow: hidden; - height: $baseLineHeight; - margin-bottom: $baseLineHeight; - @include gradient-vertical(#f5f5f5, #f9f9f9); + height: $line-height-computed; + margin-bottom: $line-height-computed; + background-color: $progress-bg; + border-radius: $border-radius-base; @include box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); - @include border-radius($baseBorderRadius); } // Bar of progress -.progress .bar { +.progress-bar { + float: left; width: 0%; height: 100%; - color: $white; - float: left; - font-size: 12px; + font-size: $font-size-small; + line-height: $line-height-computed; + color: $progress-bar-color; text-align: center; - text-shadow: 0 -1px 0 rgba(0,0,0,.25); - @include gradient-vertical(#149bdf, #0480be); + background-color: $progress-bar-bg; @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); - @include box-sizing(border-box); @include transition(width .6s ease); } -.progress .bar + .bar { - @include box-shadow(inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15)); -} // Striped bars -.progress-striped .bar { - @include gradient-striped(#149bdf); - @include background-size(40px 40px); +.progress-striped .progress-bar { + @include gradient-striped(); + background-size: 40px 40px; } // Call animation for the active one -.progress.active .bar { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -moz-animation: progress-bar-stripes 2s linear infinite; - -ms-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; +.progress.active .progress-bar { + @include animation(progress-bar-stripes 2s linear infinite); } -// COLORS -// ------ +// Variations +// ------------------------- -// Danger (red) -.progress-danger .bar, .progress .bar-danger { - @include gradient-vertical(#ee5f5b, #c43c35); -} -.progress-danger.progress-striped .bar, .progress-striped .bar-danger { - @include gradient-striped(#ee5f5b); +.progress-bar-success { + @include progress-bar-variant($progress-bar-success-bg); } -// Success (green) -.progress-success .bar, .progress .bar-success { - @include gradient-vertical(#62c462, #57a957); -} -.progress-success.progress-striped .bar, .progress-striped .bar-success { - @include gradient-striped(#62c462); +.progress-bar-info { + @include progress-bar-variant($progress-bar-info-bg); } -// Info (teal) -.progress-info .bar, .progress .bar-info { - @include gradient-vertical(#5bc0de, #339bb9); -} -.progress-info.progress-striped .bar, .progress-striped .bar-info { - @include gradient-striped(#5bc0de); +.progress-bar-warning { + @include progress-bar-variant($progress-bar-warning-bg); } -// Warning (orange) -.progress-warning .bar, .progress .bar-warning { - @include gradient-vertical(lighten($orange, 15%), $orange); -} -.progress-warning.progress-striped .bar, .progress-striped .bar-warning { - @include gradient-striped(lighten($orange, 15%)); +.progress-bar-danger { + @include progress-bar-variant($progress-bar-danger-bg); } diff --git a/app/styles/bootstrap/_reset.scss b/app/styles/bootstrap/_reset.scss deleted file mode 100644 index 2f0f029ca..000000000 --- a/app/styles/bootstrap/_reset.scss +++ /dev/null @@ -1,216 +0,0 @@ -// -// Reset CSS -// Adapted from http://github.com/necolas/normalize.css -// -------------------------------------------------- - - -// Display in IE6-9 and FF3 -// ------------------------- - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section { - display: block; -} - -// Display block in IE6-9 and FF3 -// ------------------------- - -audio, -canvas, -video { - display: inline-block; - *display: inline; - *zoom: 1; -} - -// Prevents modern browsers from displaying 'audio' without controls -// ------------------------- - -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 { - @include tab-focus(); -} -// Hover & Active -a:hover, -a:active { - outline: 0; -} - -// Prevents sub and sup affecting line-height in all browsers -// ------------------------- - -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} -sup { - top: -0.5em; -} -sub { - bottom: -0.25em; -} - -// Img border in a's and image quality -// ------------------------- - -img { - /* Responsive images (ensure images don't scale beyond their parents) */ - max-width: 100%; /* Part 1: Set a maxium relative to the parent */ - width: auto\9; /* IE7-8 need help adjusting responsive images */ - height: auto; /* Part 2: Scale the height according to the width, otherwise you get stretching */ - - vertical-align: middle; - border: 0; - -ms-interpolation-mode: bicubic; -} - -// Prevent max-width from affecting Google Maps -#map_canvas img, -.google-maps img { - max-width: none; -} - -// Forms -// ------------------------- - -// Font size in all browsers, margin changes, misc consistency -button, -input, -select, -textarea { - margin: 0; - font-size: 100%; - vertical-align: middle; -} -button, -input { - *overflow: visible; // Inner spacing ie IE6/7 - line-height: normal; // FF3/4 have !important on line-height in UA stylesheet -} -button::-moz-focus-inner, -input::-moz-focus-inner { // Inner padding and border oddities in FF3/4 - padding: 0; - border: 0; -} -button, -html input[type="button"], // Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; // Corrects inability to style clickable `input` types in iOS. - cursor: pointer; // Improves usability and consistency of cursor style between image-type `input` and others. -} -label, -select, -button, -input[type="button"], -input[type="reset"], -input[type="submit"], -input[type="radio"], -input[type="checkbox"] { - cursor: pointer; // Improves usability and consistency of cursor style between image-type `input` and others. -} -input[type="search"] { // Appearance in Safari/Chrome - @include box-sizing(content-box); - -webkit-appearance: textfield; -} -input[type="search"]::-webkit-search-decoration, -input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5 -} -textarea { - overflow: auto; // Remove vertical scrollbar in IE6-9 - vertical-align: top; // Readability and alignment cross-browser -} - - -// Printing -// ------------------------- -// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css - -@media print { - - * { - text-shadow: none !important; - color: #000 !important; // Black prints faster: h5bp.com/s - background: transparent !important; - box-shadow: none !important; - } - - a, - a:visited { - text-decoration: underline; - } - - a[href]:after { - content: " (" attr(href) ")"; - } - - abbr[title]:after { - content: " (" attr(title) ")"; - } - - // Don't show links for images, or javascript/internal links - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; - } - - thead { - display: table-header-group; // h5bp.com/t - } - - tr, - img { - page-break-inside: avoid; - } - - img { - max-width: 100% !important; - } - - @page { - margin: 0.5cm; - } - - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - - h2, - h3 { - page-break-after: avoid; - } -} diff --git a/app/styles/bootstrap/_responsive-utilities.scss b/app/styles/bootstrap/_responsive-utilities.scss index 689b26505..8e65147ca 100644 --- a/app/styles/bootstrap/_responsive-utilities.scss +++ b/app/styles/bootstrap/_responsive-utilities.scss @@ -3,72 +3,196 @@ // -------------------------------------------------- -// IE10 Metro responsive -// Required for Windows 8 Metro split-screen snapping with IE10 +// IE10 in Windows (Phone) 8 +// +// Support for responsive views via media queries is kind of borked in IE10, for +// Surface/desktop in split view and for Windows Phone 8. This particular fix +// must be accompanied by a snippet of JavaScript to sniff the user agent and +// apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at +// our Getting Started page for more information on this bug. +// +// For more information, see the following: +// +// Issue: https://github.com/twbs/bootstrap/issues/10497 +// Docs: http://getbootstrap.com/getting-started/#browsers // Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/ -@-ms-viewport{ + +@-ms-viewport { width: device-width; } -// Hide from screenreaders and browsers -// Credit: HTML5 Boilerplate -.hidden { - display: none; - visibility: hidden; -} // Visibility utilities -// For desktops -.visible-phone { display: none !important; } -.visible-tablet { display: none !important; } -.hidden-phone { } -.hidden-tablet { } -.hidden-desktop { display: none !important; } -.visible-desktop { display: inherit !important; } - -// Tablets & small desktops only -@media (min-width: 768px) and (max-width: 979px) { - // Hide everything else - .hidden-desktop { display: inherit !important; } - .visible-desktop { display: none !important ; } - // Show - .visible-tablet { display: inherit !important; } - // Hide - .hidden-tablet { display: none !important; } +@include responsive-invisibility('.visible-xs'); +@media (max-width: $screen-xs-max) { + @include responsive-visibility('.visible-xs'); } -// Phones only -@media (max-width: 767px) { - // Hide everything else - .hidden-desktop { display: inherit !important; } - .visible-desktop { display: none !important; } - // Show - .visible-phone { display: inherit !important; } // Use inherit to restore previous behavior - // Hide - .hidden-phone { display: none !important; } +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-visibility('.visible-xs.visible-sm'); +} + + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-visibility('.visible-xs.visible-md'); +} + + +@media (min-width: $screen-lg-min) { + @include responsive-visibility('.visible-xs.visible-lg'); +} + + +@include responsive-invisibility('.visible-sm'); + +@media (max-width: $screen-xs-max) { + @include responsive-visibility('.visible-sm.visible-xs'); +} + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-visibility('.visible-sm'); +} + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-visibility('.visible-sm.visible-md'); +} + + +@media (min-width: $screen-lg-min) { + @include responsive-visibility('.visible-sm.visible-lg'); +} + + +@include responsive-invisibility('.visible-md'); + +@media (max-width: $screen-xs-max) { + @include responsive-visibility('.visible-md.visible-xs'); +} + + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-visibility('.visible-md.visible-sm'); +} + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-visibility('.visible-md'); +} + +@media (min-width: $screen-lg-min) { + @include responsive-visibility('.visible-md.visible-lg'); +} + + +@include responsive-invisibility('.visible-lg'); + +@media (max-width: $screen-xs-max) { + @include responsive-visibility('.visible-lg.visible-xs'); +} + + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-visibility('.visible-lg.visible-sm'); +} + + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-visibility('.visible-lg.visible-md'); +} + +@media (min-width: $screen-lg-min) { + @include responsive-visibility('.visible-lg'); +} + +@include responsive-visibility('.hidden-xs'); +@media (max-width: $screen-xs-max) { + @include responsive-invisibility('.hidden-xs'); +} + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-invisibility('.hidden-xs.hidden-sm'); +} + + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-invisibility('.hidden-xs.hidden-md'); +} + + +@media (min-width: $screen-lg-min) { + @include responsive-invisibility('.hidden-xs.hidden-lg'); +} + + +@include responsive-visibility('.hidden-sm'); + +@media (max-width: $screen-xs-max) { + @include responsive-invisibility('.hidden-sm.hidden-xs'); +} + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-invisibility('.hidden-sm'); +} + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-invisibility('.hidden-sm.hidden-md'); +} + + +@media (min-width: $screen-lg-min) { + @include responsive-invisibility('.hidden-sm.hidden-lg'); +} + + +@include responsive-visibility('.hidden-md'); + +@media (max-width: $screen-xs-max) { + @include responsive-invisibility('.hidden-md.hidden-xs'); +} + + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-invisibility('.hidden-md.hidden-sm'); +} + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-invisibility('.hidden-md'); +} + +@media (min-width: $screen-lg-min) { + @include responsive-invisibility('.hidden-md.hidden-lg'); +} + + +@include responsive-visibility('.hidden-lg'); + +@media (max-width: $screen-xs-max) { + @include responsive-invisibility('.hidden-lg.hidden-xs'); +} + + +@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + @include responsive-invisibility('.hidden-lg.hidden-sm'); +} + + +@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { + @include responsive-invisibility('.hidden-lg.hidden-md'); +} + +@media (min-width: $screen-lg-min) { + @include responsive-invisibility('.hidden-lg'); } // Print utilities -.visible-print { display: none !important; } -.hidden-print { } + +@include responsive-invisibility('.visible-print'); @media print { - .visible-print { display: inherit !important; } - .hidden-print { display: none !important; } -} -// Clearing floats -.clearfix { - @include clearfix(); -} + @include responsive-visibility('.visible-print'); -// Accessible yet invisible text -.hide-text { - @include hide-text(); -} -// Uses box-sizing mixin, so must be defined here -.input-block-level { - @include input-block-level(); + @include responsive-invisibility('.hidden-print'); + } diff --git a/app/styles/bootstrap/_scaffolding.scss b/app/styles/bootstrap/_scaffolding.scss index 23d4a00fc..fdf13c7f4 100644 --- a/app/styles/bootstrap/_scaffolding.scss +++ b/app/styles/bootstrap/_scaffolding.scss @@ -3,51 +3,117 @@ // -------------------------------------------------- +// Reset the box-sizing + +*, +*:before, +*:after { + @include box-sizing(border-box); +} + + // Body reset -// ------------------------- + +html { + font-size: 62.5%; + -webkit-tap-highlight-color: rgba(0,0,0,0); +} body { - margin: 0; - font-family: $baseFontFamily; - font-size: $baseFontSize; - line-height: $baseLineHeight; - color: $textColor; - background-color: $bodyBackground; + font-family: $font-family-base; + font-size: $font-size-base; + line-height: $line-height-base; + color: $text-color; + background-color: $body-bg; +} + +// Reset fonts for relevant elements +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; } // Links -// ------------------------- a { - color: $linkColor; + color: $link-color; text-decoration: none; -} -a:hover, -a:focus { - color: $linkColorHover; - text-decoration: underline; + + &:hover, + &:focus { + color: $link-hover-color; + text-decoration: underline; + } + + &:focus { + @include tab-focus(); + } } // Images -// ------------------------- + +img { + vertical-align: middle; +} + +// Responsive images (ensure images don't scale beyond their parents) +.img-responsive { + @include img-responsive(); +} // Rounded corners .img-rounded { - @include border-radius(6px); + border-radius: $border-radius-large; } -// Add polaroid-esque trim -.img-polaroid { - padding: 4px; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0,0,0,.2); - @include box-shadow(0 1px 3px rgba(0,0,0,.1)); +// Image thumbnails +// +// Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`. +.img-thumbnail { + padding: $thumbnail-padding; + line-height: $line-height-base; + background-color: $thumbnail-bg; + border: 1px solid $thumbnail-border; + border-radius: $thumbnail-border-radius; + @include transition(all .2s ease-in-out); + + // Keep them at most 100% wide + @include img-responsive(inline-block); } // Perfect circle .img-circle { - @include border-radius(500px); // crank the border-radius so it works with most reasonably sized images + border-radius: 50%; // set radius in percents +} + + +// Horizontal rules + +hr { + margin-top: $line-height-computed; + margin-bottom: $line-height-computed; + border: 0; + border-top: 1px solid $hr-border; +} + + +// Only display content to screen readers +// +// See: http://a11yproject.com/posts/how-to-hide-content/ + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0,0,0,0); + border: 0; } diff --git a/app/styles/bootstrap/_sprites.scss b/app/styles/bootstrap/_sprites.scss index a64472dcb..7a606fa7d 100644 --- a/app/styles/bootstrap/_sprites.scss +++ b/app/styles/bootstrap/_sprites.scss @@ -19,10 +19,10 @@ display: inline-block; width: 14px; height: 14px; - @include ie7-restore-right-whitespace(); + //@include ie7-restore-right-whitespace(); line-height: 14px; vertical-align: text-top; - background-image: url($iconSpritePath); + background-image: url($icon-sprite-path); background-position: 14px 14px; background-repeat: no-repeat; margin-top: 1px; @@ -46,7 +46,7 @@ .dropdown-submenu:focus > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"], .dropdown-submenu:focus > a > [class*=" icon-"] { - background-image: url($iconWhiteSpritePath); + background-image: url($icon-white-sprite-path); } .icon-glass { background-position: 0 0; } diff --git a/app/styles/bootstrap/_tables.scss b/app/styles/bootstrap/_tables.scss index 3db661e93..8cd1506a4 100644 --- a/app/styles/bootstrap/_tables.scss +++ b/app/styles/bootstrap/_tables.scss @@ -3,233 +3,229 @@ // -------------------------------------------------- -// BASE TABLES -// ----------------- - table { max-width: 100%; - background-color: $tableBackground; - border-collapse: collapse; - border-spacing: 0; + background-color: $table-bg; +} +th { + text-align: left; } -// BASELINE STYLES -// --------------- + +// Baseline styles .table { width: 100%; - margin-bottom: $baseLineHeight; + margin-bottom: $line-height-computed; // Cells - th, - td { - padding: 8px; - line-height: $baseLineHeight; - text-align: left; - vertical-align: top; - border-top: 1px solid $tableBorder; - } - th { - font-weight: bold; + > thead, + > tbody, + > tfoot { + > tr { + > th, + > td { + padding: $table-cell-padding; + line-height: $line-height-base; + vertical-align: top; + border-top: 1px solid $table-border-color; + } + } } // Bottom align for column headings - thead th { + > thead > tr > th { vertical-align: bottom; + border-bottom: 2px solid $table-border-color; } // Remove top border from thead by default - caption + thead tr:first-child th, - caption + thead tr:first-child td, - colgroup + thead tr:first-child th, - colgroup + thead tr:first-child td, - thead:first-child tr:first-child th, - thead:first-child tr:first-child td { - border-top: 0; + > caption + thead, + > colgroup + thead, + > thead:first-child { + > tr:first-child { + > th, + > td { + border-top: 0; + } + } } // Account for multiple tbody instances - tbody + tbody { - border-top: 2px solid $tableBorder; + > tbody + tbody { + border-top: 2px solid $table-border-color; } // Nesting .table { - background-color: $bodyBackground; + background-color: $body-bg; } } - -// CONDENSED TABLE W/ HALF PADDING -// ------------------------------- +// Condensed table w/ half padding .table-condensed { - th, - td { - padding: 4px 5px; + > thead, + > tbody, + > tfoot { + > tr { + > th, + > td { + padding: $table-condensed-cell-padding; + } + } } } -// BORDERED VERSION -// ---------------- +// Bordered version +// +// Add borders all around the table and between all the columns. .table-bordered { - border: 1px solid $tableBorder; - border-collapse: separate; // Done so we can round those corners! - *border-collapse: collapse; // IE7 can't round corners anyway - border-left: 0; - @include border-radius($baseBorderRadius); - th, - td { - border-left: 1px solid $tableBorder; + border: 1px solid $table-border-color; + > thead, + > tbody, + > tfoot { + > tr { + > th, + > td { + border: 1px solid $table-border-color; + } + } } - // Prevent a double border - caption + thead tr:first-child th, - caption + tbody tr:first-child th, - caption + tbody tr:first-child td, - colgroup + thead tr:first-child th, - colgroup + tbody tr:first-child th, - colgroup + tbody tr:first-child td, - thead:first-child tr:first-child th, - tbody:first-child tr:first-child th, - tbody:first-child tr:first-child td { - border-top: 0; + > thead > tr { + > th, + > td { + border-bottom-width: 2px; + } } - // For first th/td in the first row in the first thead or tbody - thead:first-child tr:first-child > th:first-child, - tbody:first-child tr:first-child > td:first-child, - tbody:first-child tr:first-child > th:first-child { - @include border-top-left-radius($baseBorderRadius); - } - // For last th/td in the first row in the first thead or tbody - thead:first-child tr:first-child > th:last-child, - tbody:first-child tr:first-child > td:last-child, - tbody:first-child tr:first-child > th:last-child { - @include border-top-right-radius($baseBorderRadius); - } - // For first th/td (can be either) in the last row in the last thead, tbody, and tfoot - thead:last-child tr:last-child > th:first-child, - tbody:last-child tr:last-child > td:first-child, - tbody:last-child tr:last-child > th:first-child, - tfoot:last-child tr:last-child > td:first-child, - tfoot:last-child tr:last-child > th:first-child { - @include border-bottom-left-radius($baseBorderRadius); - } - // For last th/td (can be either) in the last row in the last thead, tbody, and tfoot - thead:last-child tr:last-child > th:last-child, - tbody:last-child tr:last-child > td:last-child, - tbody:last-child tr:last-child > th:last-child, - tfoot:last-child tr:last-child > td:last-child, - tfoot:last-child tr:last-child > th:last-child { - @include border-bottom-right-radius($baseBorderRadius); - } - - // Clear border-radius for first and last td in the last row in the last tbody for table with tfoot - tfoot + tbody:last-child tr:last-child td:first-child { - @include border-bottom-left-radius(0); - } - tfoot + tbody:last-child tr:last-child td:last-child { - @include border-bottom-right-radius(0); - } - - // Special fixes to round the left border on the first td/th - caption + thead tr:first-child th:first-child, - caption + tbody tr:first-child td:first-child, - colgroup + thead tr:first-child th:first-child, - colgroup + tbody tr:first-child td:first-child { - @include border-top-left-radius($baseBorderRadius); - } - caption + thead tr:first-child th:last-child, - caption + tbody tr:first-child td:last-child, - colgroup + thead tr:first-child th:last-child, - colgroup + tbody tr:first-child td:last-child { - @include border-top-right-radius($baseBorderRadius); - } - } - - -// ZEBRA-STRIPING -// -------------- - +// Zebra-striping +// // Default zebra-stripe styles (alternating gray and transparent backgrounds) + .table-striped { - tbody { - > tr:nth-child(odd) > td, - > tr:nth-child(odd) > th { - background-color: $tableBackgroundAccent; + > tbody > tr:nth-child(odd) { + > td, + > th { + background-color: $table-bg-accent; } } } -// HOVER EFFECT -// ------------ +// Hover effect +// // Placed here since it has to come after the potential zebra striping + .table-hover { - tbody { - tr:hover > td, - tr:hover > th { - background-color: $tableBackgroundHover; + > tbody > tr:hover { + > td, + > th { + background-color: $table-bg-hover; } } } -// TABLE CELL SIZING -// ----------------- +// Table cell sizing +// +// Reset default table behavior -// Reset default grid behavior -table td[class*="span"], -table th[class*="span"], -.row-fluid table td[class*="span"], -.row-fluid table th[class*="span"] { - display: table-cell; - float: none; // undo default grid column styles - margin-left: 0; // undo default grid column styles +table col[class*="col-"] { + position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623) + float: none; + display: table-column; } - -// Change the column widths to account for td/th padding -.table td, -.table th { - @for $i from 1 through 12 { - &.span#{$i} { @include tableColumns($i); } +table { + td, + th { + &[class*="col-"] { + float: none; + display: table-cell; + } } } +// Table backgrounds +// +// Exact selectors below required to override `.table-striped` and prevent +// inheritance to nested tables. -// TABLE BACKGROUNDS -// ----------------- -// Exact selectors below required to override .table-striped +// Generate the contextual variants +@include table-row-variant('active', $table-bg-active); +@include table-row-variant('success', $state-success-bg); +@include table-row-variant('danger', $state-danger-bg); +@include table-row-variant('warning', $state-warning-bg); -.table tbody tr { - &.success > td { - background-color: $successBackground; - } - &.error > td { - background-color: $errorBackground; - } - &.warning > td { - background-color: $warningBackground; - } - &.info > td { - background-color: $infoBackground; - } -} - -// Hover states for .table-hover -.table-hover tbody tr { - &.success:hover > td { - background-color: darken($successBackground, 5%); - } - &.error:hover > td { - background-color: darken($errorBackground, 5%); - } - &.warning:hover > td { - background-color: darken($warningBackground, 5%); - } - &.info:hover > td { - background-color: darken($infoBackground, 5%); + +// Responsive tables +// +// Wrap your tables in `.table-responsive` and we'll make them mobile friendly +// by enabling horizontal scrolling. Only applies <768px. Everything above that +// will display normally. + +@media (max-width: $screen-xs-max) { + .table-responsive { + width: 100%; + margin-bottom: ($line-height-computed * 0.75); + overflow-y: hidden; + overflow-x: scroll; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid $table-border-color; + -webkit-overflow-scrolling: touch; + + // Tighten up spacing + > .table { + margin-bottom: 0; + + // Ensure the content doesn't wrap + > thead, + > tbody, + > tfoot { + > tr { + > th, + > td { + white-space: nowrap; + } + } + } + } + + // Special overrides for the bordered tables + > .table-bordered { + border: 0; + + // Nuke the appropriate borders so that the parent can handle them + > thead, + > tbody, + > tfoot { + > tr { + > th:first-child, + > td:first-child { + border-left: 0; + } + > th:last-child, + > td:last-child { + border-right: 0; + } + } + } + + // Only nuke the last row's bottom-border in `tbody` and `tfoot` since + // chances are there will be only one `tr` in a `thead` and that would + // remove the border altogether. + > tbody, + > tfoot { + > tr:last-child { + > th, + > td { + border-bottom: 0; + } + } + } + + } } } diff --git a/app/styles/bootstrap/_theme.scss b/app/styles/bootstrap/_theme.scss new file mode 100644 index 000000000..988c37ceb --- /dev/null +++ b/app/styles/bootstrap/_theme.scss @@ -0,0 +1,247 @@ + +// +// Load core variables and mixins +// -------------------------------------------------- + +@import "bootstrap/variables"; +@import "bootstrap/mixins"; + + + +// +// Buttons +// -------------------------------------------------- + +// Common styles +.btn-default, +.btn-primary, +.btn-success, +.btn-info, +.btn-warning, +.btn-danger { + text-shadow: 0 -1px 0 rgba(0,0,0,.2); + $shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075); + @include box-shadow($shadow); + + // Reset the shadow + &:active, + &.active { + @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); + } +} + +// Mixin for generating new styles +@mixin btn-styles($btn-color: #555) { + @include gradient-vertical($start-color: $btn-color, $end-color: darken($btn-color, 12%)); + @include reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners + background-repeat: repeat-x; + border-color: darken($btn-color, 14%); + + &:hover, + &:focus { + background-color: darken($btn-color, 12%); + background-position: 0 -15px; + } + + &:active, + &.active { + background-color: darken($btn-color, 12%); + border-color: darken($btn-color, 14%); + } +} + +// Common styles +.btn { + // Remove the gradient for the pressed/active state + &:active, + &.active { + background-image: none; + } +} + +// Apply the mixin to the buttons +.btn-default { @include btn-styles($btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; } +.btn-primary { @include btn-styles($btn-primary-bg); } +.btn-success { @include btn-styles($btn-success-bg); } +.btn-warning { @include btn-styles($btn-warning-bg); } +.btn-danger { @include btn-styles($btn-danger-bg); } +.btn-info { @include btn-styles($btn-info-bg); } + + + +// +// Images +// -------------------------------------------------- + +.thumbnail, +.img-thumbnail { + @include box-shadow(0 1px 2px rgba(0,0,0,.075)); +} + + + +// +// Dropdowns +// -------------------------------------------------- + +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + @include gradient-vertical($start-color: $dropdown-link-hover-bg, $end-color: darken($dropdown-link-hover-bg, 5%)); + background-color: darken($dropdown-link-hover-bg, 5%); +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + @include gradient-vertical($start-color: $dropdown-link-active-bg, $end-color: darken($dropdown-link-active-bg, 5%)); + background-color: darken($dropdown-link-active-bg, 5%); +} + + + +// +// Navbar +// -------------------------------------------------- + +// Default navbar +.navbar-default { + @include gradient-vertical($start-color: lighten($navbar-default-bg, 10%), $end-color: $navbar-default-bg); + @include reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered + border-radius: $navbar-border-radius; + $shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075); + @include box-shadow($shadow); + + .navbar-nav > .active > a { + @include gradient-vertical($start-color: darken($navbar-default-bg, 5%), $end-color: darken($navbar-default-bg, 2%)); + @include box-shadow(inset 0 3px 9px rgba(0,0,0,.075)); + } +} +.navbar-brand, +.navbar-nav > li > a { + text-shadow: 0 1px 0 rgba(255,255,255,.25); +} + +// Inverted navbar +.navbar-inverse { + @include gradient-vertical($start-color: lighten($navbar-inverse-bg, 10%), $end-color: $navbar-inverse-bg); + @include reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered + + .navbar-nav > .active > a { + @include gradient-vertical($start-color: $navbar-inverse-bg, $end-color: lighten($navbar-inverse-bg, 2.5%)); + @include box-shadow(inset 0 3px 9px rgba(0,0,0,.25)); + } + + .navbar-brand, + .navbar-nav > li > a { + text-shadow: 0 -1px 0 rgba(0,0,0,.25); + } +} + +// Undo rounded corners in static and fixed navbars +.navbar-static-top, +.navbar-fixed-top, +.navbar-fixed-bottom { + border-radius: 0; +} + + + +// +// Alerts +// -------------------------------------------------- + +// Common styles +.alert { + text-shadow: 0 1px 0 rgba(255,255,255,.2); + $shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05); + @include box-shadow($shadow); +} + +// Mixin for generating new styles +@mixin alert-styles($color) { + @include gradient-vertical($start-color: $color, $end-color: darken($color, 7.5%)); + border-color: darken($color, 15%); +} + +// Apply the mixin to the alerts +.alert-success { @include alert-styles($alert-success-bg); } +.alert-info { @include alert-styles($alert-info-bg); } +.alert-warning { @include alert-styles($alert-warning-bg); } +.alert-danger { @include alert-styles($alert-danger-bg); } + + + +// +// Progress bars +// -------------------------------------------------- + +// Give the progress background some depth +.progress { + @include gradient-vertical($start-color: darken($progress-bg, 4%), $end-color: $progress-bg) +} + +// Mixin for generating new styles +@mixin progress-bar-styles($color) { + @include gradient-vertical($start-color: $color, $end-color: darken($color, 10%)); +} + +// Apply the mixin to the progress bars +.progress-bar { @include progress-bar-styles($progress-bar-bg); } +.progress-bar-success { @include progress-bar-styles($progress-bar-success-bg); } +.progress-bar-info { @include progress-bar-styles($progress-bar-info-bg); } +.progress-bar-warning { @include progress-bar-styles($progress-bar-warning-bg); } +.progress-bar-danger { @include progress-bar-styles($progress-bar-danger-bg); } + + + +// +// List groups +// -------------------------------------------------- + +.list-group { + border-radius: $border-radius-base; + @include box-shadow(0 1px 2px rgba(0,0,0,.075)); +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + text-shadow: 0 -1px 0 darken($list-group-active-bg, 10%); + @include gradient-vertical($start-color: $list-group-active-bg, $end-color: darken($list-group-active-bg, 7.5%)); + border-color: darken($list-group-active-border, 7.5%); +} + + + +// +// Panels +// -------------------------------------------------- + +// Common styles +.panel { + @include box-shadow(0 1px 2px rgba(0,0,0,.05)); +} + +// Mixin for generating new styles +@mixin panel-heading-styles($color) { + @include gradient-vertical($start-color: $color, $end-color: darken($color, 5%)); +} + +// Apply the mixin to the panel headings only +.panel-default > .panel-heading { @include panel-heading-styles($panel-default-heading-bg); } +.panel-primary > .panel-heading { @include panel-heading-styles($panel-primary-heading-bg); } +.panel-success > .panel-heading { @include panel-heading-styles($panel-success-heading-bg); } +.panel-info > .panel-heading { @include panel-heading-styles($panel-info-heading-bg); } +.panel-warning > .panel-heading { @include panel-heading-styles($panel-warning-heading-bg); } +.panel-danger > .panel-heading { @include panel-heading-styles($panel-danger-heading-bg); } + + + +// +// Wells +// -------------------------------------------------- + +.well { + @include gradient-vertical($start-color: darken($well-bg, 5%), $end-color: $well-bg); + border-color: darken($well-bg, 10%); + $shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1); + @include box-shadow($shadow); +} diff --git a/app/styles/bootstrap/_thumbnails.scss b/app/styles/bootstrap/_thumbnails.scss index 6333d5334..3d5ed86d0 100644 --- a/app/styles/bootstrap/_thumbnails.scss +++ b/app/styles/bootstrap/_thumbnails.scss @@ -3,51 +3,36 @@ // -------------------------------------------------- -// Note: `.thumbnails` and `.thumbnails > li` are overriden in responsive files - -// Make wrapper ul behave like the grid -.thumbnails { - margin-left: -$gridGutterWidth; - list-style: none; - @include clearfix(); -} -// Fluid rows have no left margin -.row-fluid .thumbnails { - margin-left: 0; -} - -// Float li to make thumbnails appear in a row -.thumbnails > li { - float: left; // Explicity set the float since we don't require .span* classes - margin-bottom: $baseLineHeight; - margin-left: $gridGutterWidth; -} - -// The actual thumbnail (can be `a` or `div`) +// Mixin and adjust the regular image class .thumbnail { display: block; - padding: 4px; - line-height: $baseLineHeight; - border: 1px solid #ddd; - @include border-radius($baseBorderRadius); - @include box-shadow(0 1px 3px rgba(0,0,0,.055)); + padding: $thumbnail-padding; + margin-bottom: $line-height-computed; + line-height: $line-height-base; + background-color: $thumbnail-bg; + border: 1px solid $thumbnail-border; + border-radius: $thumbnail-border-radius; @include transition(all .2s ease-in-out); -} -// Add a hover/focus state for linked versions only -a.thumbnail:hover, -a.thumbnail:focus { - border-color: $linkColor; - @include box-shadow(0 1px 4px rgba(0,105,214,.25)); + + > img, + a > img { + @include img-responsive(); + margin-left: auto; + margin-right: auto; + } + + // [converter] extracted a&:hover, a&:focus, a&.active to a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active + + // Image captions + .caption { + padding: $thumbnail-caption-padding; + color: $thumbnail-caption-color; + } } -// Images and captions -.thumbnail > img { - display: block; - max-width: 100%; - margin-left: auto; - margin-right: auto; -} -.thumbnail .caption { - padding: 9px; - color: $gray; +// Add a hover state for linked versions only +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: $link-color; } diff --git a/app/styles/bootstrap/_tooltip.scss b/app/styles/bootstrap/_tooltip.scss index af2d64cb0..a681adcbd 100644 --- a/app/styles/bootstrap/_tooltip.scss +++ b/app/styles/bootstrap/_tooltip.scss @@ -6,28 +6,29 @@ // Base class .tooltip { position: absolute; - z-index: $zindexTooltip; + z-index: $zindex-tooltip; display: block; visibility: visible; - font-size: 11px; + font-size: $font-size-small; line-height: 1.4; @include opacity(0); - &.in { @include opacity(80); } - &.top { margin-top: -3px; padding: 5px 0; } - &.right { margin-left: 3px; padding: 0 5px; } - &.bottom { margin-top: 3px; padding: 5px 0; } - &.left { margin-left: -3px; padding: 0 5px; } + + &.in { @include opacity(.9); } + &.top { margin-top: -3px; padding: $tooltip-arrow-width 0; } + &.right { margin-left: 3px; padding: 0 $tooltip-arrow-width; } + &.bottom { margin-top: 3px; padding: $tooltip-arrow-width 0; } + &.left { margin-left: -3px; padding: 0 $tooltip-arrow-width; } } // Wrapper for the tooltip content .tooltip-inner { - max-width: 200px; - padding: 8px; - color: $tooltipColor; + max-width: $tooltip-max-width; + padding: 3px 8px; + color: $tooltip-color; text-align: center; text-decoration: none; - background-color: $tooltipBackground; - @include border-radius($baseBorderRadius); + background-color: $tooltip-bg; + border-radius: $border-radius-base; } // Arrows @@ -42,29 +43,53 @@ &.top .tooltip-arrow { bottom: 0; left: 50%; - margin-left: -$tooltipArrowWidth; - border-width: $tooltipArrowWidth $tooltipArrowWidth 0; - border-top-color: $tooltipArrowColor; + margin-left: -$tooltip-arrow-width; + border-width: $tooltip-arrow-width $tooltip-arrow-width 0; + border-top-color: $tooltip-arrow-color; + } + &.top-left .tooltip-arrow { + bottom: 0; + left: $tooltip-arrow-width; + border-width: $tooltip-arrow-width $tooltip-arrow-width 0; + border-top-color: $tooltip-arrow-color; + } + &.top-right .tooltip-arrow { + bottom: 0; + right: $tooltip-arrow-width; + border-width: $tooltip-arrow-width $tooltip-arrow-width 0; + border-top-color: $tooltip-arrow-color; } &.right .tooltip-arrow { top: 50%; left: 0; - margin-top: -$tooltipArrowWidth; - border-width: $tooltipArrowWidth $tooltipArrowWidth $tooltipArrowWidth 0; - border-right-color: $tooltipArrowColor; + margin-top: -$tooltip-arrow-width; + border-width: $tooltip-arrow-width $tooltip-arrow-width $tooltip-arrow-width 0; + border-right-color: $tooltip-arrow-color; } &.left .tooltip-arrow { top: 50%; right: 0; - margin-top: -$tooltipArrowWidth; - border-width: $tooltipArrowWidth 0 $tooltipArrowWidth $tooltipArrowWidth; - border-left-color: $tooltipArrowColor; + margin-top: -$tooltip-arrow-width; + border-width: $tooltip-arrow-width 0 $tooltip-arrow-width $tooltip-arrow-width; + border-left-color: $tooltip-arrow-color; } &.bottom .tooltip-arrow { top: 0; left: 50%; - margin-left: -$tooltipArrowWidth; - border-width: 0 $tooltipArrowWidth $tooltipArrowWidth; - border-bottom-color: $tooltipArrowColor; + margin-left: -$tooltip-arrow-width; + border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; + border-bottom-color: $tooltip-arrow-color; + } + &.bottom-left .tooltip-arrow { + top: 0; + left: $tooltip-arrow-width; + border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; + border-bottom-color: $tooltip-arrow-color; + } + &.bottom-right .tooltip-arrow { + top: 0; + right: $tooltip-arrow-width; + border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; + border-bottom-color: $tooltip-arrow-color; } } diff --git a/app/styles/bootstrap/_type.scss b/app/styles/bootstrap/_type.scss index f68e7ba2d..979f5d058 100644 --- a/app/styles/bootstrap/_type.scss +++ b/app/styles/bootstrap/_type.scss @@ -3,17 +3,71 @@ // -------------------------------------------------- +// Headings +// ------------------------- + +h1, h2, h3, h4, h5, h6, +.h1, .h2, .h3, .h4, .h5, .h6 { + font-family: $headings-font-family; + font-weight: $headings-font-weight; + line-height: $headings-line-height; + color: $headings-color; + + small, + .small { + font-weight: normal; + line-height: 1; + color: $headings-small-color; + } +} + +h1, +h2, +h3 { + margin-top: $line-height-computed; + margin-bottom: ($line-height-computed / 2); + + small, + .small { + font-size: 65%; + } +} +h4, +h5, +h6 { + margin-top: ($line-height-computed / 2); + margin-bottom: ($line-height-computed / 2); + + small, + .small { + font-size: 75%; + } +} + +h1, .h1 { font-size: $font-size-h1; } +h2, .h2 { font-size: $font-size-h2; } +h3, .h3 { font-size: $font-size-h3; } +h4, .h4 { font-size: $font-size-h4; } +h5, .h5 { font-size: $font-size-h5; } +h6, .h6 { font-size: $font-size-h6; } + + // Body text // ------------------------- p { - margin: 0 0 $baseLineHeight / 2; + margin: 0 0 ($line-height-computed / 2); } + .lead { - margin-bottom: $baseLineHeight; - font-size: $baseFontSize * 1.5; + margin-bottom: $line-height-computed; + font-size: floor($font-size-base * 1.15); font-weight: 200; - line-height: $baseLineHeight * 1.5; + line-height: 1.4; + + @media (min-width: $screen-sm-min) { + font-size: ($font-size-base * 1.5); + } } @@ -21,218 +75,199 @@ p { // ------------------------- // Ex: 14px base font * 85% = about 12px -small { font-size: 85%; } +small, +.small { font-size: 85%; } -strong { font-weight: bold; } -em { font-style: italic; } +// Undo browser default styling cite { font-style: normal; } -// Utility classes -.muted { color: $grayLight; } -a.muted:hover, -a.muted:focus { color: darken($grayLight, 10%); } - -.text-warning { color: $warningText; } -a.text-warning:hover, -a.text-warning:focus { color: darken($warningText, 10%); } - -.text-error { color: $errorText; } -a.text-error:hover, -a.text-error:focus { color: darken($errorText, 10%); } - -.text-info { color: $infoText; } -a.text-info:hover, -a.text-info:focus { color: darken($infoText, 10%); } - -.text-success { color: $successText; } -a.text-success:hover, -a.text-success:focus { color: darken($successText, 10%); } - -.text-left { text-align: left; } -.text-right { text-align: right; } -.text-center { text-align: center; } - - -// Headings -// ------------------------- - -h1, h2, h3, h4, h5, h6 { - margin: ($baseLineHeight / 2) 0; - font-family: $headingsFontFamily; - font-weight: $headingsFontWeight; - line-height: $baseLineHeight; - color: $headingsColor; - text-rendering: optimizelegibility; // Fix the character spacing for headings - small { - font-weight: normal; - line-height: 1; - color: $grayLight; +// Contextual emphasis +.text-muted { + color: $text-muted; +} +.text-primary { + color: $brand-primary; + &:hover { + color: darken($brand-primary, 10%); + } +} +.text-warning { + color: $state-warning-text; + &:hover { + color: darken($state-warning-text, 10%); + } +} +.text-danger { + color: $state-danger-text; + &:hover { + color: darken($state-danger-text, 10%); + } +} +.text-success { + color: $state-success-text; + &:hover { + color: darken($state-success-text, 10%); + } +} +.text-info { + color: $state-info-text; + &:hover { + color: darken($state-info-text, 10%); } } -h1, -h2, -h3 { line-height: $baseLineHeight * 2; } - -h1 { font-size: $baseFontSize * 2.75; } // ~38px -h2 { font-size: $baseFontSize * 2.25; } // ~32px -h3 { font-size: $baseFontSize * 1.75; } // ~24px -h4 { font-size: $baseFontSize * 1.25; } // ~18px -h5 { font-size: $baseFontSize; } -h6 { font-size: $baseFontSize * 0.85; } // ~12px - -h1 small { font-size: $baseFontSize * 1.75; } // ~24px -h2 small { font-size: $baseFontSize * 1.25; } // ~18px -h3 small { font-size: $baseFontSize; } -h4 small { font-size: $baseFontSize; } +// Alignment +.text-left { text-align: left; } +.text-right { text-align: right; } +.text-center { text-align: center; } // Page header // ------------------------- .page-header { - padding-bottom: ($baseLineHeight / 2) - 1; - margin: $baseLineHeight 0 ($baseLineHeight * 1.5); - border-bottom: 1px solid $grayLighter; + padding-bottom: (($line-height-computed / 2) - 1); + margin: ($line-height-computed * 2) 0 $line-height-computed; + border-bottom: 1px solid $page-header-border-color; } - // Lists // -------------------------------------------------- // Unordered and Ordered lists -ul, ol { - padding: 0; - margin: 0 0 $baseLineHeight / 2 25px; -} -ul ul, -ul ol, -ol ol, -ol ul { - margin-bottom: 0; -} -li { - line-height: $baseLineHeight; +ul, +ol { + margin-top: 0; + margin-bottom: ($line-height-computed / 2); + ul, + ol { + margin-bottom: 0; + } } -// Remove default list styles -ul.unstyled, -ol.unstyled { - margin-left: 0; +// List options + +// Unstyled keeps list items block level, just removes default browser padding and list-style +.list-unstyled { + padding-left: 0; list-style: none; } -// Single-line list items -ul.inline, -ol.inline { - margin-left: 0; - list-style: none; +// Inline turns list items into inline-block +.list-inline { + @extend .list-unstyled; + > li { display: inline-block; - @include ie7-inline-block(); padding-left: 5px; padding-right: 5px; + + &:first-child { + padding-left: 0; + } } } // Description Lists dl { - margin-bottom: $baseLineHeight; + margin-top: 0; // Remove browser default + margin-bottom: $line-height-computed; } dt, dd { - line-height: $baseLineHeight; + line-height: $line-height-base; } dt { font-weight: bold; } dd { - margin-left: $baseLineHeight / 2; + margin-left: 0; // Undo browser default } -// Horizontal layout (like forms) -.dl-horizontal { - @include clearfix(); // Ensure dl clears floats if empty dd elements present - dt { - float: left; - width: $horizontalComponentOffset - 20; - clear: left; - text-align: right; - @include text-overflow(); - } - dd { - margin-left: $horizontalComponentOffset; + +// Horizontal description lists +// +// Defaults to being stacked without any of the below styles applied, until the +// grid breakpoint is reached (default of ~768px). + +@media (min-width: $grid-float-breakpoint) { + .dl-horizontal { + dt { + float: left; + width: ($component-offset-horizontal - 20); + clear: left; + text-align: right; + @include text-overflow(); + } + dd { + margin-left: $component-offset-horizontal; + @include clearfix(); // Clear the floated `dt` if an empty `dd` is present + } } } // MISC // ---- -// Horizontal rules -hr { - margin: $baseLineHeight 0; - border: 0; - border-top: 1px solid $hrBorder; - border-bottom: 1px solid $white; -} - // Abbreviations and acronyms abbr[title], -// Added data-* attribute to help out our tooltip plugin, per https://github.com/twitter/bootstrap/issues/5257 +// Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257 abbr[data-original-title] { cursor: help; - border-bottom: 1px dotted $grayLight; + border-bottom: 1px dotted $abbr-border-color; } -abbr.initialism { +.initialism { font-size: 90%; text-transform: uppercase; } // Blockquotes blockquote { - padding: 0 0 0 15px; - margin: 0 0 $baseLineHeight; - border-left: 5px solid $grayLighter; + padding: ($line-height-computed / 2) $line-height-computed; + margin: 0 0 $line-height-computed; + border-left: 5px solid $blockquote-border-color; p { - margin-bottom: 0; - font-size: $baseFontSize * 1.25; + font-size: ($font-size-base * 1.25); font-weight: 300; line-height: 1.25; } - small { + p:last-child { + margin-bottom: 0; + } + small, + .small { display: block; - line-height: $baseLineHeight; - color: $grayLight; + line-height: $line-height-base; + color: $blockquote-small-color; &:before { - content: '\2014 \00A0'; + content: '\2014 \00A0'; // EM DASH, NBSP } } // Float right with text-align: right &.pull-right { - float: right; padding-right: 15px; padding-left: 0; - border-right: 5px solid $grayLighter; + border-right: 5px solid $blockquote-border-color; border-left: 0; p, - small { + small, + .small { text-align: right; } - small { + small, + .small { &:before { content: ''; } &:after { - content: '\00A0 \2014'; + content: '\00A0 \2014'; // NBSP, EM DASH } } } } // Quotes -q:before, -q:after, blockquote:before, blockquote:after { content: ""; @@ -240,8 +275,7 @@ blockquote:after { // Addresses address { - display: block; - margin-bottom: $baseLineHeight; + margin-bottom: $line-height-computed; font-style: normal; - line-height: $baseLineHeight; + line-height: $line-height-base; } diff --git a/app/styles/bootstrap/_utilities.scss b/app/styles/bootstrap/_utilities.scss index 1dec18b60..85cb62ea7 100644 --- a/app/styles/bootstrap/_utilities.scss +++ b/app/styles/bootstrap/_utilities.scss @@ -3,43 +3,54 @@ // -------------------------------------------------- -// Quick floats -.pull-right { - float: right; -} -.pull-left { - float: left; -} +// Floats +// ------------------------- -// Toggling content -.hide { - display: none; -} -.show { - display: block; -} - -// Visibility -.invisible { - visibility: hidden; -} - -// For Affix plugin -.affix { - position: fixed; -} - -// Clearing floats .clearfix { @include clearfix(); } - -// Accessible yet invisible text -.hide-text { - @include hide-text(); +.center-block { + @include center-block(); +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; } -// Uses box-sizing mixin, so must be defined here -.input-block-level { - @include input-block-level(); + +// Toggling content +// ------------------------- + +// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + @include text-hide(); +} + + +// Hide from screenreaders and browsers +// +// Credit: HTML5 Boilerplate + +.hidden { + display: none !important; + visibility: hidden !important; +} + + +// For Affix plugin +// ------------------------- + +.affix { + position: fixed; } diff --git a/app/styles/bootstrap/_variables.scss b/app/styles/bootstrap/_variables.scss index a2564f16c..a6766b5f3 100644 --- a/app/styles/bootstrap/_variables.scss +++ b/app/styles/bootstrap/_variables.scss @@ -1,22 +1,25 @@ -// Cerulean 2.3.0 +// a flag to toggle asset pipeline / compass integration +// defaults to true if twbs-font-path function is present (no function => twbs-font-path('') parsed as string == right side) +// in Sass 3.3 this can be improved with: function-exists(twbs-font-path) +$bootstrap-sass-asset-helper: (twbs-font-path('') != unquote("twbs-font-path('')")) !default; +// // Variables // -------------------------------------------------- -// GLOBAL VALUES +// Global values // -------------------------------------------------- - // Grays // ------------------------- -$black: #000; -$grayDarker: #222; -$grayDark: #333; -$gray: #555; -$grayLight: #999; -$grayLighter: #F5F5F5; -$white: #fff; +$black: #000; +$gray-darker: #222; +$gray-dark: #333; +$gray: #555; +$gray-light: #999; +$gray-lighter: #F5F5F5; +$white: #fff; // Accent colors // ------------------------- @@ -29,109 +32,183 @@ $orange: #DD5600; $pink: #F49AC1; $purple: #9760B3; +// Brand colors +// ------------------------- + +$brand-primary: #948754 !default; +$brand-success: $green !default; +$brand-warning: $orange !default; +$brand-danger: $red !default; +$brand-info: #f9e811 !default; // Scaffolding // ------------------------- -$bodyBackground: #2f261d; -$textColor: $gray; +$body-bg: #2f261d; +$text-color: $gray !default; // Links // ------------------------- -$linkColor: $blue; -$linkColorHover: darken($linkColor, 15%); +$link-color: $blue; +$link-hover-color: darken($link-color, 15%) !default; // Typography // ------------------------- -$sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif; -$serifFontFamily: Georgia, "Times New Roman", Times, serif; -$monoFontFamily: Menlo, Monaco, Consolas, "Courier New", monospace; -$baseFontSize: 14px; -$baseFontFamily: $sansFontFamily; -$baseLineHeight: 20px; -$altFontFamily: $monoFontFamily; +$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 !default; -$headingsFontFamily: 'Bangers', cursive; // empty to use BS default, $baseFontFamily -$headingsFontWeight: normal; // Bangers shouldn't be bolded, it's practically unreadable in FF -$headingsColor: #317EAC; // empty to use BS default, $textColor -$headingsLetterSpacing: 1px; //making Bangers more legible +$font-size-base: 14px !default; +$font-size-large: ceil($font-size-base * 1.25) !default; // ~18px +$font-size-small: ceil($font-size-base * 0.85) !default; // ~12px + +$font-size-h1: 38.5px; +$font-size-h2: 31.5px; +$font-size-h3: 24.5px; +$font-size-h4: 17.5px; +$font-size-h5: $font-size-base !default; +$font-size-h6: ceil($font-size-base * 0.85) !default; // ~12px + +$line-height-base: 1.428571429 !default; // 20/14 +$line-height-computed: floor($font-size-base * $line-height-base) !default; // ~20px + +$headings-font-family: 'Bangers', cursive; // empty to use BS default, $baseFontFamily; +$headings-font-weight: 500 !default; +$headings-line-height: 1.1 !default; +$headings-color: #317EAC; -// Component sizing +// Iconography // ------------------------- -// Based on 14px font-size and 20px line-height -$fontSizeLarge: $baseFontSize * 1.25; // ~18px -$fontSizeSmall: $baseFontSize * 0.85; // ~12px -$fontSizeMini: $baseFontSize * 0.75; // ~11px +$icon-font-path: "bootstrap/" !default; +$icon-font-name: "glyphicons-halflings-regular" !default; -$paddingLarge: 11px 19px; // 44px -$paddingSmall: 2px 10px; // 26px -$paddingMini: 0px 6px; // 22px +// Sprite icons path +// ------------------------- +$icon-sprite-path: "/images/pages/base/glyphicons-halflings.png"; +$icon-white-sprite-path: "/images/pages/base/glyphicons-halflings-white.png"; -$baseBorderRadius: 4px; -$borderRadiusLarge: 6px; -$borderRadiusSmall: 3px; +// Components +// ------------------------- +// Based on 14px font-size and 1.428 line-height (~20px to start) +$padding-base-vertical: 6px !default; +$padding-base-horizontal: 12px !default; + +$padding-large-vertical: 11px !default; +$padding-large-horizontal: 19px !default; + +$padding-small-vertical: 2px !default; +$padding-small-horizontal: 10px !default; + +$padding-xs-vertical: 0px !default; +$padding-xs-horizontal: 6px !default; + +$line-height-large: 1.33 !default; +$line-height-small: 1.5 !default; + +$border-radius-base: 4px !default; +$border-radius-large: 6px !default; +$border-radius-small: 3px !default; + +$component-active-color: #fff !default; +$component-active-bg: $brand-primary !default; + +$caret-width-base: 4px !default; +$caret-width-large: 5px !default; // Tables // ------------------------- -$tableBackground: transparent; // overall background-color -$tableBackgroundAccent: #f9f9f9; // for striping -$tableBackgroundHover: #f5f5f5; // for hover -$tableBorder: #ddd; // table and cell border + +$table-cell-padding: 8px !default; +$table-condensed-cell-padding: 5px !default; + +$table-bg: transparent !default; // overall background-color +$table-bg-accent: #f9f9f9 !default; // for striping +$table-bg-hover: #f5f5f5 !default; +$table-bg-active: $table-bg-hover !default; + +$table-border-color: #ddd !default; // table and cell border + // Buttons // ------------------------- -$btnBackground: $white; -$btnBackgroundHighlight: darken($white, 10%); -$btnBorder: darken($white, 20%); -$btnPrimaryBackground: #948754; -$btnPrimaryBackgroundHighlight: adjust-hue(#948754, 15%); +$btn-font-weight: normal !default; -$btnInfoBackground: #f9e811; -$btnInfoBackgroundHighlight: #ae671b; +$btn-default-color: #333 !default; +$btn-default-bg: #fff !default; +$btn-default-border: #ccc !default; -$btnSuccessBackground: $green; -$btnSuccessBackgroundHighlight: #51a351; +$btn-primary-color: #fff !default; +$btn-primary-bg: $brand-primary !default; +$btn-primary-border: darken($btn-primary-bg, 5%) !default; -$btnWarningBackground: $orange; -$btnWarningBackgroundHighlight: $orange; +$btn-success-color: #fff !default; +$btn-success-bg: $brand-success !default; +$btn-success-border: darken($btn-success-bg, 5%) !default; -$btnDangerBackground: $red; -$btnDangerBackgroundHighlight: #bd362f; +$btn-warning-color: #fff !default; +$btn-warning-bg: $brand-warning !default; +$btn-warning-border: darken($btn-warning-bg, 5%) !default; -$btnInverseBackground: $blueDark; -$btnInverseBackgroundHighlight: $grayDarker; +$btn-danger-color: #fff !default; +$btn-danger-bg: $brand-danger !default; +$btn-danger-border: darken($btn-danger-bg, 5%) !default; + +$btn-info-color: #fff !default; +$btn-info-bg: $brand-info !default; +$btn-info-border: darken($btn-info-bg, 5%) !default; + +$btn-link-disabled-color: $gray-light !default; // Forms // ------------------------- -$inputBackground: $white; -$inputBorder: #ccc; -$inputBorderRadius: $baseBorderRadius; -$inputDisabledBackground: $grayLighter; -$formActionsBackground: #f5f5f5; -$inputHeight: $baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border + +$input-bg: #fff !default; +$input-bg-disabled: $gray-lighter !default; + +$input-color: $gray !default; +$input-border: #ccc !default; +$input-border-radius: $border-radius-base !default; +$input-border-focus: #66afe9 !default; + +$input-color-placeholder: $gray-light !default; + +$input-height-base: ($line-height-computed + ($padding-base-vertical * 2) + 2) !default; +$input-height-large: (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default; +$input-height-small: (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default; + +$legend-color: $gray-dark !default; +$legend-border-color: #e5e5e5 !default; + +$input-group-addon-bg: $gray-lighter !default; +$input-group-addon-border-color: $input-border !default; // Dropdowns // ------------------------- -$dropdownBackground: $white; -$dropdownBorder: rgba(0,0,0,.2); -$dropdownDividerTop: #e5e5e5; -$dropdownDividerBottom: $white; -$dropdownLinkColor: $grayDark; -$dropdownLinkColorHover: $white; -$dropdownLinkColorActive: $white; +$dropdown-bg: #fff !default; +$dropdown-border: rgba(0,0,0,.15) !default; +$dropdown-fallback-border: #ccc !default; +$dropdown-divider-bg: #e5e5e5 !default; -$dropdownLinkBackgroundActive: $linkColor; -$dropdownLinkBackgroundHover: $dropdownLinkBackgroundActive; +$dropdown-link-color: $gray-dark !default; +$dropdown-link-hover-color: darken($gray-dark, 5%) !default; +$dropdown-link-hover-bg: #f5f5f5 !default; +$dropdown-link-active-color: $component-active-color !default; +$dropdown-link-active-bg: $component-active-bg !default; + +$dropdown-link-disabled-color: $gray-light !default; + +$dropdown-header-color: $gray-light !default; // COMPONENT VARIABLES @@ -142,162 +219,447 @@ $dropdownLinkBackgroundHover: $dropdownLinkBackgroundActive; // ------------------------- // Used for a bird's eye view of components dependent on the z-axis // Try to avoid customizing these :) -$zindexDropdown: 1000; -$zindexPopover: 1010; -$zindexTooltip: 1020; -$zindexFixedNavbar: 1030; -$zindexModalBackdrop: 1040; -$zindexModal: 1050; -$zindexAutocomplete: 1060; + +$zindex-navbar: 1000 !default; +$zindex-dropdown: 1000 !default; +$zindex-popover: 1010 !default; +$zindex-tooltip: 1030 !default; +$zindex-navbar-fixed: 1030 !default; +$zindex-modal-background: 1040 !default; +$zindex-modal: 1050 !default; + +// Media queries breakpoints +// -------------------------------------------------- + +// Extra small screen / phone +// Note: Deprecated $screen-xs and $screen-phone as of v3.0.1 +$screen-xs: 480px !default; +$screen-xs-min: $screen-xs !default; +$screen-phone: $screen-xs-min !default; + +// Small screen / tablet +// Note: Deprecated $screen-sm and $screen-tablet as of v3.0.1 +$screen-sm: 768px !default; +$screen-sm-min: $screen-sm !default; +$screen-tablet: $screen-sm-min !default; + +// Medium screen / desktop +// Note: Deprecated $screen-md and $screen-desktop as of v3.0.1 +$screen-md: 992px !default; +$screen-md-min: $screen-md !default; +$screen-desktop: $screen-md-min !default; + +// Large screen / wide desktop +// Note: Deprecated $screen-lg and $screen-lg-desktop as of v3.0.1 +$screen-lg: 1200px !default; +$screen-lg-min: $screen-lg !default; +$screen-lg-desktop: $screen-lg-min !default; + +// So media queries don't overlap when required, provide a maximum +$screen-xs-max: ($screen-sm-min - 1) !default; +$screen-sm-max: ($screen-md-min - 1) !default; +$screen-md-max: ($screen-lg-min - 1) !default; -// Sprite icons path -// ------------------------- -$iconSpritePath: "/images/pages/base/glyphicons-halflings.png"; -$iconWhiteSpritePath: "/images/pages/base/glyphicons-halflings-white.png"; +// Grid system +// -------------------------------------------------- +// Number of columns in the grid system +$grid-columns: 12 !default; +// Padding, to be divided by two and applied to the left and right of all columns +$grid-gutter-width: 30px !default; -// Input placeholder text color -// ------------------------- -$placeholderText: $grayLight; +// Navbar collapse - -// Hr border color -// ------------------------- -$hrBorder: $grayLighter; - - -// Horizontal forms & lists -// ------------------------- -$horizontalComponentOffset: 180px; - - -// Wells -// ------------------------- -$wellBackground: #f5f5f5; +// Point at which the navbar becomes uncollapsed +$grid-float-breakpoint: $screen-sm-min !default; +// Point at which the navbar begins collapsing +$grid-float-breakpoint-max: ($grid-float-breakpoint - 1) !default; // Navbar // ------------------------- -$navbarCollapseWidth: 979px; -$navbarCollapseDesktopWidth: $navbarCollapseWidth + 1; -$navbarHeight: 50px; -$navbarBackground: #2f261d; -$navbarBackgroundHighlight: lighten($navbarBackground, 8%); -$navbarBorder: darken($navbarBackground, 8%); +// Basics of a navbar +$navbar-height: 50px !default; +$navbar-margin-bottom: $line-height-computed !default; +$navbar-border-radius: $border-radius-base !default; +$navbar-padding-horizontal: floor($grid-gutter-width / 2) !default; +$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default; -$navbarText: $grayLighter; -$navbarLinkColor: $white; -$navbarLinkColorHover: #f8e413; -$navbarLinkColorActive: $navbarLinkColorHover; -$navbarLinkBackgroundHover: $navbarBackground; -$navbarLinkBackgroundActive: $navbarBackground; +$navbar-default-color: #777 !default; +$navbar-default-bg: #2f261d; +$navbar-highlight-bg: lighten($navbar-default-bg, 8%); +$navbar-default-border: darken($navbar-default-bg, 8%) !default; + +// Navbar links +$navbar-default-link-color: $white; +$navbar-default-link-hover-color: #f8e413; +$navbar-default-link-hover-bg: transparent !default; +$navbar-default-link-active-color: #555 !default; +$navbar-default-link-active-bg: transparent; +$navbar-default-link-disabled-color: #ccc !default; +$navbar-default-link-disabled-bg: transparent !default; + +// Navbar brand label +$navbar-default-brand-color: $navbar-default-link-color !default; +$navbar-default-brand-hover-color: darken($navbar-default-brand-color, 10%) !default; +$navbar-default-brand-hover-bg: transparent !default; + +// Navbar toggle +$navbar-default-toggle-hover-bg: #ddd !default; +$navbar-default-toggle-icon-bar-bg: #ccc !default; +$navbar-default-toggle-border-color: #ddd !default; -$navbarBrandColor: $navbarLinkColor; // Inverted navbar -$navbarInverseBackground: $blueDark; -$navbarInverseBackgroundHighlight: lighten($navbarInverseBackground, 5%); -$navbarInverseBorder: darken($navbarInverseBackground, 3%); +// +// Reset inverted navbar basics +$navbar-inverse-color: $gray-light !default; +$navbar-inverse-bg: $blueDark; +$navbar-inverse-border: darken($navbar-inverse-bg, 10%) !default; -$navbarInverseText: $white; -$navbarInverseLinkColor: $white; -$navbarInverseLinkColorHover: $white; -$navbarInverseLinkColorActive: $white; -$navbarInverseLinkBackgroundHover: darken($navbarInverseBackground, 6%); -$navbarInverseLinkBackgroundActive: darken($navbarInverseBackground, 6%); +// Inverted navbar links +$navbar-inverse-link-color: $white; +$navbar-inverse-link-hover-color: $white; +$navbar-inverse-link-hover-bg: transparent; +$navbar-inverse-link-active-color: $navbar-inverse-link-hover-color !default; +$navbar-inverse-link-active-bg: darken($navbar-inverse-bg, 10%) !default; +$navbar-inverse-link-disabled-color: #444 !default; +$navbar-inverse-link-disabled-bg: transparent !default; -$navbarInverseSearchBackground: $white; -$navbarInverseSearchBackgroundFocus: $white; -$navbarInverseSearchBorder: $navbarInverseBackground; -$navbarInverseSearchPlaceholderColor: $grayLight; +// Inverted navbar brand label +$navbar-inverse-brand-color: $navbar-inverse-link-color !default; +$navbar-inverse-brand-hover-color: #fff !default; +$navbar-inverse-brand-hover-bg: transparent !default; -$navbarInverseBrandColor: $navbarInverseLinkColor; +// Inverted navbar toggle +$navbar-inverse-toggle-hover-bg: #333 !default; +$navbar-inverse-toggle-icon-bar-bg: #fff !default; +$navbar-inverse-toggle-border-color: #333 !default; + + +// Navs +// ------------------------- + +$nav-link-padding: 10px 15px !default; +$nav-link-hover-bg: $navbar-default-bg; +$nav-link-hover-color: #f8e413; + +$nav-disabled-link-color: $gray-light !default; +$nav-disabled-link-hover-color: $gray-light !default; + +$nav-open-link-hover-color: #fff !default; + +// Tabs +$nav-tabs-border-color: #ddd !default; + +$nav-tabs-link-hover-border-color: $gray-lighter !default; + +$nav-tabs-active-link-hover-bg: $body-bg !default; +$nav-tabs-active-link-hover-color: $gray !default; +$nav-tabs-active-link-hover-border-color: #ddd !default; + +$nav-tabs-justified-link-border-color: #ddd !default; +$nav-tabs-justified-active-link-border-color: $body-bg !default; + +// Pills +$nav-pills-border-radius: $border-radius-base !default; +$nav-pills-active-link-hover-bg: $component-active-bg !default; +$nav-pills-active-link-hover-color: $component-active-color !default; // Pagination // ------------------------- -$paginationBackground: #fff; -$paginationBorder: #ddd; -$paginationActiveBackground: #f5f5f5; + +$pagination-bg: #fff !default; +$pagination-border: #ddd !default; + +$pagination-hover-bg: $gray-lighter !default; + +$pagination-active-bg: $brand-primary !default; +$pagination-active-color: #fff !default; + +$pagination-disabled-color: $gray-light !default; -// Hero unit +// Pager // ------------------------- -$heroUnitBackground: $grayLighter; -$heroUnitHeadingColor: inherit; -$heroUnitLeadColor: inherit; + +$pager-border-radius: 15px !default; +$pager-disabled-color: $gray-light !default; + + +// Jumbotron +// ------------------------- + +$jumbotron-padding: 30px !default; +$jumbotron-color: inherit !default; +$jumbotron-bg: $gray-lighter !default; +$jumbotron-heading-color: inherit !default; +$jumbotron-font-size: ceil($font-size-base * 1.5) !default; // Form states and alerts // ------------------------- -$warningText: $orange; -$warningBackground: #F1CEAB; -$warningBorder: darken(adjust-hue($warningBackground, -10), 3%); -$errorText: darken(#C45559, 5%); -$errorBackground: #F2BDB1; -$errorBorder: darken(adjust-hue($errorBackground, -10), 3%); +$state-success-text: #3c763d !default; +$state-success-bg: #dff0d8 !default; +$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default; -$successText: darken($green, 5%); -$successBackground: #D5ECBF; -$successBorder: darken(adjust-hue($successBackground, -10), 5%); +$state-info-text: #31708f !default; +$state-info-bg: #d9edf7 !default; +$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default; -$infoText: darken($blue, 10%); -$infoBackground: #A7DFF1; -$infoBorder: darken(adjust-hue($infoBackground, -10), 7%); +$state-warning-text: #8a6d3b !default; +$state-warning-bg: #fcf8e3 !default; +$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default; + +$state-danger-text: #a94442 !default; +$state-danger-bg: #f2dede !default; +$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default; -// Tooltips and popovers +// Tooltips // ------------------------- -$tooltipColor: #fff; -$tooltipBackground: #000; -$tooltipArrowWidth: 5px; -$tooltipArrowColor: $tooltipBackground; +$tooltip-max-width: 200px !default; +$tooltip-color: #fff !default; +$tooltip-bg: #000 !default; -$popoverBackground: #fff; -$popoverArrowWidth: 10px; -$popoverArrowColor: #fff; -$popoverTitleBackground: darken($popoverBackground, 3%); - -// Special enhancement for popovers -$popoverArrowOuterWidth: $popoverArrowWidth + 1; -$popoverArrowOuterColor: rgba(0,0,0,.25); +$tooltip-arrow-width: 5px !default; +$tooltip-arrow-color: $tooltip-bg !default; +// Popovers +// ------------------------- +$popover-bg: #fff !default; +$popover-max-width: 276px !default; +$popover-border-color: rgba(0,0,0,.2) !default; +$popover-fallback-border-color: #ccc !default; -// GRID +$popover-title-bg: darken($popover-bg, 3%) !default; + +$popover-arrow-width: 10px !default; +$popover-arrow-color: #fff !default; + +$popover-arrow-outer-width: ($popover-arrow-width + 1) !default; +$popover-arrow-outer-color: rgba(0,0,0,.25) !default; +$popover-arrow-outer-fallback-color: #999 !default; + + +// Labels +// ------------------------- + +$label-default-bg: $gray-light !default; +$label-primary-bg: $brand-primary !default; +$label-success-bg: $brand-success !default; +$label-info-bg: $brand-info !default; +$label-warning-bg: $brand-warning !default; +$label-danger-bg: $brand-danger !default; + +$label-color: #fff !default; +$label-link-hover-color: #fff !default; + + +// Modals +// ------------------------- +$modal-inner-padding: 20px !default; + +$modal-title-padding: 15px !default; +$modal-title-line-height: $line-height-base !default; + +$modal-content-bg: none !default; +$modal-content-border-color: transparent !default; +$modal-content-fallback-border-color: transparent !default; + +$modal-backdrop-bg: transparent !default; +$modal-header-border-color: transparent !default; +$modal-footer-border-color: $modal-header-border-color !default; + + +// Alerts +// ------------------------- +$alert-padding: 15px !default; +$alert-border-radius: $border-radius-base !default; +$alert-link-font-weight: bold !default; + +$alert-success-bg: $state-success-bg !default; +$alert-success-text: $state-success-text !default; +$alert-success-border: $state-success-border !default; + +$alert-info-bg: $state-info-bg !default; +$alert-info-text: $state-info-text !default; +$alert-info-border: $state-info-border !default; + +$alert-warning-bg: $state-warning-bg !default; +$alert-warning-text: $state-warning-text !default; +$alert-warning-border: $state-warning-border !default; + +$alert-danger-bg: $state-danger-bg !default; +$alert-danger-text: $state-danger-text !default; +$alert-danger-border: $state-danger-border !default; + + +// Progress bars +// ------------------------- +$progress-bg: #f5f5f5 !default; +$progress-bar-color: #fff !default; + +$progress-bar-bg: $brand-primary !default; +$progress-bar-success-bg: $brand-success !default; +$progress-bar-warning-bg: $brand-warning !default; +$progress-bar-danger-bg: $brand-danger !default; +$progress-bar-info-bg: $brand-info !default; + + +// List group +// ------------------------- +$list-group-bg: #fff !default; +$list-group-border: #ddd !default; +$list-group-border-radius: $border-radius-base !default; + +$list-group-hover-bg: #f5f5f5 !default; +$list-group-active-color: $component-active-color !default; +$list-group-active-bg: $component-active-bg !default; +$list-group-active-border: $list-group-active-bg !default; + +$list-group-link-color: #555 !default; +$list-group-link-heading-color: #333 !default; + + +// Panels +// ------------------------- +$panel-bg: #fff !default; +$panel-inner-border: #ddd !default; +$panel-border-radius: $border-radius-base !default; +$panel-footer-bg: #f5f5f5 !default; + +$panel-default-text: $gray-dark !default; +$panel-default-border: #ddd !default; +$panel-default-heading-bg: #f5f5f5 !default; + +$panel-primary-text: #fff !default; +$panel-primary-border: $brand-primary !default; +$panel-primary-heading-bg: $brand-primary !default; + +$panel-success-text: $state-success-text !default; +$panel-success-border: $state-success-border !default; +$panel-success-heading-bg: $state-success-bg !default; + +$panel-warning-text: $state-warning-text !default; +$panel-warning-border: $state-warning-border !default; +$panel-warning-heading-bg: $state-warning-bg !default; + +$panel-danger-text: $state-danger-text !default; +$panel-danger-border: $state-danger-border !default; +$panel-danger-heading-bg: $state-danger-bg !default; + +$panel-info-text: $state-info-text !default; +$panel-info-border: $state-info-border !default; +$panel-info-heading-bg: $state-info-bg !default; + + +// Thumbnails +// ------------------------- +$thumbnail-padding: 4px !default; +$thumbnail-bg: $body-bg !default; +$thumbnail-border: #ddd !default; +$thumbnail-border-radius: $border-radius-base !default; + +$thumbnail-caption-color: $text-color !default; +$thumbnail-caption-padding: 9px !default; + + +// Wells +// ------------------------- +$well-bg: #f5f5f5 !default; + + +// Badges +// ------------------------- +$badge-color: #fff !default; +$badge-link-hover-color: #fff !default; +$badge-bg: $gray-light !default; + +$badge-active-color: $link-color !default; +$badge-active-bg: #fff !default; + +$badge-font-weight: bold !default; +$badge-line-height: 1 !default; +$badge-border-radius: 10px !default; + + +// Breadcrumbs +// ------------------------- +$breadcrumb-bg: #f5f5f5 !default; +$breadcrumb-color: #ccc !default; +$breadcrumb-active-color: $gray-light !default; +$breadcrumb-separator: "/" !default; + + +// Carousel +// ------------------------ + +$carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6) !default; + +$carousel-control-color: #fff !default; +$carousel-control-width: 15% !default; +$carousel-control-opacity: .5 !default; +$carousel-control-font-size: 20px !default; + +$carousel-indicator-active-bg: #fff !default; +$carousel-indicator-border-color: #fff !default; + +$carousel-caption-color: #fff !default; + + +// Close +// ------------------------ +$close-font-weight: bold !default; +$close-color: #000 !default; +$close-text-shadow: 0 1px 0 #fff !default; + + +// Code +// ------------------------ +$code-color: #c7254e !default; +$code-bg: #f9f2f4 !default; + +$pre-bg: #f5f5f5 !default; +$pre-color: $gray-dark !default; +$pre-border-color: #ccc !default; +$pre-scrollable-max-height: 340px !default; + +// Type +// ------------------------ +$text-muted: $gray-light !default; +$abbr-border-color: $gray-light !default; +$headings-small-color: $gray-light !default; +$blockquote-small-color: $gray-light !default; +$blockquote-border-color: $gray-lighter !default; +$page-header-border-color: $gray-lighter !default; + +// Miscellaneous +// ------------------------- + +// Hr border color +$hr-border: $gray-lighter !default; + +// Horizontal forms & lists +$component-offset-horizontal: 180px !default; + + +// Container sizes // -------------------------------------------------- +// Small screen / tablet +$container-tablet: ((720px + $grid-gutter-width)) !default; +$container-sm: $container-tablet !default; -// Default 940px grid -// ------------------------- -$gridColumns: 12; -$gridColumnWidth: 60px; -$gridGutterWidth: 20px; -$gridRowWidth: ($gridColumns * $gridColumnWidth) + ($gridGutterWidth * ($gridColumns - 1)); +// Medium screen / desktop +$container-desktop: ((940px + $grid-gutter-width)) !default; +$container-md: $container-desktop !default; -// 1200px min -$gridColumnWidth1200: 70px; -$gridGutterWidth1200: 30px; -$gridRowWidth1200: ($gridColumns * $gridColumnWidth1200) + ($gridGutterWidth1200 * ($gridColumns - 1)); - -// 768px-979px -$gridColumnWidth768: 42px; -$gridGutterWidth768: 20px; -$gridRowWidth768: ($gridColumns * $gridColumnWidth768) + ($gridGutterWidth768 * ($gridColumns - 1)); - - -// Fluid grid -// ------------------------- -$fluidGridColumnWidth: percentage($gridColumnWidth/$gridRowWidth); -$fluidGridGutterWidth: percentage($gridGutterWidth/$gridRowWidth); - -// 1200px min -$fluidGridColumnWidth1200: percentage($gridColumnWidth1200/$gridRowWidth1200); -$fluidGridGutterWidth1200: percentage($gridGutterWidth1200/$gridRowWidth1200); - -// 768px-979px -$fluidGridColumnWidth768: percentage($gridColumnWidth768/$gridRowWidth768); -$fluidGridGutterWidth768: percentage($gridGutterWidth768/$gridRowWidth768); +// Large screen / wide desktop +$container-large-desktop: ((1140px + $grid-gutter-width)) !default; +$container-lg: $container-large-desktop !default; diff --git a/app/styles/bootstrap/_wells.scss b/app/styles/bootstrap/_wells.scss index 551e5207a..882c083ef 100644 --- a/app/styles/bootstrap/_wells.scss +++ b/app/styles/bootstrap/_wells.scss @@ -8,9 +8,9 @@ min-height: 20px; padding: 19px; margin-bottom: 20px; - background-color: $wellBackground; - border: 1px solid darken($wellBackground, 7%); - @include border-radius($baseBorderRadius); + background-color: $well-bg; + border: 1px solid darken($well-bg, 7%); + border-radius: $border-radius-base; @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); blockquote { border-color: #ddd; @@ -19,11 +19,11 @@ } // Sizes -.well-large { +.well-lg { padding: 24px; - @include border-radius($borderRadiusLarge); + border-radius: $border-radius-large; } -.well-small { +.well-sm { padding: 9px; - @include border-radius($borderRadiusSmall); + border-radius: $border-radius-small; } diff --git a/app/styles/bootstrap/bootstrap.scss b/app/styles/bootstrap/bootstrap.scss new file mode 100644 index 000000000..a43fc72ab --- /dev/null +++ b/app/styles/bootstrap/bootstrap.scss @@ -0,0 +1,55 @@ +// Core variables and mixins +@import "variables"; +@import "mixins"; + +// Reset +@import "normalize"; +@import "print"; + +// Core CSS +@import "scaffolding"; +@import "type"; +@import "code"; +@import "grid"; +@import "tables"; +@import "forms"; +@import "buttons"; + +// Components +@import "component-animations"; +@import "glyphicons"; +@import "dropdowns"; +@import "button-groups"; +@import "input-groups"; +@import "navs"; +@import "navbar"; +@import "breadcrumbs"; +@import "pagination"; +@import "pager"; +@import "labels"; +@import "badges"; +@import "jumbotron"; +@import "thumbnails"; +@import "alerts"; +@import "progress-bars"; +@import "media"; +@import "list-group"; +@import "panels"; +@import "wells"; +@import "close"; + +// Components w/ JavaScript +@import "modals"; +@import "tooltip"; +@import "popovers"; +@import "carousel"; + +//Addition: sprite, this was part of TB2, but removed in TB3 +@import "sprites"; + +//Addition: Bootswatch structural changes +@import "bootswatch"; + +// Utility classes +@import "utilities"; +@import "responsive-utilities"; diff --git a/app/styles/home.sass b/app/styles/home.sass index 387f8cdcc..1ae0e67cd 100644 --- a/app/styles/home.sass +++ b/app/styles/home.sass @@ -19,11 +19,10 @@ letter-spacing: 1px position: relative - a - padding-top: 25px - height: 30px + a font-size: 40px width: 300px + height: 80px @include transition(color .10s linear) &:hover a, &:active a diff --git a/app/templates/about.jade b/app/templates/about.jade index ef6129b7c..adb390403 100644 --- a/app/templates/about.jade +++ b/app/templates/about.jade @@ -4,7 +4,7 @@ block content .row - .span5 + .col-sm-6 h2(data-i18n="about.who_is_codecombat") | Who is CodeCombat? @@ -76,7 +76,7 @@ block content | Start wizarding now! - ul.span5.team-column + ul.col-sm-6.team-column ul.thumbnails @@ -84,7 +84,7 @@ block content img(src="/images/pages/about/george.jpg").img-polaroid - .span3 + .col-sm-8 h3 a(href="http://georgesaines.com") George Saines @@ -93,11 +93,11 @@ block content | CEO, business guy, web designer, game designer, | and champion of beginning programmers everywhere. - li + li.row img(src="/images/pages/about/scott.jpg").img-polaroid - .span3 + .col-sm-8 h3 a(href="http://scotterickson.info") Scott Erickson @@ -107,11 +107,11 @@ block content | kitchen wizard, and master of finances. | Scott is the reasonable one. - li + li.row img(src="/images/pages/about/nick.jpg").img-polaroid - .span3 + .col-sm-8 h3 a(href="http://www.nickwinter.net") Nick Winter @@ -121,11 +121,11 @@ block content | and upside-down experimenter. | Nick can do anything and chooses to build CodeCombat. - li + li.row img(src="/images/pages/about/jeremy.jpg").img-polaroid - .span3 + .col-sm-8 h3 Jeremy Arns @@ -135,11 +135,11 @@ block content | and community organizer; you've probably | already spoken with Jeremy. - li + li.row img(src="/images/pages/about/michael.jpg").img-polaroid - .span3 + .col-sm-8 h3 a(href="http://michaelschmatz.com/") Michael Schmatz diff --git a/app/templates/base.jade b/app/templates/base.jade index 579895a2c..b27a93b34 100644 --- a/app/templates/base.jade +++ b/app/templates/base.jade @@ -1,37 +1,37 @@ body #fb-root block header - .navbar.navbar-fixed-top - .navbar-inner - .content.clearfix - a.brand(href='/') + .nav.navbar.navbar-fixed-top + .content.clearfix + .navbar-header + a.navbar-brand(href='/') img(src="/images/pages/base/logo.png", title="CodeCombat", alt="CodeCombat") - select.language-dropdown + select.language-dropdown - if me.get('anonymous') === false - button.btn.btn-primary.navbuttontext#logout-button(data-i18n="login.log_out") Log Out - a.btn.btn-primary.navbuttontext(href="/account/profile/#{me.id}") - div.navbuttontext-user-name - | #{me.displayName()} - i.icon-cog.icon-white.big + if me.get('anonymous') === false + button.btn.btn-primary.navbuttontext#logout-button(data-i18n="login.log_out") Log Out + a.btn.btn-primary.navbuttontext(href="/account/profile/#{me.id}") + div.navbuttontext-user-name + | #{me.displayName()} + i.icon-cog.icon-white.big - else - button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/signup", data-i18n="login.sign_up") Create Account - button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/login", data-i18n="login.log_in") Log In + else + button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/signup", data-i18n="login.sign_up") Create Account + button.btn.btn-primary.navbuttontext(data-toggle="coco-modal", data-target="modal/login", data-i18n="login.log_in") Log In - ul(class='navbar-link-text').nav.pull-right - li.play - a(href='/play', data-i18n="nav.play") Levels - li.editor - a(href='/editor', data-i18n="nav.editor") Editor - li.blog - a(href='http://blog.codecombat.com/', data-i18n="nav.blog") Blog - li.forum - a(href='http://discourse.codecombat.com/', data-i18n="nav.forum") Forum - if me.isAdmin() - li.admin - a(href='/admin', data-i18n="nav.admin") Admin + ul(class='navbar-link-text').nav.navbar-nav.pull-right + li.play + a(href='/play', data-i18n="nav.navbar-nav.play") Levels + li.editor + a(href='/editor', data-i18n="nav.navbar-nav.editor") Editor + li.blog + a(href='http://blog.codecombat.com/', data-i18n="nav.navbar-nav.blog") Blog + li.forum + a(href='http://discourse.codecombat.com/', data-i18n="nav.navbar-nav.forum") Forum + if me.isAdmin() + li.admin + a(href='/admin', data-i18n="nav.navbar-nav.admin") Admin block outer_content #outer-content-wrapper diff --git a/app/templates/contribute/adventurer.jade b/app/templates/contribute/adventurer.jade index 3534884af..9ce9d9736 100644 --- a/app/templates/contribute/adventurer.jade +++ b/app/templates/contribute/adventurer.jade @@ -9,7 +9,7 @@ block content div.class-main#adventurer-main .class_image - img(src="/images/pages/contribute/adventurer.png", alt="") + img.img-responsive(src="/images/pages/contribute/adventurer.png", alt="") h2 span(data-i18n="classes.adventurer_title") Adventurer diff --git a/app/templates/contribute/ambassador.jade b/app/templates/contribute/ambassador.jade index 42438883f..bacdd339a 100644 --- a/app/templates/contribute/ambassador.jade +++ b/app/templates/contribute/ambassador.jade @@ -1,4 +1,4 @@ -extends /templates/base +.img-responsiveextends /templates/base block content @@ -9,7 +9,7 @@ block content div.class-main#ambassador-main .class_image - img(src="/images/pages/contribute/ambassador.png", alt="") + img.img-responsive(src="/images/pages/contribute/ambassador.png", alt="") h2 span(data-i18n="classes.ambassador_title") Ambassador diff --git a/app/templates/contribute/archmage.jade b/app/templates/contribute/archmage.jade index 36a7c9975..500925344 100644 --- a/app/templates/contribute/archmage.jade +++ b/app/templates/contribute/archmage.jade @@ -9,7 +9,7 @@ block content div.class-main#archmage-main .class_image - img(src="/images/pages/contribute/archmage.png", alt="") + img.img-responsive(src="/images/pages/contribute/archmage.png", alt="") h2 span(data-i18n="classes.archmage_title") Archmage diff --git a/app/templates/contribute/artisan.jade b/app/templates/contribute/artisan.jade index 43110b85f..63cc6fe5d 100644 --- a/app/templates/contribute/artisan.jade +++ b/app/templates/contribute/artisan.jade @@ -9,7 +9,7 @@ block content div.class-main#artisan-main .class_image - img(src="/images/pages/contribute/artisan.png", alt="") + img.img-responsive(src="/images/pages/contribute/artisan.png", alt="") h2 span(data-i18n="classes.artisan_title") Artisan diff --git a/app/templates/contribute/contribute.jade b/app/templates/contribute/contribute.jade index 6262ebcfa..bcfb6b304 100644 --- a/app/templates/contribute/contribute.jade +++ b/app/templates/contribute/contribute.jade @@ -12,7 +12,7 @@ block content h2(data-i18n="contribute.page_title") Contributing #homepage_screenshot - img(src="/images/pages/contribute/contribute_header.png", alt="") + img.img-responsive(src="/images/pages/contribute/contribute_header.png", alt="") p strong(data-i18n="contribute.introduction_desc_intro") @@ -52,7 +52,7 @@ block content #archmage .class_image.header-scrolling-fix - img(src="/images/pages/contribute/archmage.png", alt="") + img.img-responsive(src="/images/pages/contribute/archmage.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.archmage_title") Archmage @@ -115,7 +115,7 @@ block content #artisan .class_image.header-scrolling-fix - img(src="/images/pages/contribute/artisan.png", alt="") + img.img-responsive(src="/images/pages/contribute/artisan.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.artisan_title") Artisan @@ -177,7 +177,7 @@ block content #adventurer .class_image.header-scrolling-fix - img(src="/images/pages/contribute/adventurer.png", alt="") + img.img-responsive(src="/images/pages/contribute/adventurer.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.adventurer_title") Adventurer @@ -238,7 +238,7 @@ block content #scribe .class_image.header-scrolling-fix - img(src="/images/pages/contribute/scribe.png", alt="") + img.img-responsive(src="/images/pages/contribute/scribe.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.scribe_title") Scribe @@ -287,7 +287,7 @@ block content #diplomat .class_image.header-scrolling-fix - img(src="/images/pages/contribute/diplomat.png", alt="") + img.img-responsive(src="/images/pages/contribute/diplomat.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.diplomat_title") Diplomat @@ -339,7 +339,7 @@ block content #ambassador .class_image.header-scrolling-fix - img(src="/images/pages/contribute/ambassador.png", alt="") + img.img-responsive(src="/images/pages/contribute/ambassador.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.ambassador_title") Ambassador @@ -392,7 +392,7 @@ block content #counselor .class_image.header-scrolling-fix - img(src="/images/pages/contribute/counselor.png", alt="") + img.img-responsive(src="/images/pages/contribute/counselor.png", alt="") h3.header-scrolling-fix span(data-i18n="classes.counselor_title") Counselor diff --git a/app/templates/contribute/counselor.jade b/app/templates/contribute/counselor.jade index 433985566..821a86694 100644 --- a/app/templates/contribute/counselor.jade +++ b/app/templates/contribute/counselor.jade @@ -9,7 +9,7 @@ block content div.class-main#sounselor-main .class_image - img(src="/images/pages/contribute/counselor.png", alt="") + img.img-responsive(src="/images/pages/contribute/counselor.png", alt="") h2 span(data-i18n="classes.counselor_title") Counselor diff --git a/app/templates/contribute/diplomat.jade b/app/templates/contribute/diplomat.jade index f8bc516aa..02cff6b35 100644 --- a/app/templates/contribute/diplomat.jade +++ b/app/templates/contribute/diplomat.jade @@ -9,7 +9,7 @@ block content div.class-main#diplomat-main .class_image - img(src="/images/pages/contribute/diplomat.png", alt="") + img.img-responsive(src="/images/pages/contribute/diplomat.png", alt="") h2 span(data-i18n="classes.diplomat_title") Diplomat diff --git a/app/templates/contribute/scribe.jade b/app/templates/contribute/scribe.jade index dd5e8733b..13dca15f0 100644 --- a/app/templates/contribute/scribe.jade +++ b/app/templates/contribute/scribe.jade @@ -9,7 +9,7 @@ block content div.class-main#scribe-main .class_image - img(src="/images/pages/contribute/scribe.png", alt="") + img.img-responsive(src="/images/pages/contribute/scribe.png", alt="") h2 span(data-i18n="classes.scribe_title") Scribe diff --git a/app/templates/employers.jade b/app/templates/employers.jade index 7f99c81ed..485d21622 100644 --- a/app/templates/employers.jade +++ b/app/templates/employers.jade @@ -4,7 +4,7 @@ block content .row - .span5 + .col-md-6 h2 CodeCombat for Employers diff --git a/app/templates/home.jade b/app/templates/home.jade index ad8f82f9e..c9cfc16d6 100644 --- a/app/templates/home.jade +++ b/app/templates/home.jade @@ -23,6 +23,6 @@ block content div#homepage_button_container div.homepage_button - a#beginner-campaign.btn.btn-warning.btn-large.highlight(href="/play/level/rescue-mission") + a#beginner-campaign.btn.btn-warning.btn-lg.highlight(href="/play/level/rescue-mission") canvas(width="125", height="150") span(data-i18n="home.play") Play \ No newline at end of file diff --git a/app/templates/modal/contact.jade b/app/templates/modal/contact.jade index b93ef65ec..434a2a4a8 100644 --- a/app/templates/modal/contact.jade +++ b/app/templates/modal/contact.jade @@ -14,14 +14,12 @@ block modal-body-content a(href="http://discourse.codecombat.com/", data-i18n="contact.forum_page") our forum span(data-i18n="contact.forum_suffix") instead. .form-inline + .form-group + label.control-label(for="contact-email", data-i18n="general.email") Email + input#contact-email.form-control(name="email", type="email", value="#{me.get('anonymous') ? '' : me.get('email')}", placeholder="Where should we reply?") .control-group - label.control-label(for="contact-email", data-i18n="general.email") Email - .controls - input#contact-email.input-block-level(name="email", type="email", value="#{me.get('anonymous') ? '' : me.get('email')}", placeholder="Where should we reply?") - .control-group - label.control-label(for="contact-message", data-i18n="general.message") Message - .controls - textarea#contact-message.input-block-level(name="message", rows=8) + label.control-label(for="contact-message", data-i18n="general.message") Message + textarea#contact-message.form-control(name="message", rows=8) block modal-footer-content span.sending-indicator.pull-left.hide(data-i18n="common.sending") Sending... diff --git a/app/templates/modal/login.jade b/app/templates/modal/login.jade index d52efe4d3..9e0a5e9c9 100644 --- a/app/templates/modal/login.jade +++ b/app/templates/modal/login.jade @@ -5,14 +5,12 @@ block modal-header-content block modal-body-content .form-inline + .form-group + label.control-label(for="login-email", data-i18n="general.email") Email + input#login-email.input-large.form-control(name="email", type="email") .control-group - label.control-label(for="login-email", data-i18n="general.email") Email - .controls - input#login-email.input-large(name="email", type="email") - .control-group - label.control-label(for="login-password", data-i18n="forms.password") Password - .controls - input#login-password.input-large(name="password", type="password") + label.control-label(for="login-password", data-i18n="forms.password") Password + input#login-password.input-large.form-control(name="password", type="password") block modal-body-wait-content h3(data-i18n="login.logging_in") Logging In diff --git a/app/templates/modal/modal_base.jade b/app/templates/modal/modal_base.jade index 7e991bd2b..e82587a2a 100644 --- a/app/templates/modal/modal_base.jade +++ b/app/templates/modal/modal_base.jade @@ -1,27 +1,26 @@ -block modal-header - .modal-header - if closeButton - .button.close(type="button", data-dismiss="modal", aria-hidden="true") × - block modal-header-content - h3 man bites God - -block modal-body - .modal-body - block modal-body-content - p Man Bites God are the bad boys of the Melbourne live music and comedy scene. It is like being drowned in a bathtub of harmony. - img(src="http://www.manbitesgod.com/images/picturecoupleb.jpg") - img(src="http://www.manbitesgod.com/images/manrantb.jpg") - - .modal-body.wait.hide - block modal-body-wait-content - h3 Reticulating Splines... - .progress.progress-striped.active - .bar - -block modal-footer - .modal-footer - block modal-footer-content - button.btn.btn-primary(type="button", data-dismiss="modal", aria-hidden="true", data-i18n="modal.okay") Okay - +.modal-dialog + .modal-content + block modal-header + .modal-header + if closeButton + .button.close(type="button", data-dismiss="modal", aria-hidden="true") × + block modal-header-content + h3 man bites God + + block modal-body + .modal-body + block modal-body-content + p Man Bites God are the bad boys of the Melbourne live music and comedy scene. It is like being drowned in a bathtub of harmony. + img(src="http://www.manbitesgod.com/images/picturecoupleb.jpg") + img(src="http://www.manbitesgod.com/images/manrantb.jpg") + .modal-body.wait.hide + block modal-body-wait-content + h3 Reticulating Splines... + .progress.progress-striped.active + .bar + block modal-footer + .modal-footer + block modal-footer-content + button.btn.btn-primary(type="button", data-dismiss="modal", aria-hidden="true", data-i18n="modal.okay") Okay \ No newline at end of file diff --git a/app/templates/modal/recover.jade b/app/templates/modal/recover.jade index a1dde337d..d70db5c52 100644 --- a/app/templates/modal/recover.jade +++ b/app/templates/modal/recover.jade @@ -5,10 +5,9 @@ block modal-header-content block modal-body-content .form-inline - .control-group - label.control-label(for="recover-email", data-i18n="general.email") Email - .controls - input#recover-email.input-large(name="email", type="email") + .form-group + label.control-label(for="recover-email", data-i18n="general.email") Email + input#recover-email.input-large.form-control(name="email", type="email") block modal-body-wait-content h3(data-i18n="common.sending") Sending... diff --git a/app/templates/modal/save_version.jade b/app/templates/modal/save_version.jade index e51ed8ae3..2fbdbcf80 100644 --- a/app/templates/modal/save_version.jade +++ b/app/templates/modal/save_version.jade @@ -5,15 +5,13 @@ block modal-header-content block modal-body-content form.form-horizontal + .form-group + label.control-label(for="commitMessage", data-i18n="general.commit_msg") Commit Message + textarea#commit-message.input-large.form-control(name="commitMessage", type="text") .control-group - label.control-label(for="commitMessage", data-i18n="general.commit_msg") Commit Message - .controls - textarea#commit-message.input-large(name="commitMessage", type="text") - .control-group - label.control-label(for="level-version-is-major", data-i18n="versions.new_major_version") New Major Version - .controls - input#major-version.input-large(name="version-is-major", type="checkbox") - span.help-block + label.control-label(for="level-version-is-major", data-i18n="versions.new_major_version") New Major Version + input#major-version.input-large.form-control(name="version-is-major", type="checkbox") + span.help-block block modal-body-wait-content h3(data-i18n="common.saving") Saving... diff --git a/app/templates/modal/signup.jade b/app/templates/modal/signup.jade index 649158b84..032abf050 100644 --- a/app/templates/modal/signup.jade +++ b/app/templates/modal/signup.jade @@ -1,45 +1,46 @@ extends /templates/modal/modal_base -block modal-header-content - h3(data-i18n="signup.create_account_title") Create Account to Save Progress +.modal-dialog + .modal-content + block modal-header-content + h3(data-i18n="signup.create_account_title") Create Account to Save Progress -block modal-body-content - .modal-body - p(data-i18n="signup.description") It's free. Just need a couple things and you'll be good to go: - .form-inline - .control-group - label.control-label(for="signup-email", data-i18n="general.email") Email - .controls - input#signup-email.input-large(name="email", type="email") - .control-group - label.control-label(for="signup-password", data-i18n="forms.password") Password - .controls - input#signup-password.input-large(name="password", type="password") - hr - .control-group - label.checkbox.control-label(for="signup-subscribe") - input#signup-subscribe(name="subscribe", type="checkbox", checked='checked') - span(data-i18n="signup.email_announcements") Receive announcements by email - .control-group - label.checkbox.control-label(for="signup-confirm-age") - input#signup-confirm-age(name="confirm-age", type="checkbox", checked='checked') - span(data-i18n="signup.coppa") 13+ or non-USA - a(href="http://en.wikipedia.org/wiki/Children's_Online_Privacy_Protection_Act", data-i18n="signup.coppa_why", target="_blank") (Why?) + block modal-body-content + .modal-content + .modal-body + p(data-i18n="signup.description") It's free. Just need a couple things and you'll be good to go: + .form-inline + .form-group + label.control-label(for="signup-email", data-i18n="general.email") Email + input#signup-email.form-control.input-large(name="email", type="email") + .control-group + label.control-label(for="signup-password", data-i18n="forms.password") Password + input#signup-password.input-large.form-control(name="password", type="password") + hr + .control-group + label.checkbox.control-label(for="signup-subscribe") + input#signup-subscribe(name="subscribe", type="checkbox", checked='checked') + span(data-i18n="signup.email_announcements") Receive announcements by email + .control-group + label.checkbox.control-label(for="signup-confirm-age") + input#signup-confirm-age(name="confirm-age", type="checkbox", checked='checked') + span(data-i18n="signup.coppa") 13+ or non-USA + a(href="http://en.wikipedia.org/wiki/Children's_Online_Privacy_Protection_Act", data-i18n="signup.coppa_why", target="_blank") (Why?) -block modal-body-wait-content - h3(data-i18n="signup.creating") Creating Account... + block modal-body-wait-content + h3(data-i18n="signup.creating") Creating Account... -block modal-footer - .modal-footer - button.btn.btn-primary.btn-large#signup-button(data-i18n="signup.sign_up") Sign Up - - .modal-footer.network-logins - div - .fb-login-button(data-show-faces="false", data-width="200", data-max-rows="1", data-scope="email") - div - .gplus-login-button#gplus-login-button - // TODO does not work; the events (clicks, submissions) in new modal do not fire - div - span(data-i18n="general.or") or - span - a(data-toggle="coco-modal", data-target="modal/login", data-i18n="signup.log_in")#link-to-login log in with password + block modal-footer + .modal-footer + button.btn.btn-primary.btn-large#signup-button(data-i18n="signup.sign_up") Sign Up + + .modal-footer.network-logins + div + .fb-login-button(data-show-faces="false", data-width="200", data-max-rows="1", data-scope="email") + div + .gplus-login-button#gplus-login-button + // TODO does not work; the events (clicks, submissions) in new modal do not fire + div + span(data-i18n="general.or") or + span + a(data-toggle="coco-modal", data-target="modal/login", data-i18n="signup.log_in")#link-to-login log in with password diff --git a/app/templates/play.jade b/app/templates/play.jade index d76ed24cc..469192da4 100644 --- a/app/templates/play.jade +++ b/app/templates/play.jade @@ -11,7 +11,7 @@ block content .row each campaign in campaigns - .campaign-container.span5 + .campaign-container.col-sm-6 h1 a(href="/play/level/#{campaign.levels[0].id}", data-i18n="play.campaign_#{campaign.id}")= campaign.name p.campaign-description(data-i18n="[html]play.campaign_#{campaign.id}_description")!= campaign.description diff --git a/app/templates/play/level/control_bar.jade b/app/templates/play/level/control_bar.jade index 8e571448d..f0ec60731 100644 --- a/app/templates/play/level/control_bar.jade +++ b/app/templates/play/level/control_bar.jade @@ -6,8 +6,8 @@ h4.home h4.title #{worldName} -button.btn.btn-mini.btn-inverse.banner#docs-button(title="Show level instructions", data-i18n="play_level.guide") Guide +button.btn.btn-xs.btn-inverse.banner#docs-button(title="Show level instructions", data-i18n="play_level.guide") Guide -button.btn.btn-mini.btn-inverse.banner#multiplayer-button(title="Multiplayer", data-i18n="play_level.multiplayer") Multiplayer +button.btn.btn-xs.btn-inverse.banner#multiplayer-button(title="Multiplayer", data-i18n="play_level.multiplayer") Multiplayer -button.btn.btn-mini.btn-inverse.banner#restart-button(title="Reload all custom code to reset level", data-i18n="play_level.restart") Restart \ No newline at end of file +button.btn.btn-xs.btn-inverse.banner#restart-button(title="Reload all custom code to reset level", data-i18n="play_level.restart") Restart \ No newline at end of file diff --git a/app/templates/play/level/modal/multiplayer.jade b/app/templates/play/level/modal/multiplayer.jade index 1df8c4e94..2f67de3f7 100644 --- a/app/templates/play/level/modal/multiplayer.jade +++ b/app/templates/play/level/modal/multiplayer.jade @@ -7,10 +7,10 @@ // This section is for later .form-horizontal - .control-group + .form-group label.control-label(for="multiplayer") Multiplayer - .controls - input#multiplayer.input-large(name="multiplayer", type="checkbox", checked=multiplayer) + .control + input#multiplayer.input-large.form-control(name="multiplayer", type="checkbox", checked=multiplayer) span.help-inline Enable others to join your game. hr diff --git a/app/templates/play/level/playback.jade b/app/templates/play/level/playback.jade index e8f25e17c..0613ef9cd 100644 --- a/app/templates/play/level/playback.jade +++ b/app/templates/play/level/playback.jade @@ -1,13 +1,13 @@ -button.btn.btn-mini.btn-inverse#play-button.playing(title="Alt-P: Toggle level play/pause") +button.btn.btn-xs.btn-inverse#play-button.playing(title="Alt-P: Toggle level play/pause") i.icon-play.icon-white.big i.icon-pause.icon-white.big i.icon-repeat.icon-white.big -button.btn.btn-mini.btn-inverse#volume-button(title="Adjust volume") +button.btn.btn-xs.btn-inverse#volume-button(title="Adjust volume") i.icon-volume-off.icon-white.big i.icon-volume-down.icon-white.big i.icon-volume-up.icon-white.big -button.btn.btn-mini.btn-inverse#music-button(title="Toggle Music") +button.btn.btn-xs.btn-inverse#music-button(title="Toggle Music") | ♫ .scrubber @@ -16,11 +16,11 @@ button.btn.btn-mini.btn-inverse#music-button(title="Toggle Music") .scrubber-handle .btn-group.dropup#playback-settings - button.btn.btn-mini.btn-inverse#zoom-in-button + button.btn.btn-xs.btn-inverse#zoom-in-button i.icon-zoom-in.icon-white - button.btn.btn-mini.btn-inverse#zoom-out-button + button.btn.btn-xs.btn-inverse#zoom-out-button i.icon-zoom-out.icon-white - button.btn.btn-mini.btn-inverse.dropdown-toggle(data-toggle="dropdown")#settings-button + button.btn.btn-xs.btn-inverse.dropdown-toggle(data-toggle="dropdown")#settings-button i.icon-cog.icon-white.big ul.dropdown-menu if me.get('name') == "Nick" diff --git a/app/templates/play/level/thang_avatar.jade b/app/templates/play/level/thang_avatar.jade index 8d60b794f..a37e5c311 100644 --- a/app/templates/play/level/thang_avatar.jade +++ b/app/templates/play/level/thang_avatar.jade @@ -1,6 +1,6 @@ .thang-avatar-wrapper(class="team-" + (thang.team || "neutral")) //canvas(width=100, height=100, title=thang.id + " - " + thang.team) - img(src=avatarURL, title=thang.id + " - " + thang.team) + img.img-responsive(src=avatarURL, title=thang.id + " - " + thang.team) .badge.problems .badge.shared-thangs if includeName diff --git a/app/views/kinds/CocoView.coffee b/app/views/kinds/CocoView.coffee index 8ee5cacd7..8902e4080 100644 --- a/app/views/kinds/CocoView.coffee +++ b/app/views/kinds/CocoView.coffee @@ -84,21 +84,21 @@ module.exports = class CocoView extends Backbone.View # Modals - toggleModal: (e) -> + toggleModal: (e) -> if $(e.currentTarget).prop('target') is '_blank' return true - # special handler for opening modals that are dynamically loaded, rather than static in the page. It works (or should work) like Bootstrap's modals, except use coco-modal for the data-toggle value. + # special handler for opening modals that are dynamically loaded, rather than static in the page. It works (or should work) like Bootstrap's modals, except use coco-modal for the data-toggle value. elem = $(e.target) return unless elem.data('toggle') is 'coco-modal' target = elem.data('target') - view = application.router.getView(target, '_modal') # could set up a system for loading cached modals, if told to + view = application.router.getView(target, '_modal') # could set up a system for loading cached modals, if told to @openModalView(view) registerModalsWithin: (e...) -> # TODO: Get rid of this part - for modal in $('.modal', @$el) + for modal in $('.modal', @$el) # console.warn 'Registered modal to get rid of...', modal - $(modal).on('show', @clearModals) + $(modal).on('show.bs.modal', @clearModals) openModalView: (modalView) -> return if @waitingModal # can only have one waiting at once @@ -106,20 +106,20 @@ module.exports = class CocoView extends Backbone.View waitingModal = modalView visibleModal.hide() return - modalView.render() + modalView.render() $('#modal-wrapper').empty().append modalView.el modalView.afterInsert() visibleModal = modalView modalOptions = {show: true, backdrop: if modalView.closesOnClickOutside then true else 'static'} - $('#modal-wrapper .modal').modal(modalOptions).on('hidden', => @modalClosed()) + $('#modal-wrapper .modal').modal(modalOptions).on('hidden.bs.modal', => @modalClosed()) window.currentModal = modalView @getRootView().stopListeningToShortcuts(true) - modalClosed: => + modalClosed: => visibleModal.willDisappear() if visibleModal visibleModal.destroy() visibleModal = null - if waitingModal + if waitingModal wm = waitingModal waitingModal = null @openModalView(wm) @@ -127,8 +127,8 @@ module.exports = class CocoView extends Backbone.View @getRootView().listenToShortcuts(true) Backbone.Mediator.publish 'modal-closed' - clearModals: => - if visibleModal + clearModals: => + if visibleModal visibleModal.$el.addClass('hide') waitingModal = null @modalClosed() diff --git a/app/views/kinds/ModalView.coffee b/app/views/kinds/ModalView.coffee index 31a400c2c..eb86a09ed 100644 --- a/app/views/kinds/ModalView.coffee +++ b/app/views/kinds/ModalView.coffee @@ -1,7 +1,7 @@ CocoView = require './CocoView' module.exports = class ModalView extends CocoView - className: "modal hide fade" + className: "modal fade" closeButton: true closesOnClickOutside: true modalWidthPercent: null @@ -28,7 +28,7 @@ module.exports = class ModalView extends CocoView super() if @modalWidthPercent @$el.css width: "#{@modalWidthPercent}%", "margin-left": "#{-@modalWidthPercent / 2}%" - @$el.on 'hide', => + @$el.on 'hide.bs.modal', => @onHidden() unless @hidden @hidden = true @@ -42,7 +42,7 @@ module.exports = class ModalView extends CocoView $el = @$el.find('.modal-body') unless $el super($el) - hide: -> + hide: -> @$el.removeClass('fade').modal "hide" - onHidden: -> \ No newline at end of file + onHidden: -> \ No newline at end of file diff --git a/config.coffee b/config.coffee index e93f4b328..79bed6163 100644 --- a/config.coffee +++ b/config.coffee @@ -27,19 +27,17 @@ exports.config = 'bower_components/lodash/dist/lodash.js' 'bower_components/backbone/backbone.js' # Twitter Bootstrap jquery plugins - 'vendor/scripts/bootstrap/bootstrap-transition.js' - 'vendor/scripts/bootstrap/bootstrap-affix.js' - 'vendor/scripts/bootstrap/bootstrap-alert.js' - 'vendor/scripts/bootstrap/bootstrap-button.js' - 'vendor/scripts/bootstrap/bootstrap-carousel.js' - 'vendor/scripts/bootstrap/bootstrap-collapse.js' - 'vendor/scripts/bootstrap/bootstrap-dropdown.js' - 'vendor/scripts/bootstrap/bootstrap-modal.js' - 'vendor/scripts/bootstrap/bootstrap-scrollspy.js' - 'vendor/scripts/bootstrap/bootstrap-tab.js' - 'vendor/scripts/bootstrap/bootstrap-tooltip.js' - 'vendor/scripts/bootstrap/bootstrap-popover.js' - 'vendor/scripts/bootstrap/bootstrap-typeahead.js' + 'vendor/scripts/bootstrap/transition.js' + 'vendor/scripts/bootstrap/affix.js' + 'vendor/scripts/bootstrap/alert.js' + 'vendor/scripts/bootstrap/button.js' + 'vendor/scripts/bootstrap/carousel.js' + 'vendor/scripts/bootstrap/collapse.js' + 'vendor/scripts/bootstrap/dropdown.js' + 'vendor/scripts/bootstrap/modal.js' + 'vendor/scripts/bootstrap/scrollspy.js' + 'vendor/scripts/bootstrap/tab.js' + 'vendor/scripts/bootstrap/tooltip.js' # CreateJS dependencies 'vendor/scripts/easeljs-NEXT.combined.js' 'vendor/scripts/preloadjs-NEXT.combined.js' diff --git a/vendor/scripts/bootstrap/affix.js b/vendor/scripts/bootstrap/affix.js new file mode 100644 index 000000000..552bffa3f --- /dev/null +++ b/vendor/scripts/bootstrap/affix.js @@ -0,0 +1,126 @@ +/* ======================================================================== + * Bootstrap: affix.js v3.0.3 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // AFFIX CLASS DEFINITION + // ====================== + + var Affix = function (element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options) + this.$window = $(window) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) + + this.$element = $(element) + this.affixed = + this.unpin = null + + this.checkPosition() + } + + Affix.RESET = 'affix affix-top affix-bottom' + + Affix.DEFAULTS = { + offset: 0 + } + + Affix.prototype.checkPositionWithEventLoop = function () { + setTimeout($.proxy(this.checkPosition, this), 1) + } + + Affix.prototype.checkPosition = function () { + if (!this.$element.is(':visible')) return + + var scrollHeight = $(document).height() + var scrollTop = this.$window.scrollTop() + var position = this.$element.offset() + var offset = this.options.offset + var offsetTop = offset.top + var offsetBottom = offset.bottom + + if (typeof offset != 'object') offsetBottom = offsetTop = offset + if (typeof offsetTop == 'function') offsetTop = offset.top() + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() + + var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : + offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : + offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false + + if (this.affixed === affix) return + if (this.unpin) this.$element.css('top', '') + + this.affixed = affix + this.unpin = affix == 'bottom' ? position.top - scrollTop : null + + this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : '')) + + if (affix == 'bottom') { + this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() }) + } + } + + + // AFFIX PLUGIN DEFINITION + // ======================= + + var old = $.fn.affix + + $.fn.affix = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.affix') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.affix', (data = new Affix(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.affix.Constructor = Affix + + + // AFFIX NO CONFLICT + // ================= + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } + + + // AFFIX DATA-API + // ============== + + $(window).on('load', function () { + $('[data-spy="affix"]').each(function () { + var $spy = $(this) + var data = $spy.data() + + data.offset = data.offset || {} + + if (data.offsetBottom) data.offset.bottom = data.offsetBottom + if (data.offsetTop) data.offset.top = data.offsetTop + + $spy.affix(data) + }) + }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap-alert.js b/vendor/scripts/bootstrap/alert.js similarity index 50% rename from vendor/scripts/bootstrap/bootstrap-alert.js rename to vendor/scripts/bootstrap/alert.js index 8917f9490..695ad74d0 100644 --- a/vendor/scripts/bootstrap/bootstrap-alert.js +++ b/vendor/scripts/bootstrap/alert.js @@ -1,8 +1,8 @@ -/* ========================================================== - * bootstrap-alert.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#alerts - * ========================================================== - * Copyright 2012 Twitter, Inc. +/* ======================================================================== + * Bootstrap: alert.js v3.0.3 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2013 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,66 +15,65 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ========================================================== */ + * ======================================================================== */ -!function ($) { ++function ($) { "use strict"; - "use strict"; // jshint ;_; - - - /* ALERT CLASS DEFINITION - * ====================== */ + // ALERT CLASS DEFINITION + // ====================== var dismiss = '[data-dismiss="alert"]' - , Alert = function (el) { - $(el).on('click', dismiss, this.close) - } + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } Alert.prototype.close = function (e) { - var $this = $(this) - , selector = $this.attr('data-target') - , $parent + var $this = $(this) + var selector = $this.attr('data-target') if (!selector) { selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - $parent = $(selector) + var $parent = $(selector) - e && e.preventDefault() + if (e) e.preventDefault() - $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + if (!$parent.length) { + $parent = $this.hasClass('alert') ? $this : $this.parent() + } - $parent.trigger(e = $.Event('close')) + $parent.trigger(e = $.Event('close.bs.alert')) if (e.isDefaultPrevented()) return $parent.removeClass('in') function removeElement() { - $parent - .trigger('closed') - .remove() + $parent.trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? - $parent.on($.support.transition.end, removeElement) : + $parent + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : removeElement() } - /* ALERT PLUGIN DEFINITION - * ======================= */ + // ALERT PLUGIN DEFINITION + // ======================= var old = $.fn.alert $.fn.alert = function (option) { return this.each(function () { var $this = $(this) - , data = $this.data('alert') - if (!data) $this.data('alert', (data = new Alert(this))) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) if (typeof option == 'string') data[option].call($this) }) } @@ -82,8 +81,8 @@ $.fn.alert.Constructor = Alert - /* ALERT NO CONFLICT - * ================= */ + // ALERT NO CONFLICT + // ================= $.fn.alert.noConflict = function () { $.fn.alert = old @@ -91,9 +90,9 @@ } - /* ALERT DATA-API - * ============== */ + // ALERT DATA-API + // ============== - $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) -}(window.jQuery); \ No newline at end of file +}(jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap-affix.js b/vendor/scripts/bootstrap/bootstrap-affix.js deleted file mode 100644 index 827ff458e..000000000 --- a/vendor/scripts/bootstrap/bootstrap-affix.js +++ /dev/null @@ -1,117 +0,0 @@ -/* ========================================================== - * bootstrap-affix.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#affix - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* AFFIX CLASS DEFINITION - * ====================== */ - - var Affix = function (element, options) { - this.options = $.extend({}, $.fn.affix.defaults, options) - this.$window = $(window) - .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) - .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) - this.$element = $(element) - this.checkPosition() - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var scrollHeight = $(document).height() - , scrollTop = this.$window.scrollTop() - , position = this.$element.offset() - , offset = this.options.offset - , offsetBottom = offset.bottom - , offsetTop = offset.top - , reset = 'affix affix-top affix-bottom' - , affix - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top() - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() - - affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? - false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? - 'bottom' : offsetTop != null && scrollTop <= offsetTop ? - 'top' : false - - if (this.affixed === affix) return - - this.affixed = affix - this.unpin = affix == 'bottom' ? position.top - scrollTop : null - - this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) - } - - - /* AFFIX PLUGIN DEFINITION - * ======================= */ - - var old = $.fn.affix - - $.fn.affix = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('affix') - , options = typeof option == 'object' && option - if (!data) $this.data('affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.affix.Constructor = Affix - - $.fn.affix.defaults = { - offset: 0 - } - - - /* AFFIX NO CONFLICT - * ================= */ - - $.fn.affix.noConflict = function () { - $.fn.affix = old - return this - } - - - /* AFFIX DATA-API - * ============== */ - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - , data = $spy.data() - - data.offset = data.offset || {} - - data.offsetBottom && (data.offset.bottom = data.offsetBottom) - data.offsetTop && (data.offset.top = data.offsetTop) - - $spy.affix(data) - }) - }) - - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-button.js b/vendor/scripts/bootstrap/bootstrap-button.js deleted file mode 100644 index 66df0a296..000000000 --- a/vendor/scripts/bootstrap/bootstrap-button.js +++ /dev/null @@ -1,105 +0,0 @@ -/* ============================================================ - * bootstrap-button.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#buttons - * ============================================================ - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* BUTTON PUBLIC CLASS DEFINITION - * ============================== */ - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.button.defaults, options) - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - , $el = this.$element - , data = $el.data() - , val = $el.is('input') ? 'val' : 'html' - - state = state + 'Text' - data.resetText || $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d) - }, 0) - } - - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons-radio"]') - - $parent && $parent - .find('.active') - .removeClass('active') - - this.$element.toggleClass('active') - } - - - /* BUTTON PLUGIN DEFINITION - * ======================== */ - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('button') - , options = typeof option == 'object' && option - if (!data) $this.data('button', (data = new Button(this, options))) - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.defaults = { - loadingText: 'loading...' - } - - $.fn.button.Constructor = Button - - - /* BUTTON NO CONFLICT - * ================== */ - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - /* BUTTON DATA-API - * =============== */ - - $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - }) - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-carousel.js b/vendor/scripts/bootstrap/bootstrap-carousel.js deleted file mode 100644 index b40edd7bf..000000000 --- a/vendor/scripts/bootstrap/bootstrap-carousel.js +++ /dev/null @@ -1,207 +0,0 @@ -/* ========================================================== - * bootstrap-carousel.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#carousel - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* CAROUSEL CLASS DEFINITION - * ========================= */ - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.prototype = { - - cycle: function (e) { - if (!e) this.paused = false - if (this.interval) clearInterval(this.interval); - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - return this - } - - , getActiveIndex: function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - return this.$items.index(this.$active) - } - - , to: function (pos) { - var activeIndex = this.getActiveIndex() - , that = this - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) { - return this.$element.one('slid', function () { - that.to(pos) - }) - } - - if (activeIndex == pos) { - return this.pause().cycle() - } - - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) - } - - , pause: function (e) { - if (!e) this.paused = true - if (this.$element.find('.next, .prev').length && $.support.transition.end) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - clearInterval(this.interval) - this.interval = null - return this - } - - , next: function () { - if (this.sliding) return - return this.slide('next') - } - - , prev: function () { - if (this.sliding) return - return this.slide('prev') - } - - , slide: function (type, next) { - var $active = this.$element.find('.item.active') - , $next = next || $active[type]() - , isCycling = this.interval - , direction = type == 'next' ? 'left' : 'right' - , fallback = type == 'next' ? 'first' : 'last' - , that = this - , e - - this.sliding = true - - isCycling && this.pause() - - $next = $next.length ? $next : this.$element.find('.item')[fallback]() - - e = $.Event('slide', { - relatedTarget: $next[0] - , direction: direction - }) - - if ($next.hasClass('active')) return - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) - } - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - this.$element.one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) - }) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - } - - - /* CAROUSEL PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('carousel') - , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) - , action = typeof option == 'string' ? option : options.slide - if (!data) $this.data('carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - $.fn.carousel.defaults = { - interval: 5000 - , pause: 'hover' - } - - $.fn.carousel.Constructor = Carousel - - - /* CAROUSEL NO CONFLICT - * ==================== */ - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - /* CAROUSEL DATA-API - * ================= */ - - $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - , options = $.extend({}, $target.data(), $this.data()) - , slideIndex - - $target.carousel(options) - - if (slideIndex = $this.attr('data-slide-to')) { - $target.data('carousel').pause().to(slideIndex).cycle() - } - - e.preventDefault() - }) - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-collapse.js b/vendor/scripts/bootstrap/bootstrap-collapse.js deleted file mode 100644 index 2bede4a88..000000000 --- a/vendor/scripts/bootstrap/bootstrap-collapse.js +++ /dev/null @@ -1,167 +0,0 @@ -/* ============================================================= - * bootstrap-collapse.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#collapse - * ============================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* COLLAPSE PUBLIC CLASS DEFINITION - * ================================ */ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.collapse.defaults, options) - - if (this.options.parent) { - this.$parent = $(this.options.parent) - } - - this.options.toggle && this.toggle() - } - - Collapse.prototype = { - - constructor: Collapse - - , dimension: function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - , show: function () { - var dimension - , scroll - , actives - , hasData - - if (this.transitioning || this.$element.hasClass('in')) return - - dimension = this.dimension() - scroll = $.camelCase(['scroll', dimension].join('-')) - actives = this.$parent && this.$parent.find('> .accordion-group > .in') - - if (actives && actives.length) { - hasData = actives.data('collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('collapse', null) - } - - this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') - $.support.transition && this.$element[dimension](this.$element[0][scroll]) - } - - , hide: function () { - var dimension - if (this.transitioning || !this.$element.hasClass('in')) return - dimension = this.dimension() - this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') - this.$element[dimension](0) - } - - , reset: function (size) { - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - [dimension](size || 'auto') - [0].offsetWidth - - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - - return this - } - - , transition: function (method, startEvent, completeEvent) { - var that = this - , complete = function () { - if (startEvent.type == 'show') that.reset() - that.transitioning = 0 - that.$element.trigger(completeEvent) - } - - this.$element.trigger(startEvent) - - if (startEvent.isDefaultPrevented()) return - - this.transitioning = 1 - - this.$element[method]('in') - - $.support.transition && this.$element.hasClass('collapse') ? - this.$element.one($.support.transition.end, complete) : - complete() - } - - , toggle: function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - } - - - /* COLLAPSE PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('collapse') - , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) - if (!data) $this.data('collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.defaults = { - toggle: true - } - - $.fn.collapse.Constructor = Collapse - - - /* COLLAPSE NO CONFLICT - * ==================== */ - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - /* COLLAPSE DATA-API - * ================= */ - - $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - , target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - , option = $(target).data('collapse') ? 'toggle' : $this.data() - $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - $(target).collapse(option) - }) - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-dropdown.js b/vendor/scripts/bootstrap/bootstrap-dropdown.js deleted file mode 100644 index a1d51519f..000000000 --- a/vendor/scripts/bootstrap/bootstrap-dropdown.js +++ /dev/null @@ -1,165 +0,0 @@ -/* ============================================================ - * bootstrap-dropdown.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#dropdowns - * ============================================================ - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* DROPDOWN CLASS DEFINITION - * ========================= */ - - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - $parent.toggleClass('open') - } - - $this.focus() - - return false - } - - , keydown: function (e) { - var $this - , $items - , $active - , $parent - , isActive - , index - - if (!/(38|40|27)/.test(e.keyCode)) return - - $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) { - if (e.which == 27) $parent.find(toggle).focus() - return $this.click() - } - - $items = $('[role=menu] li:not(.divider):visible a', $parent) - - if (!$items.length) return - - index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items - .eq(index) - .focus() - } - - } - - function clearMenus() { - $(toggle).each(function () { - getParent($(this)).removeClass('open') - }) - } - - function getParent($this) { - var selector = $this.attr('data-target') - , $parent - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = selector && $(selector) - - if (!$parent || !$parent.length) $parent = $this.parent() - - return $parent - } - - - /* DROPDOWN PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.dropdown - - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('dropdown') - if (!data) $this.data('dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.dropdown.Constructor = Dropdown - - - /* DROPDOWN NO CONFLICT - * ==================== */ - - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } - - - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ - - $(document) - .on('click.dropdown.data-api', clearMenus) - .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('click.dropdown-menu', function (e) { e.stopPropagation() }) - .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) - .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) - -}(window.jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap-modal.js b/vendor/scripts/bootstrap/bootstrap-modal.js deleted file mode 100644 index 12abe06f1..000000000 --- a/vendor/scripts/bootstrap/bootstrap-modal.js +++ /dev/null @@ -1,247 +0,0 @@ -/* ========================================================= - * bootstrap-modal.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================= */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* MODAL CLASS DEFINITION - * ====================== */ - - var Modal = function (element, options) { - this.options = options - this.$element = $(element) - .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) - this.options.remote && this.$element.find('.modal-body').load(this.options.remote) - } - - Modal.prototype = { - - constructor: Modal - - , toggle: function () { - return this[!this.isShown ? 'show' : 'hide']() - } - - , show: function () { - var that = this - , e = $.Event('show') - - this.$element.trigger(e) - - if (this.isShown || e.isDefaultPrevented()) return - - this.isShown = true - - this.escape() - - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') - - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position - } - - that.$element.show() - - if (transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element - .addClass('in') - .attr('aria-hidden', false) - - that.enforceFocus() - - transition ? - that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : - that.$element.focus().trigger('shown') - - }) - } - - , hide: function (e) { - e && e.preventDefault() - - var that = this - - e = $.Event('hide') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - - $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : - this.hideModal() - } - - , enforceFocus: function () { - var that = this - $(document).on('focusin.modal', function (e) { - if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { - that.$element.focus() - } - }) - } - - , escape: function () { - var that = this - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.modal', function ( e ) { - e.which == 27 && that.hide() - }) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.modal') - } - } - - , hideWithTransition: function () { - var that = this - , timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - - , hideModal: function () { - var that = this - this.$element.hide() - this.backdrop(function () { - that.removeBackdrop() - that.$element.trigger('hidden') - }) - } - - , removeBackdrop: function () { - this.$backdrop && this.$backdrop.remove() - this.$backdrop = null - } - - , backdrop: function (callback) { - var that = this - , animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') - .appendTo(document.body) - - this.$backdrop.click( - this.options.backdrop == 'static' ? - $.proxy(this.$element[0].focus, this.$element[0]) - : $.proxy(this.hide, this) - ) - - if (doAnimate) this.$backdrop[0].offsetWidth // force reflow - - this.$backdrop.addClass('in') - - if (!callback) return - - doAnimate ? - this.$backdrop.one($.support.transition.end, callback) : - callback() - - } else if (!this.isShown && this.$backdrop) { - this.$backdrop.removeClass('in') - - $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one($.support.transition.end, callback) : - callback() - - } else if (callback) { - callback() - } - } - } - - - /* MODAL PLUGIN DEFINITION - * ======================= */ - - var old = $.fn.modal - - $.fn.modal = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('modal') - , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option) - if (!data) $this.data('modal', (data = new Modal(this, options))) - if (typeof option == 'string') data[option]() - else if (options.show) data.show() - }) - } - - $.fn.modal.defaults = { - backdrop: true - , keyboard: true - , show: true - } - - $.fn.modal.Constructor = Modal - - - /* MODAL NO CONFLICT - * ================= */ - - $.fn.modal.noConflict = function () { - $.fn.modal = old - return this - } - - - /* MODAL DATA-API - * ============== */ - - $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) { - var $this = $(this) - , href = $this.attr('href') - , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 - , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data()) - - e.preventDefault() - - $target - .modal(option) - .one('hide', function () { - $this.focus() - }) - }) - -}(window.jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap-popover.js b/vendor/scripts/bootstrap/bootstrap-popover.js deleted file mode 100644 index e6d897cd3..000000000 --- a/vendor/scripts/bootstrap/bootstrap-popover.js +++ /dev/null @@ -1,114 +0,0 @@ -/* =========================================================== - * bootstrap-popover.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#popovers - * =========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* POPOVER PUBLIC CLASS DEFINITION - * =============================== */ - - var Popover = function (element, options) { - this.init('popover', element, options) - } - - - /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js - ========================================== */ - - Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { - - constructor: Popover - - , setContent: function () { - var $tip = this.tip() - , title = this.getTitle() - , content = this.getContent() - - $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) - $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) - - $tip.removeClass('fade top bottom left right in') - } - - , hasContent: function () { - return this.getTitle() || this.getContent() - } - - , getContent: function () { - var content - , $e = this.$element - , o = this.options - - content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) - || $e.attr('data-content') - - return content - } - - , tip: function () { - if (!this.$tip) { - this.$tip = $(this.options.template) - } - return this.$tip - } - - , destroy: function () { - this.hide().$element.off('.' + this.type).removeData(this.type) - } - - }) - - - /* POPOVER PLUGIN DEFINITION - * ======================= */ - - var old = $.fn.popover - - $.fn.popover = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('popover') - , options = typeof option == 'object' && option - if (!data) $this.data('popover', (data = new Popover(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.popover.Constructor = Popover - - $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { - placement: 'right' - , trigger: 'click' - , content: '' - , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' - }) - - - /* POPOVER NO CONFLICT - * =================== */ - - $.fn.popover.noConflict = function () { - $.fn.popover = old - return this - } - -}(window.jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap-scrollspy.js b/vendor/scripts/bootstrap/bootstrap-scrollspy.js deleted file mode 100644 index ac1402b4b..000000000 --- a/vendor/scripts/bootstrap/bootstrap-scrollspy.js +++ /dev/null @@ -1,162 +0,0 @@ -/* ============================================================= - * bootstrap-scrollspy.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#scrollspy - * ============================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* SCROLLSPY CLASS DEFINITION - * ========================== */ - - function ScrollSpy(element, options) { - var process = $.proxy(this.process, this) - , $element = $(element).is('body') ? $(window) : $(element) - , href - this.options = $.extend({}, $.fn.scrollspy.defaults, options) - this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process) - this.selector = (this.options.target - || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - || '') + ' .nav li > a' - this.$body = $('body') - this.refresh() - this.process() - } - - ScrollSpy.prototype = { - - constructor: ScrollSpy - - , refresh: function () { - var self = this - , $targets - - this.offsets = $([]) - this.targets = $([]) - - $targets = this.$body - .find(this.selector) - .map(function () { - var $el = $(this) - , href = $el.data('target') || $el.attr('href') - , $href = /^#\w/.test(href) && $(href) - return ( $href - && $href.length - && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null - }) - .sort(function (a, b) { return a[0] - b[0] }) - .each(function () { - self.offsets.push(this[0]) - self.targets.push(this[1]) - }) - } - - , process: function () { - var scrollTop = this.$scrollElement.scrollTop() + this.options.offset - , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight - , maxScroll = scrollHeight - this.$scrollElement.height() - , offsets = this.offsets - , targets = this.targets - , activeTarget = this.activeTarget - , i - - if (scrollTop >= maxScroll) { - return activeTarget != (i = targets.last()[0]) - && this.activate ( i ) - } - - for (i = offsets.length; i--;) { - activeTarget != targets[i] - && scrollTop >= offsets[i] - && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) - && this.activate( targets[i] ) - } - } - - , activate: function (target) { - var active - , selector - - this.activeTarget = target - - $(this.selector) - .parent('.active') - .removeClass('active') - - selector = this.selector - + '[data-target="' + target + '"],' - + this.selector + '[href="' + target + '"]' - - active = $(selector) - .parent('li') - .addClass('active') - - if (active.parent('.dropdown-menu').length) { - active = active.closest('li.dropdown').addClass('active') - } - - active.trigger('activate') - } - - } - - - /* SCROLLSPY PLUGIN DEFINITION - * =========================== */ - - var old = $.fn.scrollspy - - $.fn.scrollspy = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('scrollspy') - , options = typeof option == 'object' && option - if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.scrollspy.Constructor = ScrollSpy - - $.fn.scrollspy.defaults = { - offset: 10 - } - - - /* SCROLLSPY NO CONFLICT - * ===================== */ - - $.fn.scrollspy.noConflict = function () { - $.fn.scrollspy = old - return this - } - - - /* SCROLLSPY DATA-API - * ================== */ - - $(window).on('load', function () { - $('[data-spy="scroll"]').each(function () { - var $spy = $(this) - $spy.scrollspy($spy.data()) - }) - }) - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-tab.js b/vendor/scripts/bootstrap/bootstrap-tab.js deleted file mode 100644 index 1d23df6c6..000000000 --- a/vendor/scripts/bootstrap/bootstrap-tab.js +++ /dev/null @@ -1,144 +0,0 @@ -/* ======================================================== - * bootstrap-tab.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#tabs - * ======================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* TAB CLASS DEFINITION - * ==================== */ - - var Tab = function (element) { - this.element = $(element) - } - - Tab.prototype = { - - constructor: Tab - - , show: function () { - var $this = this.element - , $ul = $this.closest('ul:not(.dropdown-menu)') - , selector = $this.attr('data-target') - , previous - , $target - , e - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - if ( $this.parent('li').hasClass('active') ) return - - previous = $ul.find('.active:last a')[0] - - e = $.Event('show', { - relatedTarget: previous - }) - - $this.trigger(e) - - if (e.isDefaultPrevented()) return - - $target = $(selector) - - this.activate($this.parent('li'), $ul) - this.activate($target, $target.parent(), function () { - $this.trigger({ - type: 'shown' - , relatedTarget: previous - }) - }) - } - - , activate: function ( element, container, callback) { - var $active = container.find('> .active') - , transition = callback - && $.support.transition - && $active.hasClass('fade') - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - - element.addClass('active') - - if (transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if ( element.parent('.dropdown-menu') ) { - element.closest('li.dropdown').addClass('active') - } - - callback && callback() - } - - transition ? - $active.one($.support.transition.end, next) : - next() - - $active.removeClass('in') - } - } - - - /* TAB PLUGIN DEFINITION - * ===================== */ - - var old = $.fn.tab - - $.fn.tab = function ( option ) { - return this.each(function () { - var $this = $(this) - , data = $this.data('tab') - if (!data) $this.data('tab', (data = new Tab(this))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.tab.Constructor = Tab - - - /* TAB NO CONFLICT - * =============== */ - - $.fn.tab.noConflict = function () { - $.fn.tab = old - return this - } - - - /* TAB DATA-API - * ============ */ - - $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { - e.preventDefault() - $(this).tab('show') - }) - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-tooltip.js b/vendor/scripts/bootstrap/bootstrap-tooltip.js deleted file mode 100644 index 835abbe68..000000000 --- a/vendor/scripts/bootstrap/bootstrap-tooltip.js +++ /dev/null @@ -1,361 +0,0 @@ -/* =========================================================== - * bootstrap-tooltip.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#tooltips - * Inspired by the original jQuery.tipsy by Jason Frame - * =========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* TOOLTIP PUBLIC CLASS DEFINITION - * =============================== */ - - var Tooltip = function (element, options) { - this.init('tooltip', element, options) - } - - Tooltip.prototype = { - - constructor: Tooltip - - , init: function (type, element, options) { - var eventIn - , eventOut - , triggers - , trigger - , i - - this.type = type - this.$element = $(element) - this.options = this.getOptions(options) - this.enabled = true - - triggers = this.options.trigger.split(' ') - - for (i = triggers.length; i--;) { - trigger = triggers[i] - if (trigger == 'click') { - this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) - } else if (trigger != 'manual') { - eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' - eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' - this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) - this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) - } - } - - this.options.selector ? - (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : - this.fixTitle() - } - - , getOptions: function (options) { - options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options) - - if (options.delay && typeof options.delay == 'number') { - options.delay = { - show: options.delay - , hide: options.delay - } - } - - return options - } - - , enter: function (e) { - var defaults = $.fn[this.type].defaults - , options = {} - , self - - this._options && $.each(this._options, function (key, value) { - if (defaults[key] != value) options[key] = value - }, this) - - self = $(e.currentTarget)[this.type](options).data(this.type) - - if (!self.options.delay || !self.options.delay.show) return self.show() - - clearTimeout(this.timeout) - self.hoverState = 'in' - this.timeout = setTimeout(function() { - if (self.hoverState == 'in') self.show() - }, self.options.delay.show) - } - - , leave: function (e) { - var self = $(e.currentTarget)[this.type](this._options).data(this.type) - - if (this.timeout) clearTimeout(this.timeout) - if (!self.options.delay || !self.options.delay.hide) return self.hide() - - self.hoverState = 'out' - this.timeout = setTimeout(function() { - if (self.hoverState == 'out') self.hide() - }, self.options.delay.hide) - } - - , show: function () { - var $tip - , pos - , actualWidth - , actualHeight - , placement - , tp - , e = $.Event('show') - - if (this.hasContent() && this.enabled) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $tip = this.tip() - this.setContent() - - if (this.options.animation) { - $tip.addClass('fade') - } - - placement = typeof this.options.placement == 'function' ? - this.options.placement.call(this, $tip[0], this.$element[0]) : - this.options.placement - - $tip - .detach() - .css({ top: 0, left: 0, display: 'block' }) - - this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) - - pos = this.getPosition() - - actualWidth = $tip[0].offsetWidth - actualHeight = $tip[0].offsetHeight - - switch (placement) { - case 'bottom': - tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} - break - case 'top': - tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} - break - case 'left': - tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} - break - case 'right': - tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} - break - } - - this.applyPlacement(tp, placement) - this.$element.trigger('shown') - } - } - - , applyPlacement: function(offset, placement){ - var $tip = this.tip() - , width = $tip[0].offsetWidth - , height = $tip[0].offsetHeight - , actualWidth - , actualHeight - , delta - , replace - - $tip - .offset(offset) - .addClass(placement) - .addClass('in') - - actualWidth = $tip[0].offsetWidth - actualHeight = $tip[0].offsetHeight - - if (placement == 'top' && actualHeight != height) { - offset.top = offset.top + height - actualHeight - replace = true - } - - if (placement == 'bottom' || placement == 'top') { - delta = 0 - - if (offset.left < 0){ - delta = offset.left * -2 - offset.left = 0 - $tip.offset(offset) - actualWidth = $tip[0].offsetWidth - actualHeight = $tip[0].offsetHeight - } - - this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') - } else { - this.replaceArrow(actualHeight - height, actualHeight, 'top') - } - - if (replace) $tip.offset(offset) - } - - , replaceArrow: function(delta, dimension, position){ - this - .arrow() - .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') - } - - , setContent: function () { - var $tip = this.tip() - , title = this.getTitle() - - $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) - $tip.removeClass('fade in top bottom left right') - } - - , hide: function () { - var that = this - , $tip = this.tip() - , e = $.Event('hide') - - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - - $tip.removeClass('in') - - function removeWithAnimation() { - var timeout = setTimeout(function () { - $tip.off($.support.transition.end).detach() - }, 500) - - $tip.one($.support.transition.end, function () { - clearTimeout(timeout) - $tip.detach() - }) - } - - $.support.transition && this.$tip.hasClass('fade') ? - removeWithAnimation() : - $tip.detach() - - this.$element.trigger('hidden') - - return this - } - - , fixTitle: function () { - var $e = this.$element - if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { - $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') - } - } - - , hasContent: function () { - return this.getTitle() - } - - , getPosition: function () { - var el = this.$element[0] - return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { - width: el.offsetWidth - , height: el.offsetHeight - }, this.$element.offset()) - } - - , getTitle: function () { - var title - , $e = this.$element - , o = this.options - - title = $e.attr('data-original-title') - || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - - return title - } - - , tip: function () { - return this.$tip = this.$tip || $(this.options.template) - } - - , arrow: function(){ - return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") - } - - , validate: function () { - if (!this.$element[0].parentNode) { - this.hide() - this.$element = null - this.options = null - } - } - - , enable: function () { - this.enabled = true - } - - , disable: function () { - this.enabled = false - } - - , toggleEnabled: function () { - this.enabled = !this.enabled - } - - , toggle: function (e) { - var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this - self.tip().hasClass('in') ? self.hide() : self.show() - } - - , destroy: function () { - this.hide().$element.off('.' + this.type).removeData(this.type) - } - - } - - - /* TOOLTIP PLUGIN DEFINITION - * ========================= */ - - var old = $.fn.tooltip - - $.fn.tooltip = function ( option ) { - return this.each(function () { - var $this = $(this) - , data = $this.data('tooltip') - , options = typeof option == 'object' && option - if (!data) $this.data('tooltip', (data = new Tooltip(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.tooltip.Constructor = Tooltip - - $.fn.tooltip.defaults = { - animation: true - , placement: 'top' - , selector: false - , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' - , trigger: 'hover focus' - , title: '' - , delay: 0 - , html: false - , container: false - } - - - /* TOOLTIP NO CONFLICT - * =================== */ - - $.fn.tooltip.noConflict = function () { - $.fn.tooltip = old - return this - } - -}(window.jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap-transition.js b/vendor/scripts/bootstrap/bootstrap-transition.js deleted file mode 100644 index 92719d37e..000000000 --- a/vendor/scripts/bootstrap/bootstrap-transition.js +++ /dev/null @@ -1,60 +0,0 @@ -/* =================================================== - * bootstrap-transition.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#transitions - * =================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) - * ======================================================= */ - - $(function () { - - $.support.transition = (function () { - - var transitionEnd = (function () { - - var el = document.createElement('bootstrap') - , transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd' - , 'MozTransition' : 'transitionend' - , 'OTransition' : 'oTransitionEnd otransitionend' - , 'transition' : 'transitionend' - } - , name - - for (name in transEndEventNames){ - if (el.style[name] !== undefined) { - return transEndEventNames[name] - } - } - - }()) - - return transitionEnd && { - end: transitionEnd - } - - })() - - }) - -}(window.jQuery); \ No newline at end of file diff --git a/vendor/scripts/bootstrap/bootstrap-typeahead.js b/vendor/scripts/bootstrap/bootstrap-typeahead.js deleted file mode 100644 index 280cde8be..000000000 --- a/vendor/scripts/bootstrap/bootstrap-typeahead.js +++ /dev/null @@ -1,335 +0,0 @@ -/* ============================================================= - * bootstrap-typeahead.js v2.3.1 - * http://twitter.github.com/bootstrap/javascript.html#typeahead - * ============================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function($){ - - "use strict"; // jshint ;_; - - - /* TYPEAHEAD PUBLIC CLASS DEFINITION - * ================================= */ - - var Typeahead = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.typeahead.defaults, options) - this.matcher = this.options.matcher || this.matcher - this.sorter = this.options.sorter || this.sorter - this.highlighter = this.options.highlighter || this.highlighter - this.updater = this.options.updater || this.updater - this.source = this.options.source - this.$menu = $(this.options.menu) - this.shown = false - this.listen() - } - - Typeahead.prototype = { - - constructor: Typeahead - - , select: function () { - var val = this.$menu.find('.active').attr('data-value') - this.$element - .val(this.updater(val)) - .change() - return this.hide() - } - - , updater: function (item) { - return item - } - - , show: function () { - var pos = $.extend({}, this.$element.position(), { - height: this.$element[0].offsetHeight - }) - - this.$menu - .insertAfter(this.$element) - .css({ - top: pos.top + pos.height - , left: pos.left - }) - .show() - - this.shown = true - return this - } - - , hide: function () { - this.$menu.hide() - this.shown = false - return this - } - - , lookup: function (event) { - var items - - this.query = this.$element.val() - - if (!this.query || this.query.length < this.options.minLength) { - return this.shown ? this.hide() : this - } - - items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source - - return items ? this.process(items) : this - } - - , process: function (items) { - var that = this - - items = $.grep(items, function (item) { - return that.matcher(item) - }) - - items = this.sorter(items) - - if (!items.length) { - return this.shown ? this.hide() : this - } - - return this.render(items.slice(0, this.options.items)).show() - } - - , matcher: function (item) { - return ~item.toLowerCase().indexOf(this.query.toLowerCase()) - } - - , sorter: function (items) { - var beginswith = [] - , caseSensitive = [] - , caseInsensitive = [] - , item - - while (item = items.shift()) { - if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item) - else if (~item.indexOf(this.query)) caseSensitive.push(item) - else caseInsensitive.push(item) - } - - return beginswith.concat(caseSensitive, caseInsensitive) - } - - , highlighter: function (item) { - var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&') - return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) { - return '<strong>' + match + '</strong>' - }) - } - - , render: function (items) { - var that = this - - items = $(items).map(function (i, item) { - i = $(that.options.item).attr('data-value', item) - i.find('a').html(that.highlighter(item)) - return i[0] - }) - - items.first().addClass('active') - this.$menu.html(items) - return this - } - - , next: function (event) { - var active = this.$menu.find('.active').removeClass('active') - , next = active.next() - - if (!next.length) { - next = $(this.$menu.find('li')[0]) - } - - next.addClass('active') - } - - , prev: function (event) { - var active = this.$menu.find('.active').removeClass('active') - , prev = active.prev() - - if (!prev.length) { - prev = this.$menu.find('li').last() - } - - prev.addClass('active') - } - - , listen: function () { - this.$element - .on('focus', $.proxy(this.focus, this)) - .on('blur', $.proxy(this.blur, this)) - .on('keypress', $.proxy(this.keypress, this)) - .on('keyup', $.proxy(this.keyup, this)) - - if (this.eventSupported('keydown')) { - this.$element.on('keydown', $.proxy(this.keydown, this)) - } - - this.$menu - .on('click', $.proxy(this.click, this)) - .on('mouseenter', 'li', $.proxy(this.mouseenter, this)) - .on('mouseleave', 'li', $.proxy(this.mouseleave, this)) - } - - , eventSupported: function(eventName) { - var isSupported = eventName in this.$element - if (!isSupported) { - this.$element.setAttribute(eventName, 'return;') - isSupported = typeof this.$element[eventName] === 'function' - } - return isSupported - } - - , move: function (e) { - if (!this.shown) return - - switch(e.keyCode) { - case 9: // tab - case 13: // enter - case 27: // escape - e.preventDefault() - break - - case 38: // up arrow - e.preventDefault() - this.prev() - break - - case 40: // down arrow - e.preventDefault() - this.next() - break - } - - e.stopPropagation() - } - - , keydown: function (e) { - this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]) - this.move(e) - } - - , keypress: function (e) { - if (this.suppressKeyPressRepeat) return - this.move(e) - } - - , keyup: function (e) { - switch(e.keyCode) { - case 40: // down arrow - case 38: // up arrow - case 16: // shift - case 17: // ctrl - case 18: // alt - break - - case 9: // tab - case 13: // enter - if (!this.shown) return - this.select() - break - - case 27: // escape - if (!this.shown) return - this.hide() - break - - default: - this.lookup() - } - - e.stopPropagation() - e.preventDefault() - } - - , focus: function (e) { - this.focused = true - } - - , blur: function (e) { - this.focused = false - if (!this.mousedover && this.shown) this.hide() - } - - , click: function (e) { - e.stopPropagation() - e.preventDefault() - this.select() - this.$element.focus() - } - - , mouseenter: function (e) { - this.mousedover = true - this.$menu.find('.active').removeClass('active') - $(e.currentTarget).addClass('active') - } - - , mouseleave: function (e) { - this.mousedover = false - if (!this.focused && this.shown) this.hide() - } - - } - - - /* TYPEAHEAD PLUGIN DEFINITION - * =========================== */ - - var old = $.fn.typeahead - - $.fn.typeahead = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('typeahead') - , options = typeof option == 'object' && option - if (!data) $this.data('typeahead', (data = new Typeahead(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.typeahead.defaults = { - source: [] - , items: 8 - , menu: '<ul class="typeahead dropdown-menu"></ul>' - , item: '<li><a href="#"></a></li>' - , minLength: 1 - } - - $.fn.typeahead.Constructor = Typeahead - - - /* TYPEAHEAD NO CONFLICT - * =================== */ - - $.fn.typeahead.noConflict = function () { - $.fn.typeahead = old - return this - } - - - /* TYPEAHEAD DATA-API - * ================== */ - - $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { - var $this = $(this) - if ($this.data('typeahead')) return - $this.typeahead($this.data()) - }) - -}(window.jQuery); diff --git a/vendor/scripts/bootstrap/bootstrap.js b/vendor/scripts/bootstrap/bootstrap.js index f28d8bbc2..fee1bda9d 100644 --- a/vendor/scripts/bootstrap/bootstrap.js +++ b/vendor/scripts/bootstrap/bootstrap.js @@ -1,13 +1,12 @@ -//= require bootstrap-transition -//= require bootstrap-affix -//= require bootstrap-alert -//= require bootstrap-button -//= require bootstrap-carousel -//= require bootstrap-collapse -//= require bootstrap-dropdown -//= require bootstrap-modal -//= require bootstrap-scrollspy -//= require bootstrap-tab -//= require bootstrap-tooltip -//= require bootstrap-popover -//= require bootstrap-typeahead \ No newline at end of file +//= require affix +//= require alert +//= require button +//= require carousel +//= require collapse +//= require dropdown +//= require tab +//= require transition +//= require scrollspy +//= require modal +//= require tooltip +//= require popover diff --git a/vendor/scripts/bootstrap/button.js b/vendor/scripts/bootstrap/button.js new file mode 100644 index 000000000..c9fdde5e4 --- /dev/null +++ b/vendor/scripts/bootstrap/button.js @@ -0,0 +1,115 @@ +/* ======================================================================== + * Bootstrap: button.js v3.0.3 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + } + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d); + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons"]') + var changed = true + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') === 'radio') { + // see if clicking on current one + if ($input.prop('checked') && this.$element.hasClass('active')) + changed = false + else + $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } + + if (changed) this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/carousel.js b/vendor/scripts/bootstrap/carousel.js new file mode 100644 index 000000000..6391a36df --- /dev/null +++ b/vendor/scripts/bootstrap/carousel.js @@ -0,0 +1,217 @@ +/* ======================================================================== + * Bootstrap: carousel.js v3.0.3 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = + this.sliding = + this.interval = + this.$active = + this.$items = null + + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.DEFAULTS = { + interval: 5000 + , pause: 'hover' + , wrap: true + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getActiveIndex = function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + + return this.$items.index(this.$active) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getActiveIndex() + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || $active[type]() + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' + var that = this + + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + + this.sliding = true + + isCycling && this.pause() + + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + + if ($next.hasClass('active')) return + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid.bs.carousel', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) + }) + .emulateTransitionEnd(600) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid.bs.carousel') + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + }) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + $carousel.carousel($carousel.data()) + }) + }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/collapse.js b/vendor/scripts/bootstrap/collapse.js new file mode 100644 index 000000000..1a079938e --- /dev/null +++ b/vendor/scripts/bootstrap/collapse.js @@ -0,0 +1,179 @@ +/* ======================================================================== + * Bootstrap: collapse.js v3.0.3 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.transitioning = null + + if (this.options.parent) this.$parent = $(this.options.parent) + if (this.options.toggle) this.toggle() + } + + Collapse.DEFAULTS = { + toggle: true + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var actives = this.$parent && this.$parent.find('> .panel > .in') + + if (actives && actives.length) { + var hasData = actives.data('bs.collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('bs.collapse', null) + } + + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing') + [dimension](0) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('in') + [dimension]('auto') + this.transitioning = 0 + this.$element.trigger('shown.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + var scrollSize = $.camelCase(['scroll', dimension].join('-')) + + this.$element + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + [dimension](this.$element[0][scrollSize]) + } + + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var dimension = this.dimension() + + this.$element + [dimension](this.$element[dimension]()) + [0].offsetHeight + + this.$element + .addClass('collapsing') + .removeClass('collapse') + .removeClass('in') + + this.transitioning = 1 + + var complete = function () { + this.transitioning = 0 + this.$element + .trigger('hidden.bs.collapse') + .removeClass('collapsing') + .addClass('collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + } + + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + + // COLLAPSE PLUGIN DEFINITION + // ========================== + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + var target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + var $target = $(target) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() + var parent = $this.attr('data-parent') + var $parent = parent && $(parent) + + if (!data || !data.transitioning) { + if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + } + + $target.collapse(option) + }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/dropdown.js b/vendor/scripts/bootstrap/dropdown.js new file mode 100644 index 000000000..13352ef7c --- /dev/null +++ b/vendor/scripts/bootstrap/dropdown.js @@ -0,0 +1,154 @@ +/* ======================================================================== + * Bootstrap: dropdown.js v3.0.3 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) + } + + $parent.trigger(e = $.Event('show.bs.dropdown')) + + if (e.isDefaultPrevented()) return + + $parent + .toggleClass('open') + .trigger('shown.bs.dropdown') + + $this.focus() + } + + return false + } + + Dropdown.prototype.keydown = function (e) { + if (!/(38|40|27)/.test(e.keyCode)) return + + var $this = $(this) + + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + if (!isActive || (isActive && e.keyCode == 27)) { + if (e.which == 27) $parent.find(toggle).focus() + return $this.click() + } + + var $items = $('[role=menu] li:not(.divider):visible a', $parent) + + if (!$items.length) return + + var index = $items.index($items.filter(':focus')) + + if (e.keyCode == 38 && index > 0) index-- // up + if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (!~index) index=0 + + $items.eq(index).focus() + } + + function clearMenus() { + $(backdrop).remove() + $(toggle).each(function (e) { + var $parent = getParent($(this)) + if (!$parent.hasClass('open')) return + $parent.trigger(e = $.Event('hide.bs.dropdown')) + if (e.isDefaultPrevented()) return + $parent.removeClass('open').trigger('hidden.bs.dropdown') + }) + } + + function getParent($this) { + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + var $parent = selector && $(selector) + + return $parent && $parent.length ? $parent : $this.parent() + } + + + // DROPDOWN PLUGIN DEFINITION + // ========================== + + var old = $.fn.dropdown + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.dropdown') + + if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + // DROPDOWN NO CONFLICT + // ==================== + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + + // APPLY TO STANDARD DROPDOWN ELEMENTS + // =================================== + + $(document) + .on('click.bs.dropdown.data-api', clearMenus) + .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle) + .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/modal.js b/vendor/scripts/bootstrap/modal.js new file mode 100644 index 000000000..3ead5ee88 --- /dev/null +++ b/vendor/scripts/bootstrap/modal.js @@ -0,0 +1,246 @@ +/* ======================================================================== + * Bootstrap: modal.js v3.0.3 + * http://getbootstrap.com/javascript/#modals + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // MODAL CLASS DEFINITION + // ====================== + + var Modal = function (element, options) { + this.options = options + this.$element = $(element) + this.$backdrop = + this.isShown = null + + if (this.options.remote) this.$element.load(this.options.remote) + } + + Modal.DEFAULTS = { + backdrop: true + , keyboard: true + , show: true + } + + Modal.prototype.toggle = function (_relatedTarget) { + return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) + } + + Modal.prototype.show = function (_relatedTarget) { + var that = this + var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) + + this.$element.trigger(e) + + if (this.isShown || e.isDefaultPrevented()) return + + this.isShown = true + + this.escape() + + this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) + + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) // don't move modals dom position + } + + that.$element.show() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element + .addClass('in') + .attr('aria-hidden', false) + + that.enforceFocus() + + var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) + + transition ? + that.$element.find('.modal-dialog') // wait for modal to slide in + .one($.support.transition.end, function () { + that.$element.focus().trigger(e) + }) + .emulateTransitionEnd(300) : + that.$element.focus().trigger(e) + }) + } + + Modal.prototype.hide = function (e) { + if (e) e.preventDefault() + + e = $.Event('hide.bs.modal') + + this.$element.trigger(e) + + if (!this.isShown || e.isDefaultPrevented()) return + + this.isShown = false + + this.escape() + + $(document).off('focusin.bs.modal') + + this.$element + .removeClass('in') + .attr('aria-hidden', true) + .off('click.dismiss.modal') + + $.support.transition && this.$element.hasClass('fade') ? + this.$element + .one($.support.transition.end, $.proxy(this.hideModal, this)) + .emulateTransitionEnd(300) : + this.hideModal() + } + + Modal.prototype.enforceFocus = function () { + $(document) + .off('focusin.bs.modal') // guard against infinite focus loop + .on('focusin.bs.modal', $.proxy(function (e) { + if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { + this.$element.focus() + } + }, this)) + } + + Modal.prototype.escape = function () { + if (this.isShown && this.options.keyboard) { + this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { + e.which == 27 && this.hide() + }, this)) + } else if (!this.isShown) { + this.$element.off('keyup.dismiss.bs.modal') + } + } + + Modal.prototype.hideModal = function () { + var that = this + this.$element.hide() + this.backdrop(function () { + that.removeBackdrop() + that.$element.trigger('hidden.bs.modal') + }) + } + + Modal.prototype.removeBackdrop = function () { + this.$backdrop && this.$backdrop.remove() + this.$backdrop = null + } + + Modal.prototype.backdrop = function (callback) { + var that = this + var animate = this.$element.hasClass('fade') ? 'fade' : '' + + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') + .appendTo(document.body) + + this.$element.on('click.dismiss.modal', $.proxy(function (e) { + if (e.target !== e.currentTarget) return + this.options.backdrop == 'static' + ? this.$element[0].focus.call(this.$element[0]) + : this.hide.call(this) + }, this)) + + if (doAnimate) this.$backdrop[0].offsetWidth // force reflow + + this.$backdrop.addClass('in') + + if (!callback) return + + doAnimate ? + this.$backdrop + .one($.support.transition.end, callback) + .emulateTransitionEnd(150) : + callback() + + } else if (!this.isShown && this.$backdrop) { + this.$backdrop.removeClass('in') + + $.support.transition && this.$element.hasClass('fade')? + this.$backdrop + .one($.support.transition.end, callback) + .emulateTransitionEnd(150) : + callback() + + } else if (callback) { + callback() + } + } + + + // MODAL PLUGIN DEFINITION + // ======================= + + var old = $.fn.modal + + $.fn.modal = function (option, _relatedTarget) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.modal') + var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data) $this.data('bs.modal', (data = new Modal(this, options))) + if (typeof option == 'string') data[option](_relatedTarget) + else if (options.show) data.show(_relatedTarget) + }) + } + + $.fn.modal.Constructor = Modal + + + // MODAL NO CONFLICT + // ================= + + $.fn.modal.noConflict = function () { + $.fn.modal = old + return this + } + + + // MODAL DATA-API + // ============== + + $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { + var $this = $(this) + var href = $this.attr('href') + var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 + var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) + + e.preventDefault() + + $target + .modal(option, this) + .one('hide', function () { + $this.is(':visible') && $this.focus() + }) + }) + + $(document) + .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) + .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/popover.js b/vendor/scripts/bootstrap/popover.js new file mode 100644 index 000000000..996962aa2 --- /dev/null +++ b/vendor/scripts/bootstrap/popover.js @@ -0,0 +1,117 @@ +/* ======================================================================== + * Bootstrap: popover.js v3.0.3 + * http://getbootstrap.com/javascript/#popovers + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // POPOVER PUBLIC CLASS DEFINITION + // =============================== + + var Popover = function (element, options) { + this.init('popover', element, options) + } + + if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') + + Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, { + placement: 'right' + , trigger: 'click' + , content: '' + , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' + }) + + + // NOTE: POPOVER EXTENDS tooltip.js + // ================================ + + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) + + Popover.prototype.constructor = Popover + + Popover.prototype.getDefaults = function () { + return Popover.DEFAULTS + } + + Popover.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + var content = this.getContent() + + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) + $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) + + $tip.removeClass('fade top bottom left right in') + + // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do + // this manually by checking the contents. + if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() + } + + Popover.prototype.hasContent = function () { + return this.getTitle() || this.getContent() + } + + Popover.prototype.getContent = function () { + var $e = this.$element + var o = this.options + + return $e.attr('data-content') + || (typeof o.content == 'function' ? + o.content.call($e[0]) : + o.content) + } + + Popover.prototype.arrow = function () { + return this.$arrow = this.$arrow || this.tip().find('.arrow') + } + + Popover.prototype.tip = function () { + if (!this.$tip) this.$tip = $(this.options.template) + return this.$tip + } + + + // POPOVER PLUGIN DEFINITION + // ========================= + + var old = $.fn.popover + + $.fn.popover = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.popover') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.popover.Constructor = Popover + + + // POPOVER NO CONFLICT + // =================== + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(jQuery); diff --git a/vendor/scripts/bootstrap/scrollspy.js b/vendor/scripts/bootstrap/scrollspy.js new file mode 100644 index 000000000..2efe14fdd --- /dev/null +++ b/vendor/scripts/bootstrap/scrollspy.js @@ -0,0 +1,158 @@ +/* ======================================================================== + * Bootstrap: scrollspy.js v3.0.3 + * http://getbootstrap.com/javascript/#scrollspy + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // SCROLLSPY CLASS DEFINITION + // ========================== + + function ScrollSpy(element, options) { + var href + var process = $.proxy(this.process, this) + + this.$element = $(element).is('body') ? $(window) : $(element) + this.$body = $('body') + this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) + this.options = $.extend({}, ScrollSpy.DEFAULTS, options) + this.selector = (this.options.target + || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + || '') + ' .nav li > a' + this.offsets = $([]) + this.targets = $([]) + this.activeTarget = null + + this.refresh() + this.process() + } + + ScrollSpy.DEFAULTS = { + offset: 10 + } + + ScrollSpy.prototype.refresh = function () { + var offsetMethod = this.$element[0] == window ? 'offset' : 'position' + + this.offsets = $([]) + this.targets = $([]) + + var self = this + var $targets = this.$body + .find(this.selector) + .map(function () { + var $el = $(this) + var href = $el.data('target') || $el.attr('href') + var $href = /^#\w/.test(href) && $(href) + + return ($href + && $href.length + && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null + }) + .sort(function (a, b) { return a[0] - b[0] }) + .each(function () { + self.offsets.push(this[0]) + self.targets.push(this[1]) + }) + } + + ScrollSpy.prototype.process = function () { + var scrollTop = this.$scrollElement.scrollTop() + this.options.offset + var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight + var maxScroll = scrollHeight - this.$scrollElement.height() + var offsets = this.offsets + var targets = this.targets + var activeTarget = this.activeTarget + var i + + if (scrollTop >= maxScroll) { + return activeTarget != (i = targets.last()[0]) && this.activate(i) + } + + for (i = offsets.length; i--;) { + activeTarget != targets[i] + && scrollTop >= offsets[i] + && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) + && this.activate( targets[i] ) + } + } + + ScrollSpy.prototype.activate = function (target) { + this.activeTarget = target + + $(this.selector) + .parents('.active') + .removeClass('active') + + var selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]' + + var active = $(selector) + .parents('li') + .addClass('active') + + if (active.parent('.dropdown-menu').length) { + active = active + .closest('li.dropdown') + .addClass('active') + } + + active.trigger('activate.bs.scrollspy') + } + + + // SCROLLSPY PLUGIN DEFINITION + // =========================== + + var old = $.fn.scrollspy + + $.fn.scrollspy = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.scrollspy') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.scrollspy.Constructor = ScrollSpy + + + // SCROLLSPY NO CONFLICT + // ===================== + + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this + } + + + // SCROLLSPY DATA-API + // ================== + + $(window).on('load', function () { + $('[data-spy="scroll"]').each(function () { + var $spy = $(this) + $spy.scrollspy($spy.data()) + }) + }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/tab.js b/vendor/scripts/bootstrap/tab.js new file mode 100644 index 000000000..6b0f5f672 --- /dev/null +++ b/vendor/scripts/bootstrap/tab.js @@ -0,0 +1,135 @@ +/* ======================================================================== + * Bootstrap: tab.js v3.0.3 + * http://getbootstrap.com/javascript/#tabs + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // TAB CLASS DEFINITION + // ==================== + + var Tab = function (element) { + this.element = $(element) + } + + Tab.prototype.show = function () { + var $this = this.element + var $ul = $this.closest('ul:not(.dropdown-menu)') + var selector = $this.data('target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + if ($this.parent('li').hasClass('active')) return + + var previous = $ul.find('.active:last a')[0] + var e = $.Event('show.bs.tab', { + relatedTarget: previous + }) + + $this.trigger(e) + + if (e.isDefaultPrevented()) return + + var $target = $(selector) + + this.activate($this.parent('li'), $ul) + this.activate($target, $target.parent(), function () { + $this.trigger({ + type: 'shown.bs.tab' + , relatedTarget: previous + }) + }) + } + + Tab.prototype.activate = function (element, container, callback) { + var $active = container.find('> .active') + var transition = callback + && $.support.transition + && $active.hasClass('fade') + + function next() { + $active + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + + element.addClass('active') + + if (transition) { + element[0].offsetWidth // reflow for transition + element.addClass('in') + } else { + element.removeClass('fade') + } + + if (element.parent('.dropdown-menu')) { + element.closest('li.dropdown').addClass('active') + } + + callback && callback() + } + + transition ? + $active + .one($.support.transition.end, next) + .emulateTransitionEnd(150) : + next() + + $active.removeClass('in') + } + + + // TAB PLUGIN DEFINITION + // ===================== + + var old = $.fn.tab + + $.fn.tab = function ( option ) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tab') + + if (!data) $this.data('bs.tab', (data = new Tab(this))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tab.Constructor = Tab + + + // TAB NO CONFLICT + // =============== + + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } + + + // TAB DATA-API + // ============ + + $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { + e.preventDefault() + $(this).tab('show') + }) + +}(jQuery); diff --git a/vendor/scripts/bootstrap/tooltip.js b/vendor/scripts/bootstrap/tooltip.js new file mode 100644 index 000000000..4c848f0e2 --- /dev/null +++ b/vendor/scripts/bootstrap/tooltip.js @@ -0,0 +1,386 @@ +/* ======================================================================== + * Bootstrap: tooltip.js v3.0.3 + * http://getbootstrap.com/javascript/#tooltip + * Inspired by the original jQuery.tipsy by Jason Frame + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // TOOLTIP PUBLIC CLASS DEFINITION + // =============================== + + var Tooltip = function (element, options) { + this.type = + this.options = + this.enabled = + this.timeout = + this.hoverState = + this.$element = null + + this.init('tooltip', element, options) + } + + Tooltip.DEFAULTS = { + animation: true + , placement: 'top' + , selector: false + , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' + , trigger: 'hover focus' + , title: '' + , delay: 0 + , html: false + , container: false + } + + Tooltip.prototype.init = function (type, element, options) { + this.enabled = true + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + + var triggers = this.options.trigger.split(' ') + + for (var i = triggers.length; i--;) { + var trigger = triggers[i] + + if (trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (trigger != 'manual') { + var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' + var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' + + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) + } + } + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + Tooltip.prototype.getDefaults = function () { + return Tooltip.DEFAULTS + } + + Tooltip.prototype.getOptions = function (options) { + options = $.extend({}, this.getDefaults(), this.$element.data(), options) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay + , hide: options.delay + } + } + + return options + } + + Tooltip.prototype.getDelegateOptions = function () { + var options = {} + var defaults = this.getDefaults() + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }) + + return options + } + + Tooltip.prototype.enter = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) + + clearTimeout(self.timeout) + + self.hoverState = 'in' + + if (!self.options.delay || !self.options.delay.show) return self.show() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) + + clearTimeout(self.timeout) + + self.hoverState = 'out' + + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + Tooltip.prototype.show = function () { + var e = $.Event('show.bs.'+ this.type) + + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + var $tip = this.tip() + + this.setContent() + + if (this.options.animation) $tip.addClass('fade') + + var placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + var autoToken = /\s?auto?\s?/i + var autoPlace = autoToken.test(placement) + if (autoPlace) placement = placement.replace(autoToken, '') || 'top' + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }) + .addClass(placement) + + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) + + var pos = this.getPosition() + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (autoPlace) { + var $parent = this.$element.parent() + + var orgPlacement = placement + var docScroll = document.documentElement.scrollTop || document.body.scrollTop + var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() + var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() + var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left + + placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : + placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : + placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : + placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : + placement + + $tip + .removeClass(orgPlacement) + .addClass(placement) + } + + var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + + this.applyPlacement(calculatedOffset, placement) + this.$element.trigger('shown.bs.' + this.type) + } + } + + Tooltip.prototype.applyPlacement = function(offset, placement) { + var replace + var $tip = this.tip() + var width = $tip[0].offsetWidth + var height = $tip[0].offsetHeight + + // manually read margins because getBoundingClientRect includes difference + var marginTop = parseInt($tip.css('margin-top'), 10) + var marginLeft = parseInt($tip.css('margin-left'), 10) + + // we must check for NaN for ie 8/9 + if (isNaN(marginTop)) marginTop = 0 + if (isNaN(marginLeft)) marginLeft = 0 + + offset.top = offset.top + marginTop + offset.left = offset.left + marginLeft + + $tip + .offset(offset) + .addClass('in') + + // check to see if placing tip in new offset caused the tip to resize itself + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (placement == 'top' && actualHeight != height) { + replace = true + offset.top = offset.top + height - actualHeight + } + + if (/bottom|top/.test(placement)) { + var delta = 0 + + if (offset.left < 0) { + delta = offset.left * -2 + offset.left = 0 + + $tip.offset(offset) + + actualWidth = $tip[0].offsetWidth + actualHeight = $tip[0].offsetHeight + } + + this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') + } else { + this.replaceArrow(actualHeight - height, actualHeight, 'top') + } + + if (replace) $tip.offset(offset) + } + + Tooltip.prototype.replaceArrow = function(delta, dimension, position) { + this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') + } + + Tooltip.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + Tooltip.prototype.hide = function () { + var that = this + var $tip = this.tip() + var e = $.Event('hide.bs.' + this.type) + + function complete() { + if (that.hoverState != 'in') $tip.detach() + } + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + $tip.removeClass('in') + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one($.support.transition.end, complete) + .emulateTransitionEnd(150) : + complete() + + this.$element.trigger('hidden.bs.' + this.type) + + return this + } + + Tooltip.prototype.fixTitle = function () { + var $e = this.$element + if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') + } + } + + Tooltip.prototype.hasContent = function () { + return this.getTitle() + } + + Tooltip.prototype.getPosition = function () { + var el = this.$element[0] + return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { + width: el.offsetWidth + , height: el.offsetHeight + }, this.$element.offset()) + } + + Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { + return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : + /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } + } + + Tooltip.prototype.getTitle = function () { + var title + var $e = this.$element + var o = this.options + + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + + return title + } + + Tooltip.prototype.tip = function () { + return this.$tip = this.$tip || $(this.options.template) + } + + Tooltip.prototype.arrow = function () { + return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') + } + + Tooltip.prototype.validate = function () { + if (!this.$element[0].parentNode) { + this.hide() + this.$element = null + this.options = null + } + } + + Tooltip.prototype.enable = function () { + this.enabled = true + } + + Tooltip.prototype.disable = function () { + this.enabled = false + } + + Tooltip.prototype.toggleEnabled = function () { + this.enabled = !this.enabled + } + + Tooltip.prototype.toggle = function (e) { + var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this + self.tip().hasClass('in') ? self.leave(self) : self.enter(self) + } + + Tooltip.prototype.destroy = function () { + this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) + } + + + // TOOLTIP PLUGIN DEFINITION + // ========================= + + var old = $.fn.tooltip + + $.fn.tooltip = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tooltip.Constructor = Tooltip + + + // TOOLTIP NO CONFLICT + // =================== + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(jQuery); diff --git a/vendor/scripts/bootstrap/transition.js b/vendor/scripts/bootstrap/transition.js new file mode 100644 index 000000000..773dbe693 --- /dev/null +++ b/vendor/scripts/bootstrap/transition.js @@ -0,0 +1,56 @@ +/* ======================================================================== + * Bootstrap: transition.js v3.0.3 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + }) + +}(jQuery);