spiderfw 0.6.30 → 0.6.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +15 -7
  2. data/CHANGELOG +11 -0
  3. data/VERSION +1 -1
  4. data/apps/app_server/config/options.rb +1 -1
  5. data/apps/core/auth/controllers/login_controller.rb +3 -0
  6. data/apps/core/components/assets.rb +61 -3
  7. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.eot +0 -0
  8. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.svg +229 -0
  9. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.ttf +0 -0
  10. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff +0 -0
  11. data/apps/core/components/public/bootstrap_3/js/affix.js +140 -0
  12. data/apps/core/components/public/bootstrap_3/js/alert.js +92 -0
  13. data/apps/core/components/public/bootstrap_3/js/button.js +110 -0
  14. data/apps/core/components/public/bootstrap_3/js/carousel.js +210 -0
  15. data/apps/core/components/public/bootstrap_3/js/collapse.js +180 -0
  16. data/apps/core/components/public/bootstrap_3/js/dropdown.js +151 -0
  17. data/apps/core/components/public/bootstrap_3/js/modal.js +277 -0
  18. data/apps/core/components/public/bootstrap_3/js/popover.js +113 -0
  19. data/apps/core/components/public/bootstrap_3/js/scrollspy.js +158 -0
  20. data/apps/core/components/public/bootstrap_3/js/tab.js +128 -0
  21. data/apps/core/components/public/bootstrap_3/js/tooltip.js +456 -0
  22. data/apps/core/components/public/bootstrap_3/js/transition.js +48 -0
  23. data/apps/core/components/public/bootstrap_3/scss/_alerts.scss +67 -0
  24. data/apps/core/components/public/bootstrap_3/scss/_badges.scss +57 -0
  25. data/apps/core/components/public/bootstrap_3/scss/_breadcrumbs.scss +26 -0
  26. data/apps/core/components/public/bootstrap_3/scss/_button-groups.scss +240 -0
  27. data/apps/core/components/public/bootstrap_3/scss/_buttons.scss +159 -0
  28. data/apps/core/components/public/bootstrap_3/scss/_carousel.scss +243 -0
  29. data/apps/core/components/public/bootstrap_3/scss/_close.scss +35 -0
  30. data/apps/core/components/public/bootstrap_3/scss/_code.scss +62 -0
  31. data/apps/core/components/public/bootstrap_3/scss/_component-animations.scss +35 -0
  32. data/apps/core/components/public/bootstrap_3/scss/_dropdowns.scss +214 -0
  33. data/apps/core/components/public/bootstrap_3/scss/_forms.scss +489 -0
  34. data/apps/core/components/public/bootstrap_3/scss/_glyphicons.scss +237 -0
  35. data/apps/core/components/public/bootstrap_3/scss/_grid.scss +84 -0
  36. data/apps/core/components/public/bootstrap_3/scss/_input-groups.scss +166 -0
  37. data/apps/core/components/public/bootstrap_3/scss/_jumbotron.scss +48 -0
  38. data/apps/core/components/public/bootstrap_3/scss/_labels.scss +66 -0
  39. data/apps/core/components/public/bootstrap_3/scss/_list-group.scss +129 -0
  40. data/apps/core/components/public/bootstrap_3/scss/_media.scss +56 -0
  41. data/apps/core/components/public/bootstrap_3/scss/_mixins.scss +39 -0
  42. data/apps/core/components/public/bootstrap_3/scss/_modals.scss +147 -0
  43. data/apps/core/components/public/bootstrap_3/scss/_navbar.scss +658 -0
  44. data/apps/core/components/public/bootstrap_3/scss/_navs.scss +242 -0
  45. data/apps/core/components/public/bootstrap_3/scss/_normalize.scss +425 -0
  46. data/apps/core/components/public/bootstrap_3/scss/_pager.scss +55 -0
  47. data/apps/core/components/public/bootstrap_3/scss/_pagination.scss +88 -0
  48. data/apps/core/components/public/bootstrap_3/scss/_panels.scss +240 -0
  49. data/apps/core/components/public/bootstrap_3/scss/_popovers.scss +133 -0
  50. data/apps/core/components/public/bootstrap_3/scss/_print.scss +101 -0
  51. data/apps/core/components/public/bootstrap_3/scss/_progress-bars.scss +89 -0
  52. data/apps/core/components/public/bootstrap_3/scss/_responsive-embed.scss +34 -0
  53. data/apps/core/components/public/bootstrap_3/scss/_responsive-utilities.scss +174 -0
  54. data/apps/core/components/public/bootstrap_3/scss/_scaffolding.scss +150 -0
  55. data/apps/core/components/public/bootstrap_3/scss/_tables.scss +233 -0
  56. data/apps/core/components/public/bootstrap_3/scss/_theme.scss +247 -0
  57. data/apps/core/components/public/bootstrap_3/scss/_thumbnails.scss +38 -0
  58. data/apps/core/components/public/bootstrap_3/scss/_tooltip.scss +95 -0
  59. data/apps/core/components/public/bootstrap_3/scss/_type.scss +298 -0
  60. data/apps/core/components/public/bootstrap_3/scss/_utilities.scss +56 -0
  61. data/apps/core/components/public/bootstrap_3/scss/_variables.scss +853 -0
  62. data/apps/core/components/public/bootstrap_3/scss/_wells.scss +29 -0
  63. data/apps/core/components/public/bootstrap_3/scss/bootstrap.scss +50 -0
  64. data/apps/core/components/public/bootstrap_3/scss/mixins/_alerts.scss +14 -0
  65. data/apps/core/components/public/bootstrap_3/scss/mixins/_background-variant.scss +11 -0
  66. data/apps/core/components/public/bootstrap_3/scss/mixins/_border-radius.scss +18 -0
  67. data/apps/core/components/public/bootstrap_3/scss/mixins/_buttons.scss +50 -0
  68. data/apps/core/components/public/bootstrap_3/scss/mixins/_center-block.scss +7 -0
  69. data/apps/core/components/public/bootstrap_3/scss/mixins/_clearfix.scss +22 -0
  70. data/apps/core/components/public/bootstrap_3/scss/mixins/_forms.scss +84 -0
  71. data/apps/core/components/public/bootstrap_3/scss/mixins/_gradients.scss +58 -0
  72. data/apps/core/components/public/bootstrap_3/scss/mixins/_grid-framework.scss +87 -0
  73. data/apps/core/components/public/bootstrap_3/scss/mixins/_grid.scss +122 -0
  74. data/apps/core/components/public/bootstrap_3/scss/mixins/_hide-text.scss +21 -0
  75. data/apps/core/components/public/bootstrap_3/scss/mixins/_image.scss +33 -0
  76. data/apps/core/components/public/bootstrap_3/scss/mixins/_labels.scss +12 -0
  77. data/apps/core/components/public/bootstrap_3/scss/mixins/_list-group.scss +31 -0
  78. data/apps/core/components/public/bootstrap_3/scss/mixins/_nav-divider.scss +10 -0
  79. data/apps/core/components/public/bootstrap_3/scss/mixins/_nav-vertical-align.scss +9 -0
  80. data/apps/core/components/public/bootstrap_3/scss/mixins/_opacity.scss +8 -0
  81. data/apps/core/components/public/bootstrap_3/scss/mixins/_pagination.scss +23 -0
  82. data/apps/core/components/public/bootstrap_3/scss/mixins/_panels.scss +20 -0
  83. data/apps/core/components/public/bootstrap_3/scss/mixins/_progress-bar.scss +8 -0
  84. data/apps/core/components/public/bootstrap_3/scss/mixins/_reset-filter.scss +8 -0
  85. data/apps/core/components/public/bootstrap_3/scss/mixins/_resize.scss +6 -0
  86. data/apps/core/components/public/bootstrap_3/scss/mixins/_responsive-visibility.scss +21 -0
  87. data/apps/core/components/public/bootstrap_3/scss/mixins/_size.scss +10 -0
  88. data/apps/core/components/public/bootstrap_3/scss/mixins/_tab-focus.scss +9 -0
  89. data/apps/core/components/public/bootstrap_3/scss/mixins/_table-row.scss +28 -0
  90. data/apps/core/components/public/bootstrap_3/scss/mixins/_text-emphasis.scss +11 -0
  91. data/apps/core/components/public/bootstrap_3/scss/mixins/_text-overflow.scss +8 -0
  92. data/apps/core/components/public/bootstrap_3/scss/mixins/_vendor-prefixes.scss +224 -0
  93. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +1 -1
  94. data/apps/core/components/widgets/month_calendar/month_calendar.shtml +3 -3
  95. data/apps/core/components/widgets/table/table.rb +6 -2
  96. data/apps/core/components/widgets/table/table.shtml +4 -4
  97. data/apps/core/forms/widgets/form/form.rb +1 -1
  98. data/apps/core/forms/widgets/inputs/select/select.rb +13 -2
  99. data/apps/messenger/lib/backends/mobyt.rb +6 -2
  100. data/apps/messenger/lib/backends/skebby.rb +1 -1
  101. data/apps/webdav/controllers/webdav_controller.rb +16 -7
  102. data/lib/spiderfw/controller/http_controller.rb +4 -1
  103. data/lib/spiderfw/env.rb +0 -1
  104. data/lib/spiderfw/http/adapters/rack.rb +3 -1
  105. data/lib/spiderfw/model/base_model.rb +7 -3
  106. data/lib/spiderfw/model/storage/connection_pool.rb +6 -2
  107. data/lib/spiderfw/model/storage/db/db_storage.rb +25 -9
  108. data/lib/spiderfw/site.rb +1 -1
  109. metadata +308 -149
