style-guide 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +11 -0
- data/.gitmodules +3 -0
- data/.pairs +11 -0
- data/.rvmrc +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +144 -0
- data/Guardfile +14 -0
- data/LICENSE +7 -0
- data/README.md +7 -0
- data/Rakefile +27 -0
- data/app/assets/images/style_guide/.gitkeep +0 -0
- data/app/assets/images/style_guide/img/bird.png +0 -0
- data/app/assets/images/style_guide/img/bootstrap-mdo-sfmoma-01.jpg +0 -0
- data/app/assets/images/style_guide/img/bootstrap-mdo-sfmoma-02.jpg +0 -0
- data/app/assets/images/style_guide/img/bootstrap-mdo-sfmoma-03.jpg +0 -0
- data/app/assets/images/style_guide/img/browsers.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-bootstrap-features.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-masthead-pattern.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-responsive-illustrations.png +0 -0
- data/app/assets/images/style_guide/img/bs-docs-twitter-github.png +0 -0
- data/app/assets/images/style_guide/img/example-diagram-01.png +0 -0
- data/app/assets/images/style_guide/img/example-diagram-02.png +0 -0
- data/app/assets/images/style_guide/img/example-diagram-03.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/8020select.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/adoptahydrant.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/bartop.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/breakingnews.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/fleetio.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/gathercontent.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/jshint.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/kippt.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/railwayjs.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/soundready.png +0 -0
- data/app/assets/images/style_guide/img/example-sites/totalwireframe.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-carousel.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-fluid.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-hero.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-marketing-narrow.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-signin.png +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-starter.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/bootstrap-example-sticky-footer.png +0 -0
- data/app/assets/images/style_guide/img/examples/browser-icon-chrome.png +0 -0
- data/app/assets/images/style_guide/img/examples/browser-icon-firefox.png +0 -0
- data/app/assets/images/style_guide/img/examples/browser-icon-safari.png +0 -0
- data/app/assets/images/style_guide/img/examples/slide-01.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/slide-02.jpg +0 -0
- data/app/assets/images/style_guide/img/examples/slide-03.jpg +0 -0
- data/app/assets/images/style_guide/img/github-16px.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_042_group.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/style_guide/img/glyphicons-halflings.png +0 -0
- data/app/assets/images/style_guide/img/grid-18px-masked.png +0 -0
- data/app/assets/images/style_guide/img/grid-baseline-20px.png +0 -0
- data/app/assets/images/style_guide/img/icon-css3.png +0 -0
- data/app/assets/images/style_guide/img/icon-github.png +0 -0
- data/app/assets/images/style_guide/img/icon-html5.png +0 -0
- data/app/assets/images/style_guide/img/icon-twitter.png +0 -0
- data/app/assets/images/style_guide/img/less-logo-large.png +0 -0
- data/app/assets/images/style_guide/img/less-small.png +0 -0
- data/app/assets/images/style_guide/img/responsive-illustrations.png +0 -0
- data/app/assets/javascripts/style_guide/application.js +13 -0
- data/app/assets/javascripts/style_guide/docs.js +154 -0
- data/app/assets/javascripts/style_guide/prettify.js +28 -0
- data/app/assets/stylesheets/style_guide/application.css +13 -0
- data/app/assets/stylesheets/style_guide/docs.css +1015 -0
- data/app/assets/stylesheets/style_guide/prettify.css +30 -0
- data/app/controllers/style_guide/application_controller.rb +4 -0
- data/app/controllers/style_guide/style_controller.rb +12 -0
- data/app/helpers/style_guide/application_helper.rb +4 -0
- data/app/views/layouts/style_guide/application.html.erb +44 -0
- data/app/views/style_guide/partials/_buttons.erb +167 -0
- data/app/views/style_guide/partials/_code.erb +31 -0
- data/app/views/style_guide/partials/_forms.erb +714 -0
- data/app/views/style_guide/partials/_images.erb +318 -0
- data/app/views/style_guide/partials/_tables.erb +409 -0
- data/app/views/style_guide/partials/_typography.erb +331 -0
- data/app/views/style_guide/style/index.html.erb +32 -0
- data/config/routes.rb +3 -0
- data/lib/style_guide/engine.rb +12 -0
- data/lib/style_guide/version.rb +3 -0
- data/lib/style_guide.rb +4 -0
- data/script/rails +8 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_042_group.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons-halflings-white.png +0 -0
- data/spec/dummy/app/assets/images/img/glyphicons-halflings.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +27 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-affix.js +106 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-alert.js +88 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-button.js +94 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-carousel.js +176 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-collapse.js +156 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-dropdown.js +148 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-modal.js +234 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-popover.js +103 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-scrollspy.js +151 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-tab.js +133 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-tooltip.js +276 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-transition.js +60 -0
- data/spec/dummy/app/assets/javascripts/bootstrap-typeahead.js +310 -0
- data/spec/dummy/app/assets/javascripts/jquery.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/accordion.less +34 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/alerts.less +65 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/bootstrap.less +63 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/breadcrumbs.less +24 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/button-groups.less +242 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/buttons.less +232 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/carousel.less +131 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/close.less +31 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/code.less +58 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/component-animations.less +22 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/dropdowns.less +237 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/forms.less +683 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/grid.less +21 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/hero-unit.less +25 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/labels-badges.less +74 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/layouts.less +16 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/media.less +55 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/mixins.less +687 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/modals.less +94 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/navbar.less +475 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/navs.less +385 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/pager.less +41 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/pagination.less +121 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/popovers.less +117 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/progress-bars.less +122 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/reset.less +138 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-1200px-min.less +28 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-767px-max.less +193 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-768px-979px.less +19 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-navbar.less +185 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive-utilities.less +43 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/responsive.less +48 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/scaffolding.less +52 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/sprites.less +193 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/tables.less +236 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/thumbnails.less +52 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/tooltip.less +70 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/type.less +227 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/utilities.less +30 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/variables.less +301 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap/wells.less +29 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap-responsive.css +1088 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap.css +5893 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/_colors.scss +10 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/ars-maquette-web.css +35 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/button.less +5 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/layout.css.scss +11 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/typography.css.scss +20 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap/variables.css.less +10 -0
- data/spec/dummy/app/assets/stylesheets/pivotal-bootstrap.css.less +3 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/home_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/home/index.html.erb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/styles/_info-header.erb +1 -0
- data/spec/dummy/config/application.rb +32 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +34 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_042_group.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/spec/dummy/public/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/spec/dummy/public/img/glyphicons-halflings-white.png +0 -0
- data/spec/dummy/public/img/glyphicons-halflings.png +0 -0
- data/spec/dummy/script/rails +6 -0
- data/style-guide.gemspec +26 -0
- metadata +500 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
//
|
2
|
+
// Grid system
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Fixed (940px)
|
7
|
+
#grid > .core(@gridColumnWidth, @gridGutterWidth);
|
8
|
+
|
9
|
+
// Fluid (940px)
|
10
|
+
#grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth);
|
11
|
+
|
12
|
+
// Reset utility classes due to specificity
|
13
|
+
[class*="span"].hide,
|
14
|
+
.row-fluid [class*="span"].hide {
|
15
|
+
display: none;
|
16
|
+
}
|
17
|
+
|
18
|
+
[class*="span"].pull-right,
|
19
|
+
.row-fluid [class*="span"].pull-right {
|
20
|
+
float: right;
|
21
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
//
|
2
|
+
// Hero unit
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
.hero-unit {
|
7
|
+
padding: 60px;
|
8
|
+
margin-bottom: 30px;
|
9
|
+
font-size: 18px;
|
10
|
+
font-weight: 200;
|
11
|
+
line-height: @baseLineHeight * 1.5;
|
12
|
+
color: @heroUnitLeadColor;
|
13
|
+
background-color: @heroUnitBackground;
|
14
|
+
.border-radius(6px);
|
15
|
+
h1 {
|
16
|
+
margin-bottom: 0;
|
17
|
+
font-size: 60px;
|
18
|
+
line-height: 1;
|
19
|
+
color: @heroUnitHeadingColor;
|
20
|
+
letter-spacing: -1px;
|
21
|
+
}
|
22
|
+
li {
|
23
|
+
line-height: @baseLineHeight * 1.5; // Reset since we specify in type.less
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
//
|
2
|
+
// Labels and badges
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Base classes
|
7
|
+
.label,
|
8
|
+
.badge {
|
9
|
+
display: inline-block;
|
10
|
+
padding: 2px 4px;
|
11
|
+
font-size: @baseFontSize * .846;
|
12
|
+
font-weight: bold;
|
13
|
+
line-height: 14px; // ensure proper line-height if floated
|
14
|
+
color: @white;
|
15
|
+
vertical-align: baseline;
|
16
|
+
white-space: nowrap;
|
17
|
+
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
18
|
+
background-color: @grayLight;
|
19
|
+
}
|
20
|
+
// Set unique padding and border-radii
|
21
|
+
.label {
|
22
|
+
.border-radius(3px);
|
23
|
+
}
|
24
|
+
.badge {
|
25
|
+
padding-left: 9px;
|
26
|
+
padding-right: 9px;
|
27
|
+
.border-radius(9px);
|
28
|
+
}
|
29
|
+
|
30
|
+
// Hover state, but only for links
|
31
|
+
a {
|
32
|
+
&.label:hover,
|
33
|
+
&.badge:hover {
|
34
|
+
color: @white;
|
35
|
+
text-decoration: none;
|
36
|
+
cursor: pointer;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
// Colors
|
41
|
+
// Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
|
42
|
+
.label,
|
43
|
+
.badge {
|
44
|
+
// Important (red)
|
45
|
+
&-important { background-color: @errorText; }
|
46
|
+
&-important[href] { background-color: darken(@errorText, 10%); }
|
47
|
+
// Warnings (orange)
|
48
|
+
&-warning { background-color: @orange; }
|
49
|
+
&-warning[href] { background-color: darken(@orange, 10%); }
|
50
|
+
// Success (green)
|
51
|
+
&-success { background-color: @successText; }
|
52
|
+
&-success[href] { background-color: darken(@successText, 10%); }
|
53
|
+
// Info (turquoise)
|
54
|
+
&-info { background-color: @infoText; }
|
55
|
+
&-info[href] { background-color: darken(@infoText, 10%); }
|
56
|
+
// Inverse (black)
|
57
|
+
&-inverse { background-color: @grayDark; }
|
58
|
+
&-inverse[href] { background-color: darken(@grayDark, 10%); }
|
59
|
+
}
|
60
|
+
|
61
|
+
// Quick fix for labels/badges in buttons
|
62
|
+
.btn {
|
63
|
+
.label,
|
64
|
+
.badge {
|
65
|
+
position: relative;
|
66
|
+
top: -1px;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
.btn-mini {
|
70
|
+
.label,
|
71
|
+
.badge {
|
72
|
+
top: 0;
|
73
|
+
}
|
74
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
//
|
2
|
+
// Layouts
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Container (centered, fixed-width layouts)
|
7
|
+
.container {
|
8
|
+
.container-fixed();
|
9
|
+
}
|
10
|
+
|
11
|
+
// Fluid layouts (left aligned, with sidebar, min- & max-width content)
|
12
|
+
.container-fluid {
|
13
|
+
padding-right: @gridGutterWidth;
|
14
|
+
padding-left: @gridGutterWidth;
|
15
|
+
.clearfix();
|
16
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
// Media objects
|
2
|
+
// Source: http://stubbornella.org/content/?p=497
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Common styles
|
7
|
+
// -------------------------
|
8
|
+
|
9
|
+
// Clear the floats
|
10
|
+
.media,
|
11
|
+
.media-body {
|
12
|
+
overflow: hidden;
|
13
|
+
*overflow: visible;
|
14
|
+
zoom: 1;
|
15
|
+
}
|
16
|
+
|
17
|
+
// Proper spacing between instances of .media
|
18
|
+
.media,
|
19
|
+
.media .media {
|
20
|
+
margin-top: 15px;
|
21
|
+
}
|
22
|
+
.media:first-child {
|
23
|
+
margin-top: 0;
|
24
|
+
}
|
25
|
+
|
26
|
+
// For images and videos, set to block
|
27
|
+
.media-object {
|
28
|
+
display: block;
|
29
|
+
}
|
30
|
+
|
31
|
+
// Reset margins on headings for tighter default spacing
|
32
|
+
.media-heading {
|
33
|
+
margin: 0 0 5px;
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
// Media image alignment
|
38
|
+
// -------------------------
|
39
|
+
|
40
|
+
.media .pull-left {
|
41
|
+
margin-right: 10px;
|
42
|
+
}
|
43
|
+
.media .pull-right {
|
44
|
+
margin-left: 10px;
|
45
|
+
}
|
46
|
+
|
47
|
+
|
48
|
+
// Media list variation
|
49
|
+
// -------------------------
|
50
|
+
|
51
|
+
// Undo default ul/ol styles
|
52
|
+
.media-list {
|
53
|
+
margin-left: 0;
|
54
|
+
list-style: none;
|
55
|
+
}
|
@@ -0,0 +1,687 @@
|
|
1
|
+
@import "mixins.less";
|
2
|
+
//
|
3
|
+
// Mixins
|
4
|
+
// --------------------------------------------------
|
5
|
+
|
6
|
+
|
7
|
+
// UTILITY MIXINS
|
8
|
+
// --------------------------------------------------
|
9
|
+
|
10
|
+
// Clearfix
|
11
|
+
// --------
|
12
|
+
// For clearing floats like a boss h5bp.com/q
|
13
|
+
.clearfix {
|
14
|
+
*zoom: 1;
|
15
|
+
&:before,
|
16
|
+
&:after {
|
17
|
+
display: table;
|
18
|
+
content: "";
|
19
|
+
// Fixes Opera/contenteditable bug:
|
20
|
+
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
|
21
|
+
line-height: 0;
|
22
|
+
}
|
23
|
+
&:after {
|
24
|
+
clear: both;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
// Webkit-style focus
|
29
|
+
// ------------------
|
30
|
+
.tab-focus() {
|
31
|
+
// Default
|
32
|
+
outline: thin dotted #333;
|
33
|
+
// Webkit
|
34
|
+
outline: 5px auto -webkit-focus-ring-color;
|
35
|
+
outline-offset: -2px;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Center-align a block level element
|
39
|
+
// ----------------------------------
|
40
|
+
.center-block() {
|
41
|
+
display: block;
|
42
|
+
margin-left: auto;
|
43
|
+
margin-right: auto;
|
44
|
+
}
|
45
|
+
|
46
|
+
// IE7 inline-block
|
47
|
+
// ----------------
|
48
|
+
.ie7-inline-block() {
|
49
|
+
*display: inline; /* IE7 inline-block hack */
|
50
|
+
*zoom: 1;
|
51
|
+
}
|
52
|
+
|
53
|
+
// IE7 likes to collapse whitespace on either side of the inline-block elements.
|
54
|
+
// Ems because we're attempting to match the width of a space character. Left
|
55
|
+
// version is for form buttons, which typically come after other elements, and
|
56
|
+
// right version is for icons, which come before. Applying both is ok, but it will
|
57
|
+
// mean that space between those elements will be .6em (~2 space characters) in IE7,
|
58
|
+
// instead of the 1 space in other browsers.
|
59
|
+
.ie7-restore-left-whitespace() {
|
60
|
+
*margin-left: .3em;
|
61
|
+
|
62
|
+
&:first-child {
|
63
|
+
*margin-left: 0;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
.ie7-restore-right-whitespace() {
|
68
|
+
*margin-right: .3em;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Sizing shortcuts
|
72
|
+
// -------------------------
|
73
|
+
.size(@height, @width) {
|
74
|
+
width: @width;
|
75
|
+
height: @height;
|
76
|
+
}
|
77
|
+
.square(@size) {
|
78
|
+
.size(@size, @size);
|
79
|
+
}
|
80
|
+
|
81
|
+
// Placeholder text
|
82
|
+
// -------------------------
|
83
|
+
.placeholder(@color: @placeholderText) {
|
84
|
+
&:-moz-placeholder {
|
85
|
+
color: @color;
|
86
|
+
}
|
87
|
+
&:-ms-input-placeholder {
|
88
|
+
color: @color;
|
89
|
+
}
|
90
|
+
&::-webkit-input-placeholder {
|
91
|
+
color: @color;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
// Text overflow
|
96
|
+
// -------------------------
|
97
|
+
// Requires inline-block or block for proper styling
|
98
|
+
.text-overflow() {
|
99
|
+
overflow: hidden;
|
100
|
+
text-overflow: ellipsis;
|
101
|
+
white-space: nowrap;
|
102
|
+
}
|
103
|
+
|
104
|
+
// CSS image replacement
|
105
|
+
// -------------------------
|
106
|
+
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
|
107
|
+
.hide-text {
|
108
|
+
font: 0/0 a;
|
109
|
+
color: transparent;
|
110
|
+
text-shadow: none;
|
111
|
+
background-color: transparent;
|
112
|
+
border: 0;
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
// FONTS
|
117
|
+
// --------------------------------------------------
|
118
|
+
|
119
|
+
#font {
|
120
|
+
#family {
|
121
|
+
.serif() {
|
122
|
+
font-family: @serifFontFamily;
|
123
|
+
}
|
124
|
+
.sans-serif() {
|
125
|
+
font-family: @sansFontFamily;
|
126
|
+
}
|
127
|
+
.monospace() {
|
128
|
+
font-family: @monoFontFamily;
|
129
|
+
}
|
130
|
+
}
|
131
|
+
.shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
132
|
+
font-size: @size;
|
133
|
+
font-weight: @weight;
|
134
|
+
line-height: @lineHeight;
|
135
|
+
}
|
136
|
+
.serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
137
|
+
#font > #family > .serif;
|
138
|
+
#font > .shorthand(@size, @weight, @lineHeight);
|
139
|
+
}
|
140
|
+
.sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
141
|
+
#font > #family > .sans-serif;
|
142
|
+
#font > .shorthand(@size, @weight, @lineHeight);
|
143
|
+
}
|
144
|
+
.monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
145
|
+
#font > #family > .monospace;
|
146
|
+
#font > .shorthand(@size, @weight, @lineHeight);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
|
151
|
+
// FORMS
|
152
|
+
// --------------------------------------------------
|
153
|
+
|
154
|
+
// Block level inputs
|
155
|
+
.input-block-level {
|
156
|
+
display: block;
|
157
|
+
width: 100%;
|
158
|
+
min-height: @inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
|
159
|
+
.box-sizing(border-box); // Makes inputs behave like true block-level elements
|
160
|
+
}
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
// Mixin for form field states
|
165
|
+
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
|
166
|
+
// Set the text color
|
167
|
+
> label,
|
168
|
+
.help-block,
|
169
|
+
.help-inline {
|
170
|
+
color: @textColor;
|
171
|
+
}
|
172
|
+
// Style inputs accordingly
|
173
|
+
.checkbox,
|
174
|
+
.radio,
|
175
|
+
input,
|
176
|
+
select,
|
177
|
+
textarea {
|
178
|
+
color: @textColor;
|
179
|
+
}
|
180
|
+
input,
|
181
|
+
select,
|
182
|
+
textarea {
|
183
|
+
border-color: @borderColor;
|
184
|
+
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
|
185
|
+
&:focus {
|
186
|
+
border-color: darken(@borderColor, 10%);
|
187
|
+
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%);
|
188
|
+
.box-shadow(@shadow);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
// Give a small background color for input-prepend/-append
|
192
|
+
.input-prepend .add-on,
|
193
|
+
.input-append .add-on {
|
194
|
+
color: @textColor;
|
195
|
+
background-color: @backgroundColor;
|
196
|
+
border-color: @textColor;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
// CSS3 PROPERTIES
|
203
|
+
// --------------------------------------------------
|
204
|
+
|
205
|
+
// Border Radius
|
206
|
+
.border-radius(@radius) {
|
207
|
+
-webkit-border-radius: @radius;
|
208
|
+
-moz-border-radius: @radius;
|
209
|
+
border-radius: @radius;
|
210
|
+
}
|
211
|
+
|
212
|
+
// Single Corner Border Radius
|
213
|
+
.border-top-left-radius(@radius) {
|
214
|
+
-webkit-border-top-left-radius: @radius;
|
215
|
+
-moz-border-radius-topleft: @radius;
|
216
|
+
border-top-left-radius: @radius;
|
217
|
+
}
|
218
|
+
.border-top-right-radius(@radius) {
|
219
|
+
-webkit-border-top-right-radius: @radius;
|
220
|
+
-moz-border-radius-topright: @radius;
|
221
|
+
border-top-right-radius: @radius;
|
222
|
+
}
|
223
|
+
.border-bottom-right-radius(@radius) {
|
224
|
+
-webkit-border-bottom-right-radius: @radius;
|
225
|
+
-moz-border-radius-bottomright: @radius;
|
226
|
+
border-bottom-right-radius: @radius;
|
227
|
+
}
|
228
|
+
.border-bottom-left-radius(@radius) {
|
229
|
+
-webkit-border-bottom-left-radius: @radius;
|
230
|
+
-moz-border-radius-bottomleft: @radius;
|
231
|
+
border-bottom-left-radius: @radius;
|
232
|
+
}
|
233
|
+
|
234
|
+
// Single Side Border Radius
|
235
|
+
.border-top-radius(@radius) {
|
236
|
+
.border-top-right-radius(@radius);
|
237
|
+
.border-top-left-radius(@radius);
|
238
|
+
}
|
239
|
+
.border-right-radius(@radius) {
|
240
|
+
.border-top-right-radius(@radius);
|
241
|
+
.border-bottom-right-radius(@radius);
|
242
|
+
}
|
243
|
+
.border-bottom-radius(@radius) {
|
244
|
+
.border-bottom-right-radius(@radius);
|
245
|
+
.border-bottom-left-radius(@radius);
|
246
|
+
}
|
247
|
+
.border-left-radius(@radius) {
|
248
|
+
.border-top-left-radius(@radius);
|
249
|
+
.border-bottom-left-radius(@radius);
|
250
|
+
}
|
251
|
+
|
252
|
+
// Drop shadows
|
253
|
+
.box-shadow(@shadow) {
|
254
|
+
-webkit-box-shadow: @shadow;
|
255
|
+
-moz-box-shadow: @shadow;
|
256
|
+
box-shadow: @shadow;
|
257
|
+
}
|
258
|
+
|
259
|
+
// Transitions
|
260
|
+
.transition(@transition) {
|
261
|
+
-webkit-transition: @transition;
|
262
|
+
-moz-transition: @transition;
|
263
|
+
-o-transition: @transition;
|
264
|
+
transition: @transition;
|
265
|
+
}
|
266
|
+
.transition-delay(@transition-delay) {
|
267
|
+
-webkit-transition-delay: @transition-delay;
|
268
|
+
-moz-transition-delay: @transition-delay;
|
269
|
+
-o-transition-delay: @transition-delay;
|
270
|
+
transition-delay: @transition-delay;
|
271
|
+
}
|
272
|
+
|
273
|
+
// Transformations
|
274
|
+
.rotate(@degrees) {
|
275
|
+
-webkit-transform: rotate(@degrees);
|
276
|
+
-moz-transform: rotate(@degrees);
|
277
|
+
-ms-transform: rotate(@degrees);
|
278
|
+
-o-transform: rotate(@degrees);
|
279
|
+
transform: rotate(@degrees);
|
280
|
+
}
|
281
|
+
.scale(@ratio) {
|
282
|
+
-webkit-transform: scale(@ratio);
|
283
|
+
-moz-transform: scale(@ratio);
|
284
|
+
-ms-transform: scale(@ratio);
|
285
|
+
-o-transform: scale(@ratio);
|
286
|
+
transform: scale(@ratio);
|
287
|
+
}
|
288
|
+
.translate(@x, @y) {
|
289
|
+
-webkit-transform: translate(@x, @y);
|
290
|
+
-moz-transform: translate(@x, @y);
|
291
|
+
-ms-transform: translate(@x, @y);
|
292
|
+
-o-transform: translate(@x, @y);
|
293
|
+
transform: translate(@x, @y);
|
294
|
+
}
|
295
|
+
.skew(@x, @y) {
|
296
|
+
-webkit-transform: skew(@x, @y);
|
297
|
+
-moz-transform: skew(@x, @y);
|
298
|
+
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885
|
299
|
+
-o-transform: skew(@x, @y);
|
300
|
+
transform: skew(@x, @y);
|
301
|
+
-webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319
|
302
|
+
}
|
303
|
+
.translate3d(@x, @y, @z) {
|
304
|
+
-webkit-transform: translate3d(@x, @y, @z);
|
305
|
+
-moz-transform: translate3d(@x, @y, @z);
|
306
|
+
-o-transform: translate3d(@x, @y, @z);
|
307
|
+
transform: translate3d(@x, @y, @z);
|
308
|
+
}
|
309
|
+
|
310
|
+
// Backface visibility
|
311
|
+
// Prevent browsers from flickering when using CSS 3D transforms.
|
312
|
+
// Default value is `visible`, but can be changed to `hidden
|
313
|
+
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
|
314
|
+
.backface-visibility(@visibility){
|
315
|
+
-webkit-backface-visibility: @visibility;
|
316
|
+
-moz-backface-visibility: @visibility;
|
317
|
+
backface-visibility: @visibility;
|
318
|
+
}
|
319
|
+
|
320
|
+
// Background clipping
|
321
|
+
// Heads up: FF 3.6 and under need "padding" instead of "padding-box"
|
322
|
+
.background-clip(@clip) {
|
323
|
+
-webkit-background-clip: @clip;
|
324
|
+
-moz-background-clip: @clip;
|
325
|
+
background-clip: @clip;
|
326
|
+
}
|
327
|
+
|
328
|
+
// Background sizing
|
329
|
+
.background-size(@size) {
|
330
|
+
-webkit-background-size: @size;
|
331
|
+
-moz-background-size: @size;
|
332
|
+
-o-background-size: @size;
|
333
|
+
background-size: @size;
|
334
|
+
}
|
335
|
+
|
336
|
+
|
337
|
+
// Box sizing
|
338
|
+
.box-sizing(@boxmodel) {
|
339
|
+
-webkit-box-sizing: @boxmodel;
|
340
|
+
-moz-box-sizing: @boxmodel;
|
341
|
+
box-sizing: @boxmodel;
|
342
|
+
}
|
343
|
+
|
344
|
+
// User select
|
345
|
+
// For selecting text on the page
|
346
|
+
.user-select(@select) {
|
347
|
+
-webkit-user-select: @select;
|
348
|
+
-moz-user-select: @select;
|
349
|
+
-ms-user-select: @select;
|
350
|
+
-o-user-select: @select;
|
351
|
+
user-select: @select;
|
352
|
+
}
|
353
|
+
|
354
|
+
// Resize anything
|
355
|
+
.resizable(@direction) {
|
356
|
+
resize: @direction; // Options: horizontal, vertical, both
|
357
|
+
overflow: auto; // Safari fix
|
358
|
+
}
|
359
|
+
|
360
|
+
// CSS3 Content Columns
|
361
|
+
.content-columns(@columnCount, @columnGap: @gridGutterWidth) {
|
362
|
+
-webkit-column-count: @columnCount;
|
363
|
+
-moz-column-count: @columnCount;
|
364
|
+
column-count: @columnCount;
|
365
|
+
-webkit-column-gap: @columnGap;
|
366
|
+
-moz-column-gap: @columnGap;
|
367
|
+
column-gap: @columnGap;
|
368
|
+
}
|
369
|
+
|
370
|
+
// Optional hyphenation
|
371
|
+
.hyphens(@mode: auto) {
|
372
|
+
word-wrap: break-word;
|
373
|
+
-webkit-hyphens: @mode;
|
374
|
+
-moz-hyphens: @mode;
|
375
|
+
-ms-hyphens: @mode;
|
376
|
+
-o-hyphens: @mode;
|
377
|
+
hyphens: @mode;
|
378
|
+
}
|
379
|
+
|
380
|
+
// Opacity
|
381
|
+
.opacity(@opacity) {
|
382
|
+
opacity: @opacity / 100;
|
383
|
+
filter: ~"alpha(opacity=@{opacity})";
|
384
|
+
}
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
// BACKGROUNDS
|
389
|
+
// --------------------------------------------------
|
390
|
+
|
391
|
+
// Add an alphatransparency value to any background or border color (via Elyse Holladay)
|
392
|
+
#translucent {
|
393
|
+
.background(@color: @white, @alpha: 1) {
|
394
|
+
background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
|
395
|
+
}
|
396
|
+
.border(@color: @white, @alpha: 1) {
|
397
|
+
border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
|
398
|
+
.background-clip(padding-box);
|
399
|
+
}
|
400
|
+
}
|
401
|
+
|
402
|
+
// Gradient Bar Colors for buttons and alerts
|
403
|
+
.gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
|
404
|
+
color: @textColor;
|
405
|
+
text-shadow: @textShadow;
|
406
|
+
#gradient > .vertical(@primaryColor, @secondaryColor);
|
407
|
+
border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
|
408
|
+
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
|
409
|
+
}
|
410
|
+
|
411
|
+
// Gradients
|
412
|
+
#gradient {
|
413
|
+
.horizontal(@startColor: #555, @endColor: #333) {
|
414
|
+
background-color: @endColor;
|
415
|
+
background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
|
416
|
+
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
|
417
|
+
background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
|
418
|
+
background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
|
419
|
+
background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10
|
420
|
+
background-repeat: repeat-x;
|
421
|
+
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down
|
422
|
+
}
|
423
|
+
.vertical(@startColor: #555, @endColor: #333) {
|
424
|
+
background-color: mix(@startColor, @endColor, 60%);
|
425
|
+
background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
|
426
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
|
427
|
+
background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
|
428
|
+
background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
|
429
|
+
background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
|
430
|
+
background-repeat: repeat-x;
|
431
|
+
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down
|
432
|
+
}
|
433
|
+
.directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
|
434
|
+
background-color: @endColor;
|
435
|
+
background-repeat: repeat-x;
|
436
|
+
background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
|
437
|
+
background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
|
438
|
+
background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
|
439
|
+
background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10
|
440
|
+
}
|
441
|
+
.vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
|
442
|
+
background-color: mix(@midColor, @endColor, 80%);
|
443
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
|
444
|
+
background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
|
445
|
+
background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
|
446
|
+
background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
|
447
|
+
background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
|
448
|
+
background-repeat: no-repeat;
|
449
|
+
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
|
450
|
+
}
|
451
|
+
.radial(@innerColor: #555, @outerColor: #333) {
|
452
|
+
background-color: @outerColor;
|
453
|
+
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
|
454
|
+
background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
|
455
|
+
background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
|
456
|
+
background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
|
457
|
+
background-repeat: no-repeat;
|
458
|
+
}
|
459
|
+
.striped(@color: #555, @angle: 45deg) {
|
460
|
+
background-color: @color;
|
461
|
+
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));
|
462
|
+
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);
|
463
|
+
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);
|
464
|
+
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);
|
465
|
+
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);
|
466
|
+
}
|
467
|
+
}
|
468
|
+
// Reset filters for IE
|
469
|
+
.reset-filter() {
|
470
|
+
filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
|
471
|
+
}
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
// COMPONENT MIXINS
|
476
|
+
// --------------------------------------------------
|
477
|
+
|
478
|
+
// Horizontal dividers
|
479
|
+
// -------------------------
|
480
|
+
// Dividers (basically an hr) within dropdowns and nav lists
|
481
|
+
.nav-divider(@top: #e5e5e5, @bottom: @white) {
|
482
|
+
// IE7 needs a set width since we gave a height. Restricting just
|
483
|
+
// to IE7 to keep the 1px left/right space in other browsers.
|
484
|
+
// It is unclear where IE is getting the extra space that we need
|
485
|
+
// to negative-margin away, but so it goes.
|
486
|
+
*width: 100%;
|
487
|
+
height: 1px;
|
488
|
+
margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px
|
489
|
+
*margin: -5px 0 5px;
|
490
|
+
overflow: hidden;
|
491
|
+
background-color: @top;
|
492
|
+
border-bottom: 1px solid @bottom;
|
493
|
+
}
|
494
|
+
|
495
|
+
// Button backgrounds
|
496
|
+
// ------------------
|
497
|
+
.buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
|
498
|
+
// gradientBar will set the background to a pleasing blend of these, to support IE<=9
|
499
|
+
.gradientBar(@startColor, @endColor, @textColor, @textShadow);
|
500
|
+
*background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
501
|
+
.reset-filter();
|
502
|
+
|
503
|
+
// in these cases the gradient won't cover the background, so we override
|
504
|
+
&:hover, &:active, &.active, &.disabled, &[disabled] {
|
505
|
+
color: @textColor;
|
506
|
+
background-color: @endColor;
|
507
|
+
*background-color: darken(@endColor, 5%);
|
508
|
+
}
|
509
|
+
|
510
|
+
// IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
|
511
|
+
&:active,
|
512
|
+
&.active {
|
513
|
+
background-color: darken(@endColor, 10%) e("\9");
|
514
|
+
}
|
515
|
+
}
|
516
|
+
|
517
|
+
// Navbar vertical align
|
518
|
+
// -------------------------
|
519
|
+
// Vertically center elements in the navbar.
|
520
|
+
// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
|
521
|
+
.navbarVerticalAlign(@elementHeight) {
|
522
|
+
margin-top: (@navbarHeight - @elementHeight) / 2;
|
523
|
+
}
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
// Grid System
|
528
|
+
// -----------
|
529
|
+
|
530
|
+
// Centered container element
|
531
|
+
.container-fixed() {
|
532
|
+
margin-right: auto;
|
533
|
+
margin-left: auto;
|
534
|
+
.clearfix();
|
535
|
+
}
|
536
|
+
|
537
|
+
// Table columns
|
538
|
+
.tableColumns(@columnSpan: 1) {
|
539
|
+
float: none; // undo default grid column styles
|
540
|
+
width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
|
541
|
+
margin-left: 0; // undo default grid column styles
|
542
|
+
}
|
543
|
+
|
544
|
+
// Make a Grid
|
545
|
+
// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
|
546
|
+
.makeRow() {
|
547
|
+
margin-left: @gridGutterWidth * -1;
|
548
|
+
.clearfix();
|
549
|
+
}
|
550
|
+
.makeColumn(@columns: 1, @offset: 0) {
|
551
|
+
float: left;
|
552
|
+
margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
|
553
|
+
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
554
|
+
}
|
555
|
+
|
556
|
+
// The Grid
|
557
|
+
#grid {
|
558
|
+
|
559
|
+
.core (@gridColumnWidth, @gridGutterWidth) {
|
560
|
+
|
561
|
+
.spanX (@index) when (@index > 0) {
|
562
|
+
(~".span@{index}") { .span(@index); }
|
563
|
+
.spanX(@index - 1);
|
564
|
+
}
|
565
|
+
.spanX (0) {}
|
566
|
+
|
567
|
+
.offsetX (@index) when (@index > 0) {
|
568
|
+
(~".offset@{index}") { .offset(@index); }
|
569
|
+
.offsetX(@index - 1);
|
570
|
+
}
|
571
|
+
.offsetX (0) {}
|
572
|
+
|
573
|
+
.offset (@columns) {
|
574
|
+
margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
|
575
|
+
}
|
576
|
+
|
577
|
+
.span (@columns) {
|
578
|
+
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
579
|
+
}
|
580
|
+
|
581
|
+
.row {
|
582
|
+
margin-left: @gridGutterWidth * -1;
|
583
|
+
.clearfix();
|
584
|
+
}
|
585
|
+
|
586
|
+
[class*="span"] {
|
587
|
+
float: left;
|
588
|
+
min-height: 1px; // prevent collapsing columns
|
589
|
+
margin-left: @gridGutterWidth;
|
590
|
+
}
|
591
|
+
|
592
|
+
// Set the container width, and override it for fixed navbars in media queries
|
593
|
+
.container,
|
594
|
+
.navbar-static-top .container,
|
595
|
+
.navbar-fixed-top .container,
|
596
|
+
.navbar-fixed-bottom .container { .span(@gridColumns); }
|
597
|
+
|
598
|
+
// generate .spanX and .offsetX
|
599
|
+
.spanX (@gridColumns);
|
600
|
+
.offsetX (@gridColumns);
|
601
|
+
|
602
|
+
}
|
603
|
+
|
604
|
+
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
|
605
|
+
|
606
|
+
.spanX (@index) when (@index > 0) {
|
607
|
+
(~".span@{index}") { .span(@index); }
|
608
|
+
.spanX(@index - 1);
|
609
|
+
}
|
610
|
+
.spanX (0) {}
|
611
|
+
|
612
|
+
.offsetX (@index) when (@index > 0) {
|
613
|
+
(~'.offset@{index}') { .offset(@index); }
|
614
|
+
(~'.offset@{index}:first-child') { .offsetFirstChild(@index); }
|
615
|
+
.offsetX(@index - 1);
|
616
|
+
}
|
617
|
+
.offsetX (0) {}
|
618
|
+
|
619
|
+
.offset (@columns) {
|
620
|
+
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2);
|
621
|
+
*margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%);
|
622
|
+
}
|
623
|
+
|
624
|
+
.offsetFirstChild (@columns) {
|
625
|
+
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth);
|
626
|
+
*margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
|
627
|
+
}
|
628
|
+
|
629
|
+
.span (@columns) {
|
630
|
+
width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
|
631
|
+
*width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%);
|
632
|
+
}
|
633
|
+
|
634
|
+
.row-fluid {
|
635
|
+
width: 100%;
|
636
|
+
.clearfix();
|
637
|
+
[class*="span"] {
|
638
|
+
.input-block-level();
|
639
|
+
float: left;
|
640
|
+
margin-left: @fluidGridGutterWidth;
|
641
|
+
*margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
|
642
|
+
}
|
643
|
+
[class*="span"]:first-child {
|
644
|
+
margin-left: 0;
|
645
|
+
}
|
646
|
+
|
647
|
+
// Space grid-sized controls properly if multiple per line
|
648
|
+
.controls-row [class*="span"] + [class*="span"] {
|
649
|
+
margin-left: @fluidGridGutterWidth;
|
650
|
+
}
|
651
|
+
|
652
|
+
// generate .spanX and .offsetX
|
653
|
+
.spanX (@gridColumns);
|
654
|
+
.offsetX (@gridColumns);
|
655
|
+
}
|
656
|
+
|
657
|
+
}
|
658
|
+
|
659
|
+
.input(@gridColumnWidth, @gridGutterWidth) {
|
660
|
+
|
661
|
+
.spanX (@index) when (@index > 0) {
|
662
|
+
(~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
|
663
|
+
.spanX(@index - 1);
|
664
|
+
}
|
665
|
+
.spanX (0) {}
|
666
|
+
|
667
|
+
.span(@columns) {
|
668
|
+
width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14;
|
669
|
+
}
|
670
|
+
|
671
|
+
input,
|
672
|
+
textarea,
|
673
|
+
.uneditable-input {
|
674
|
+
margin-left: 0; // override margin-left from core grid system
|
675
|
+
}
|
676
|
+
|
677
|
+
// Space grid-sized controls properly if multiple per line
|
678
|
+
.controls-row [class*="span"] + [class*="span"] {
|
679
|
+
margin-left: @gridGutterWidth;
|
680
|
+
}
|
681
|
+
|
682
|
+
// generate .spanX
|
683
|
+
.spanX (@gridColumns);
|
684
|
+
|
685
|
+
}
|
686
|
+
|
687
|
+
}
|