@@ -0,0 +1,29 @@
1
+ //
2
+ // Wells
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base class
7
+ .well {
8
+ min-height: 20px;
9
+ padding: 19px;
10
+ margin-bottom: 20px;
11
+ background-color: $well-bg;
12
+ border: 1px solid $well-border;
13
+ border-radius: $border-radius-base;
14
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
15
+ blockquote {
16
+ border-color: #ddd;
17
+ border-color: rgba(0,0,0,.15);
18
+ }
19
+ }
20
+
21
+ // Sizes
22
+ .well-lg {
23
+ padding: 24px;
24
+ border-radius: $border-radius-large;
25
+ }
26
+ .well-sm {
27
+ padding: 9px;
28
+ border-radius: $border-radius-small;
29
+ }
@@ -0,0 +1,50 @@
1
+ // Core variables and mixins
2
+ @import "variables";
3
+ @import "mixins";
4
+
5
+ // Reset and dependencies
6
+ @import "normalize";
7
+ @import "print";
8
+ @import "glyphicons";
9
+
10
+ // Core CSS
11
+ @import "scaffolding";
12
+ @import "type";
13
+ @import "code";
14
+ @import "grid";
15
+ @import "tables";
16
+ @import "forms";
17
+ @import "buttons";
18
+
19
+ // Components
20
+ @import "component-animations";
21
+ @import "dropdowns";
22
+ @import "button-groups";
23
+ @import "input-groups";
24
+ @import "navs";
25
+ @import "navbar";
26
+ @import "breadcrumbs";
27
+ @import "pagination";
28
+ @import "pager";
29
+ @import "labels";
30
+ @import "badges";
31
+ @import "jumbotron";
32
+ @import "thumbnails";
33
+ @import "alerts";
34
+ @import "progress-bars";
35
+ @import "media";
36
+ @import "list-group";
37
+ @import "panels";
38
+ @import "responsive-embed";
39
+ @import "wells";
40
+ @import "close";
41
+
42
+ // Components w/ JavaScript
43
+ @import "modals";
44
+ @import "tooltip";
45
+ @import "popovers";
46
+ @import "carousel";
47
+
48
+ // Utility classes
49
+ @import "utilities";
50
+ @import "responsive-utilities";
@@ -0,0 +1,14 @@
1
+ // Alerts
2
+
3
+ @mixin alert-variant($background, $border, $text-color) {
4
+ background-color: $background;
5
+ border-color: $border;
6
+ color: $text-color;
7
+
8
+ hr {
9
+ border-top-color: darken($border, 5%);
10
+ }
11
+ .alert-link {
12
+ color: darken($text-color, 10%);
13
+ }
14
+ }
@@ -0,0 +1,11 @@
1
+ // Contextual backgrounds
2
+
3
+ // [converter] $parent hack
4
+ @mixin bg-variant($parent, $color) {
5
+ #{$parent} {
6
+ background-color: $color;
7
+ }
8
+ a#{$parent}:hover {
9
+ background-color: darken($color, 10%);
10
+ }
11
+ }
@@ -0,0 +1,18 @@
1
+ // Single side border-radius
2
+
3
+ @mixin border-top-radius($radius) {
4
+ border-top-right-radius: $radius;
5
+ border-top-left-radius: $radius;
6
+ }
7
+ @mixin border-right-radius($radius) {
8
+ border-bottom-right-radius: $radius;
9
+ border-top-right-radius: $radius;
10
+ }
11
+ @mixin border-bottom-radius($radius) {
12
+ border-bottom-right-radius: $radius;
13
+ border-bottom-left-radius: $radius;
14
+ }
15
+ @mixin border-left-radius($radius) {
16
+ border-bottom-left-radius: $radius;
17
+ border-top-left-radius: $radius;
18
+ }
@@ -0,0 +1,50 @@
1
+ // Button variants
2
+ //
3
+ // Easily pump out default styles, as well as :hover, :focus, :active,
4
+ // and disabled options for all buttons
5
+
6
+ @mixin button-variant($color, $background, $border) {
7
+ color: $color;
8
+ background-color: $background;
9
+ border-color: $border;
10
+
11
+ &:hover,
12
+ &:focus,
13
+ &:active,
14
+ &.active,
15
+ .open > &.dropdown-toggle {
16
+ color: $color;
17
+ background-color: darken($background, 10%);
18
+ border-color: darken($border, 12%);
19
+ }
20
+ &:active,
21
+ &.active,
22
+ .open > &.dropdown-toggle {
23
+ background-image: none;
24
+ }
25
+ &.disabled,
26
+ &[disabled],
27
+ fieldset[disabled] & {
28
+ &,
29
+ &:hover,
30
+ &:focus,
31
+ &:active,
32
+ &.active {
33
+ background-color: $background;
34
+ border-color: $border;
35
+ }
36
+ }
37
+
38
+ .badge {
39
+ color: $background;
40
+ background-color: $color;
41
+ }
42
+ }
43
+
44
+ // Button sizes
45
+ @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
46
+ padding: $padding-vertical $padding-horizontal;
47
+ font-size: $font-size;
48
+ line-height: $line-height;
49
+ border-radius: $border-radius;
50
+ }
@@ -0,0 +1,7 @@
1
+ // Center-align a block level element
2
+
3
+ @mixin center-block() {
4
+ display: block;
5
+ margin-left: auto;
6
+ margin-right: auto;
7
+ }
@@ -0,0 +1,22 @@
1
+ // Clearfix
2
+ //
3
+ // For modern browsers
4
+ // 1. The space content is one way to avoid an Opera bug when the
5
+ // contenteditable attribute is included anywhere else in the document.
6
+ // Otherwise it causes space to appear at the top and bottom of elements
7
+ // that are clearfixed.
8
+ // 2. The use of `table` rather than `block` is only necessary if using
9
+ // `:before` to contain the top-margins of child elements.
10
+ //
11
+ // Source: http://nicolasgallagher.com/micro-clearfix-hack/
12
+
13
+ @mixin clearfix() {
14
+ &:before,
15
+ &:after {
16
+ content: " "; // 1
17
+ display: table; // 2
18
+ }
19
+ &:after {
20
+ clear: both;
21
+ }
22
+ }
@@ -0,0 +1,84 @@
1
+ // Form validation states
2
+ //
3
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
4
+ // and successes.
5
+
6
+ @mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) {
7
+ // Color the label and help text
8
+ .help-block,
9
+ .control-label,
10
+ .radio,
11
+ .checkbox,
12
+ .radio-inline,
13
+ .checkbox-inline {
14
+ color: $text-color;
15
+ }
16
+ // Set the border and box shadow on specific inputs to match
17
+ .form-control {
18
+ border-color: $border-color;
19
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
20
+ &:focus {
21
+ border-color: darken($border-color, 10%);
22
+ $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
23
+ @include box-shadow($shadow);
24
+ }
25
+ }
26
+ // Set validation states also for addons
27
+ .input-group-addon {
28
+ color: $text-color;
29
+ border-color: $border-color;
30
+ background-color: $background-color;
31
+ }
32
+ // Optional feedback icon
33
+ .form-control-feedback {
34
+ color: $text-color;
35
+ }
36
+ }
37
+
38
+
39
+ // Form control focus state
40
+ //
41
+ // Generate a customized focus state and for any input with the specified color,
42
+ // which defaults to the `$input-border-focus` variable.
43
+ //
44
+ // We highly encourage you to not customize the default value, but instead use
45
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
46
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
47
+ // usability and accessibility should be taken into account with any change.
48
+ //
49
+ // Example usage: change the default blue border and shadow to white for better
50
+ // contrast against a dark gray background.
51
+ @mixin form-control-focus($color: $input-border-focus) {
52
+ $color-rgba: rgba(red($color), green($color), blue($color), .6);
53
+ &:focus {
54
+ border-color: $color;
55
+ outline: 0;
56
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
57
+ }
58
+ }
59
+
60
+ // Form control sizing
61
+ //
62
+ // Relative text size, padding, and border-radii changes for form controls. For
63
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
64
+ // element gets special love because it's special, and that's a fact!
65
+ // [converter] $parent hack
66
+ @mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
67
+ #{$parent} {
68
+ height: $input-height;
69
+ padding: $padding-vertical $padding-horizontal;
70
+ font-size: $font-size;
71
+ line-height: $line-height;
72
+ border-radius: $border-radius;
73
+ }
74
+
75
+ select#{$parent} {
76
+ height: $input-height;
77
+ line-height: $input-height;
78
+ }
79
+
80
+ textarea#{$parent},
81
+ select[multiple]#{$parent} {
82
+ height: auto;
83
+ }
84
+ }
@@ -0,0 +1,58 @@
1
+ // Gradients
2
+
3
+
4
+
5
+ // Horizontal gradient, from left to right
6
+ //
7
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
8
+ // Color stops are not available in IE9 and below.
9
+ @mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
10
+ background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1-6, Chrome 10+
11
+ background-image: -o-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // Opera 12
12
+ 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+
13
+ background-repeat: repeat-x;
14
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
15
+ }
16
+
17
+ // Vertical gradient, from top to bottom
18
+ //
19
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
20
+ // Color stops are not available in IE9 and below.
21
+ @mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
22
+ background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+
23
+ background-image: -o-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Opera 12
24
+ 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+
25
+ background-repeat: repeat-x;
26
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
27
+ }
28
+
29
+ @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
30
+ background-repeat: repeat-x;
31
+ background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+
32
+ background-image: -o-linear-gradient($deg, $start-color, $end-color); // Opera 12
33
+ background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
34
+ }
35
+ @mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
36
+ background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
37
+ background-image: -o-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
38
+ background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
39
+ background-repeat: no-repeat;
40
+ 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
41
+ }
42
+ @mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
43
+ background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
44
+ background-image: -o-linear-gradient($start-color, $mid-color $color-stop, $end-color);
45
+ background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
46
+ background-repeat: no-repeat;
47
+ 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
48
+ }
49
+ @mixin gradient-radial($inner-color: #555, $outer-color: #333) {
50
+ background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
51
+ background-image: radial-gradient(circle, $inner-color, $outer-color);
52
+ background-repeat: no-repeat;
53
+ }
54
+ @mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) {
55
+ background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
56
+ background-image: -o-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
57
+ background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
58
+ }
@@ -0,0 +1,87 @@
1
+ // Framework grid generation
2
+ //
3
+ // Used only by Bootstrap to generate the correct number of grid classes given
4
+ // any value of `$grid-columns`.
5
+
6
+ // [converter] This is defined recursively in LESS, but Sass supports real loops
7
+ @mixin make-grid-columns() {
8
+ $list: '';
9
+ $i: 1;
10
+ $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
11
+ @for $i from (1 + 1) through $grid-columns {
12
+ $list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
13
+ }
14
+ #{$list} {
15
+ position: relative;
16
+ // Prevent columns from collapsing when empty
17
+ min-height: 1px;
18
+ // Inner gutter via padding
19
+ padding-left: ($grid-gutter-width / 2);
20
+ padding-right: ($grid-gutter-width / 2);
21
+ }
22
+ }
23
+
24
+
25
+ // [converter] This is defined recursively in LESS, but Sass supports real loops
26
+ @mixin float-grid-columns($class) {
27
+ $list: '';
28
+ $i: 1;
29
+ $list: ".col-#{$class}-#{$i}";
30
+ @for $i from (1 + 1) through $grid-columns {
31
+ $list: "#{$list}, .col-#{$class}-#{$i}";
32
+ }
33
+ #{$list} {
34
+ float: left;
35
+ }
36
+ }
37
+
38
+
39
+ @mixin calc-grid-column($index, $class, $type) {
40
+ @if ($type == width) and ($index > 0) {
41
+ .col-#{$class}-#{$index} {
42
+ width: percentage(($index / $grid-columns));
43
+ }
44
+ }
45
+ @if ($type == push) and ($index > 0) {
46
+ .col-#{$class}-push-#{$index} {
47
+ left: percentage(($index / $grid-columns));
48
+ }
49
+ }
50
+ @if ($type == push) and ($index == 0) {
51
+ .col-#{$class}-push-0 {
52
+ left: auto;
53
+ }
54
+ }
55
+ @if ($type == pull) and ($index > 0) {
56
+ .col-#{$class}-pull-#{$index} {
57
+ right: percentage(($index / $grid-columns));
58
+ }
59
+ }
60
+ @if ($type == pull) and ($index == 0) {
61
+ .col-#{$class}-pull-0 {
62
+ right: auto;
63
+ }
64
+ }
65
+ @if ($type == offset) {
66
+ .col-#{$class}-offset-#{$index} {
67
+ margin-left: percentage(($index / $grid-columns));
68
+ }
69
+ }
70
+ }
71
+
72
+ // [converter] This is defined recursively in LESS, but Sass supports real loops
73
+ @mixin loop-grid-columns($columns, $class, $type) {
74
+ @for $i from 0 through $columns {
75
+ @include calc-grid-column($i, $class, $type);
76
+ }
77
+ }
78
+
79
+
80
+ // Create grid for specific class
81
+ @mixin make-grid($class) {
82
+ @include float-grid-columns($class);
83
+ @include loop-grid-columns($grid-columns, $class, width);
84
+ @include loop-grid-columns($grid-columns, $class, pull);
85
+ @include loop-grid-columns($grid-columns, $class, push);
86
+ @include loop-grid-columns($grid-columns, $class, offset);
87
+ }
@@ -0,0 +1,122 @@
1
+ // Grid system
2
+ //
3
+ // Generate semantic grid columns with these mixins.
4
+
5
+ // Centered container element
6
+ @mixin container-fixed() {
7
+ margin-right: auto;
8
+ margin-left: auto;
9
+ padding-left: ($grid-gutter-width / 2);
10
+ padding-right: ($grid-gutter-width / 2);
11
+ @include clearfix();
12
+ }
13
+
14
+ // Creates a wrapper for a series of columns
15
+ @mixin make-row($gutter: $grid-gutter-width) {
16
+ margin-left: ($gutter / -2);
17
+ margin-right: ($gutter / -2);
18
+ @include clearfix();
19
+ }
20
+
21
+ // Generate the extra small columns
22
+ @mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
23
+ position: relative;
24
+ float: left;
25
+ width: percentage(($columns / $grid-columns));
26
+ min-height: 1px;
27
+ padding-left: ($gutter / 2);
28
+ padding-right: ($gutter / 2);
29
+ }
30
+ @mixin make-xs-column-offset($columns) {
31
+ margin-left: percentage(($columns / $grid-columns));
32
+ }
33
+ @mixin make-xs-column-push($columns) {
34
+ left: percentage(($columns / $grid-columns));
35
+ }
36
+ @mixin make-xs-column-pull($columns) {
37
+ right: percentage(($columns / $grid-columns));
38
+ }
39
+
40
+ // Generate the small columns
41
+ @mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
42
+ position: relative;
43
+ min-height: 1px;
44
+ padding-left: ($gutter / 2);
45
+ padding-right: ($gutter / 2);
46
+
47
+ @media (min-width: $screen-sm-min) {
48
+ float: left;
49
+ width: percentage(($columns / $grid-columns));
50
+ }
51
+ }
52
+ @mixin make-sm-column-offset($columns) {
53
+ @media (min-width: $screen-sm-min) {
54
+ margin-left: percentage(($columns / $grid-columns));
55
+ }
56
+ }
57
+ @mixin make-sm-column-push($columns) {
58
+ @media (min-width: $screen-sm-min) {
59
+ left: percentage(($columns / $grid-columns));
60
+ }
61
+ }
62
+ @mixin make-sm-column-pull($columns) {
63
+ @media (min-width: $screen-sm-min) {
64
+ right: percentage(($columns / $grid-columns));
65
+ }
66
+ }
67
+
68
+ // Generate the medium columns
69
+ @mixin make-md-column($columns, $gutter: $grid-gutter-width) {
70
+ position: relative;
71
+ min-height: 1px;
72
+ padding-left: ($gutter / 2);
73
+ padding-right: ($gutter / 2);
74
+
75
+ @media (min-width: $screen-md-min) {
76
+ float: left;
77
+ width: percentage(($columns / $grid-columns));
78
+ }
79
+ }
80
+ @mixin make-md-column-offset($columns) {
81
+ @media (min-width: $screen-md-min) {
82
+ margin-left: percentage(($columns / $grid-columns));
83
+ }
84
+ }
85
+ @mixin make-md-column-push($columns) {
86
+ @media (min-width: $screen-md-min) {
87
+ left: percentage(($columns / $grid-columns));
88
+ }
89
+ }
90
+ @mixin make-md-column-pull($columns) {
91
+ @media (min-width: $screen-md-min) {
92
+ right: percentage(($columns / $grid-columns));
93
+ }
94
+ }
95
+
96
+ // Generate the large columns
97
+ @mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
98
+ position: relative;
99
+ min-height: 1px;
100
+ padding-left: ($gutter / 2);
101
+ padding-right: ($gutter / 2);
102
+
103
+ @media (min-width: $screen-lg-min) {
104
+ float: left;
105
+ width: percentage(($columns / $grid-columns));
106
+ }
107
+ }
108
+ @mixin make-lg-column-offset($columns) {
109
+ @media (min-width: $screen-lg-min) {
110
+ margin-left: percentage(($columns / $grid-columns));
111
+ }
112
+ }
113
+ @mixin make-lg-column-push($columns) {
114
+ @media (min-width: $screen-lg-min) {
115
+ left: percentage(($columns / $grid-columns));
116
+ }
117
+ }
118
+ @mixin make-lg-column-pull($columns) {
119
+ @media (min-width: $screen-lg-min) {
120
+ right: percentage(($columns / $grid-columns));
121
+ }
122
+ }
@@ -0,0 +1,21 @@
1
+ // CSS image replacement
2
+ //
3
+ // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
4
+ // mixins being reused as classes with the same name, this doesn't hold up. As
5
+ // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.
6
+ //
7
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
8
+
9
+ // Deprecated as of v3.0.1 (will be removed in v4)
10
+ @mixin hide-text() {
11
+ font: #{0/0} a;
12
+ color: transparent;
13
+ text-shadow: none;
14
+ background-color: transparent;
15
+ border: 0;
16
+ }
17
+
18
+ // New mixin to use as of v3.0.1
19
+ @mixin text-hide() {
20
+ @include hide-text();
21
+ }
@@ -0,0 +1,33 @@
1
+ // Image Mixins
2
+ // - Responsive image
3
+ // - Retina image
4
+
5
+
6
+ // Responsive image
7
+ //
8
+ // Keep images from scaling beyond the width of their parents.
9
+ @mixin img-responsive($display: block) {
10
+ display: $display;
11
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
12
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
13
+ }
14
+
15
+
16
+ // Retina image
17
+ //
18
+ // Short retina mixin for setting background-image and -size. Note that the
19
+ // spelling of `min--moz-device-pixel-ratio` is intentional.
20
+ @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
21
+ background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}"));
22
+
23
+ @media
24
+ only screen and (-webkit-min-device-pixel-ratio: 2),
25
+ only screen and ( min--moz-device-pixel-ratio: 2),
26
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
27
+ only screen and ( min-device-pixel-ratio: 2),
28
+ only screen and ( min-resolution: 192dpi),
29
+ only screen and ( min-resolution: 2dppx) {
30
+ background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}"));
31
+ background-size: $width-1x $height-1x;
32
+ }
33
+ }
@@ -0,0 +1,12 @@
1
+ // Labels
2
+
3
+ @mixin label-variant($color) {
4
+ background-color: $color;
5
+
6
+ &[href] {
7
+ &:hover,
8
+ &:focus {
9
+ background-color: darken($color, 10%);
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,31 @@
1
+ // List Groups
2
+
3
+ @mixin list-group-item-variant($state, $background, $color) {
4
+ .list-group-item-#{$state} {
5
+ color: $color;
6
+ background-color: $background;
7
+
8
+ // [converter] extracted a& to a.list-group-item-#{$state}
9
+ }
10
+
11
+ a.list-group-item-#{$state} {
12
+ color: $color;
13
+
14
+ .list-group-item-heading {
15
+ color: inherit;
16
+ }
17
+
18
+ &:hover,
19
+ &:focus {
20
+ color: $color;
21
+ background-color: darken($background, 5%);
22
+ }
23
+ &.active,
24
+ &.active:hover,
25
+ &.active:focus {
26
+ color: #fff;
27
+ background-color: $color;
28
+ border-color: $color;
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,10 @@
1
+ // Horizontal dividers
2
+ //
3
+ // Dividers (basically an hr) within dropdowns and nav lists
4
+
5
+ @mixin nav-divider($color: #e5e5e5) {
6
+ height: 1px;
7
+ margin: (($line-height-computed / 2) - 1) 0;
8
+ overflow: hidden;
9
+ background-color: $color;
10
+ }
@@ -0,0 +1,9 @@
1
+ // Navbar vertical align
2
+ //
3
+ // Vertically center elements in the navbar.
4
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
5
+
6
+ @mixin navbar-vertical-align($element-height) {
7
+ margin-top: (($navbar-height - $element-height) / 2);
8
+ margin-bottom: (($navbar-height - $element-height) / 2);
9
+ }