lol_framework 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. data/.gitignore +19 -0
  2. data/.rspec +4 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +30 -0
  6. data/Rakefile +1 -0
  7. data/lib/generators/lol_framework/setup/lol_framework.rb +27 -0
  8. data/lib/generators/lol_framework/setup/setup_generator.rb +17 -0
  9. data/lib/lol_framework.rb +8 -0
  10. data/lib/lol_framework/common.rb +20 -0
  11. data/lib/lol_framework/config.rb +17 -0
  12. data/lib/lol_framework/config/components.rb +16 -0
  13. data/lib/lol_framework/config/components/css.rb +44 -0
  14. data/lib/lol_framework/config/components/js.rb +75 -0
  15. data/lib/lol_framework/railtie.rb +14 -0
  16. data/lib/lol_framework/version.rb +3 -0
  17. data/lol_framework.gemspec +28 -0
  18. data/spec/lol_framework/config/components/css_spec.rb +5 -0
  19. data/spec/lol_framework/config/components/js_spec.rb +11 -0
  20. data/spec/lol_framework/config/components_spec.rb +24 -0
  21. data/spec/lol_framework/config_spec.rb +19 -0
  22. data/spec/lol_framework/lol_framework_spec.rb +13 -0
  23. data/spec/spec_helper.rb +20 -0
  24. data/vendor/assets/images/lol_framework/datatable/sorting_bg.png +0 -0
  25. data/vendor/assets/images/lol_framework/glyphicons-lol-origin-white.png +0 -0
  26. data/vendor/assets/images/lol_framework/glyphicons-lol-origin.png +0 -0
  27. data/vendor/assets/images/lol_framework/glyphicons-lol.png +0 -0
  28. data/vendor/assets/javascripts/.gitkeep +0 -0
  29. data/vendor/assets/javascripts/Jasmine/jasmine-html.js +616 -0
  30. data/vendor/assets/javascripts/Jasmine/jasmine.js +2529 -0
  31. data/vendor/assets/javascripts/lol.js +18 -0
  32. data/vendor/assets/javascripts/lol_framework/Ajax.coffee +183 -0
  33. data/vendor/assets/javascripts/lol_framework/Alert.coffee +113 -0
  34. data/vendor/assets/javascripts/lol_framework/Button.coffee +268 -0
  35. data/vendor/assets/javascripts/lol_framework/Core.coffee +85 -0
  36. data/vendor/assets/javascripts/lol_framework/Datatable.coffee +340 -0
  37. data/vendor/assets/javascripts/lol_framework/Date.coffee +0 -0
  38. data/vendor/assets/javascripts/lol_framework/Debug.coffee +45 -0
  39. data/vendor/assets/javascripts/lol_framework/I18n.coffee +81 -0
  40. data/vendor/assets/javascripts/lol_framework/Lang/en-us.coffee +54 -0
  41. data/vendor/assets/javascripts/lol_framework/Lang/pt-br.coffee +57 -0
  42. data/vendor/assets/javascripts/lol_framework/Library/date-functions.js +409 -0
  43. data/vendor/assets/javascripts/lol_framework/Library/jquery.dataTables.min.js +157 -0
  44. data/vendor/assets/javascripts/lol_framework/Library/jquery.mobile.js +14 -0
  45. data/vendor/assets/javascripts/lol_framework/Loader.coffee +83 -0
  46. data/vendor/assets/javascripts/lol_framework/Lol.coffee +4 -0
  47. data/vendor/assets/javascripts/lol_framework/Modal.coffee +221 -0
  48. data/vendor/assets/javascripts/lol_framework/Model.coffee +71 -0
  49. data/vendor/assets/javascripts/lol_framework/Model/Rest.coffee +15 -0
  50. data/vendor/assets/javascripts/lol_framework/Tests/Alert.coffee +83 -0
  51. data/vendor/assets/javascripts/lol_framework/Tests/Core.coffee +35 -0
  52. data/vendor/assets/javascripts/lol_framework/Tests/Debug.coffee +14 -0
  53. data/vendor/assets/javascripts/lol_framework/Tests/I18n.coffee +7 -0
  54. data/vendor/assets/javascripts/lol_framework/Tests/Lang.coffee +130 -0
  55. data/vendor/assets/javascripts/lol_framework/Tests/Library.coffee +13 -0
  56. data/vendor/assets/javascripts/lol_framework/Tests/Lol.coffee +4 -0
  57. data/vendor/assets/javascripts/lol_framework/Tests/Utils.coffee +22 -0
  58. data/vendor/assets/javascripts/lol_framework/Utils.coffee +42 -0
  59. data/vendor/assets/javascripts/lol_main_tests.js +43 -0
  60. data/vendor/assets/stylesheets/.gitkeep +0 -0
  61. data/vendor/assets/stylesheets/jasmine.css +81 -0
  62. data/vendor/assets/stylesheets/lol_framework/_mixin.scss +650 -0
  63. data/vendor/assets/stylesheets/lol_framework/_variable.scss +107 -0
  64. data/vendor/assets/stylesheets/lol_framework/components/_alert.scss +46 -0
  65. data/vendor/assets/stylesheets/lol_framework/components/_datatable.scss +172 -0
  66. data/vendor/assets/stylesheets/lol_framework/components/_loader.scss +15 -0
  67. data/vendor/assets/stylesheets/lol_framework/components/_modal.scss +68 -0
  68. metadata +222 -0
@@ -0,0 +1,43 @@
1
+ //= require ./Jasmine/jasmine
2
+ //= require ./Jasmine/jasmine-html
3
+ //= require ./LolFramework/Tests/Library
4
+ //= require ./LolFramework/Tests/Lol
5
+ //= require ./LolFramework/Tests/Lang
6
+ //= require ./LolFramework/Tests/I18n
7
+ //= require ./LolFramework/Tests/Debug
8
+ //= require ./LolFramework/Tests/Utils
9
+ //= require ./LolFramework/Tests/Core
10
+ //= require ./LolFramework/Tests/Alert
11
+ //= arequire ./LolFramework/Tests/Button
12
+ //= arequire ./LolFramework/Tests/Loader
13
+ //= arequire ./LolFramework/Tests/Ajax
14
+ //= arequire ./LolFramework/Tests/Modal
15
+ //= arequire ./LolFramework/Tests/Model
16
+ //= arequire ./LolFramework/Tests/Model/Rest
17
+ //= arequire ./LolFramework/Tests/Datatable
18
+ //
19
+ // //= require_self
20
+
21
+ var jasmineEnv = jasmine.getEnv();
22
+ jasmineEnv.updateInterval = 1000;
23
+
24
+ var htmlReporter = new jasmine.HtmlReporter();
25
+
26
+ jasmineEnv.addReporter(htmlReporter);
27
+
28
+ jasmineEnv.specFilter = function(spec) {
29
+ return htmlReporter.specFilter(spec);
30
+ };
31
+
32
+ var currentWindowOnload = window.onload;
33
+
34
+ window.onload = function() {
35
+ if (currentWindowOnload) {
36
+ currentWindowOnload();
37
+ }
38
+ execJasmine();
39
+ };
40
+
41
+ function execJasmine() {
42
+ jasmineEnv.execute();
43
+ }
File without changes
@@ -0,0 +1,81 @@
1
+ body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
2
+
3
+ #HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
4
+ #HTMLReporter a { text-decoration: none; }
5
+ #HTMLReporter a:hover { text-decoration: underline; }
6
+ #HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
7
+ #HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
8
+ #HTMLReporter #jasmine_content { position: fixed; right: 100%; }
9
+ #HTMLReporter .version { color: #aaaaaa; }
10
+ #HTMLReporter .banner { margin-top: 14px; }
11
+ #HTMLReporter .duration { color: #aaaaaa; float: right; }
12
+ #HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
13
+ #HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
14
+ #HTMLReporter .symbolSummary li.passed { font-size: 14px; }
15
+ #HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
16
+ #HTMLReporter .symbolSummary li.failed { line-height: 9px; }
17
+ #HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
18
+ #HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
19
+ #HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
20
+ #HTMLReporter .symbolSummary li.pending { line-height: 11px; }
21
+ #HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
22
+ #HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
23
+ #HTMLReporter .runningAlert { background-color: #666666; }
24
+ #HTMLReporter .skippedAlert { background-color: #aaaaaa; }
25
+ #HTMLReporter .skippedAlert:first-child { background-color: #333333; }
26
+ #HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
27
+ #HTMLReporter .passingAlert { background-color: #a6b779; }
28
+ #HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
29
+ #HTMLReporter .failingAlert { background-color: #cf867e; }
30
+ #HTMLReporter .failingAlert:first-child { background-color: #b03911; }
31
+ #HTMLReporter .results { margin-top: 14px; }
32
+ #HTMLReporter #details { display: none; }
33
+ #HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
34
+ #HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
35
+ #HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
36
+ #HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
37
+ #HTMLReporter.showDetails .summary { display: none; }
38
+ #HTMLReporter.showDetails #details { display: block; }
39
+ #HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
40
+ #HTMLReporter .summary { margin-top: 14px; }
41
+ #HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
42
+ #HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
43
+ #HTMLReporter .summary .specSummary.failed a { color: #b03911; }
44
+ #HTMLReporter .description + .suite { margin-top: 0; }
45
+ #HTMLReporter .suite { margin-top: 14px; }
46
+ #HTMLReporter .suite a { color: #333333; }
47
+ #HTMLReporter #details .specDetail { margin-bottom: 28px; }
48
+ #HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
49
+ #HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
50
+ #HTMLReporter .resultMessage span.result { display: block; }
51
+ #HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
52
+
53
+ #TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
54
+ #TrivialReporter a:visited, #TrivialReporter a { color: #303; }
55
+ #TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
56
+ #TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
57
+ #TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
58
+ #TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
59
+ #TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
60
+ #TrivialReporter .runner.running { background-color: yellow; }
61
+ #TrivialReporter .options { text-align: right; font-size: .8em; }
62
+ #TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
63
+ #TrivialReporter .suite .suite { margin: 5px; }
64
+ #TrivialReporter .suite.passed { background-color: #dfd; }
65
+ #TrivialReporter .suite.failed { background-color: #fdd; }
66
+ #TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
67
+ #TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
68
+ #TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
69
+ #TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
70
+ #TrivialReporter .spec.skipped { background-color: #bbb; }
71
+ #TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
72
+ #TrivialReporter .passed { background-color: #cfc; display: none; }
73
+ #TrivialReporter .failed { background-color: #fbb; }
74
+ #TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
75
+ #TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
76
+ #TrivialReporter .resultMessage .mismatch { color: black; }
77
+ #TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
78
+ #TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
79
+ #TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
80
+ #TrivialReporter #jasmine_content { position: fixed; right: 100%; }
81
+ #TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
@@ -0,0 +1,650 @@
1
+
2
+ // -------------------------------------------------------
3
+ // Mixins
4
+ // -------------------------------------------------------
5
+
6
+ // -------------------------------------------------------
7
+ // Utility Mixins
8
+ // -------------------------------------------------------
9
+
10
+
11
+ // -------------------------------------------------------
12
+ // Clearfix
13
+ //
14
+ // @desc For clearing floats like a boss h5bp.com/q
15
+ // -------------------------------------------------------
16
+ @mixin clearfix {
17
+ *zoom: 1;
18
+ &:before,
19
+ &:after {
20
+ display: table;
21
+ content: "";
22
+ // Fixes Opera/contenteditable bug:
23
+ // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
24
+ line-height: 0;
25
+ }
26
+ &:after {
27
+ clear: both;
28
+ }
29
+ }
30
+
31
+ // -------------------------------------------------------
32
+ // Center-align a block level element
33
+ // -------------------------------------------------------
34
+ @mixin center-block() {
35
+ display: block;
36
+ margin-left: auto;
37
+ margin-right: auto;
38
+ }
39
+
40
+ // -------------------------------------------------------
41
+ // Shortcuts to sizing
42
+ // -------------------------------------------------------
43
+ @mixin size($height, $width) {
44
+ width: $width;
45
+ height: $height;
46
+ }
47
+ @mixin square($size) {
48
+ @include size($size, $size);
49
+ }
50
+
51
+ // -------------------------------------------------------
52
+ // Shortcuts to get assets
53
+ // -------------------------------------------------------
54
+ @mixin asset-background($asset, $repeat:null, $position: null) {
55
+ background-image: url("#{$assetsPath}#{$asset}");
56
+ @if $repeat != null {background-repeat: $repeat;}
57
+ @if $position != null {background-position: $position;}
58
+ }
59
+
60
+ // -------------------------------------------------------
61
+ // Shortcuts to position
62
+ // -------------------------------------------------------
63
+ @mixin afabsolute() {
64
+ position: absolute;
65
+ }
66
+ @mixin affix() {
67
+ position: fixed;
68
+ }
69
+ @mixin afrelative() {
70
+ position: relative;
71
+ }
72
+ @mixin position($top:null,$right:null,$bottom:null,$left:null) {
73
+ @if $top != null {top : $top;}
74
+ @if $right != null {right : $right;}
75
+ @if $bottom != null {bottom: $bottom;}
76
+ @if $left != null {left : $left;}
77
+ }
78
+
79
+ // -------------------------------------------------------
80
+ // Placeholder text
81
+ // -------------------------------------------------------
82
+ @mixin placeholder($color: $placeholderText) {
83
+ &:-moz-placeholder {
84
+ color: $color;
85
+ }
86
+ &:-ms-input-placeholder {
87
+ color: $color;
88
+ }
89
+ &::-webkit-input-placeholder {
90
+ color: $color;
91
+ }
92
+ }
93
+
94
+ // IE7 inline-block
95
+ // ----------------
96
+ @mixin ie7-inline-block() {
97
+ *display: inline; /* IE7 inline-block hack */
98
+ *zoom: 1;
99
+ }
100
+
101
+ // IE7 likes to collapse whitespace on either side of the inline-block elements.
102
+ // Ems because we're attempting to match the width of a space character. Left
103
+ // version is for form buttons, which typically come after other elements, and
104
+ // right version is for icons, which come before. Applying both is ok, but it will
105
+ // mean that space between those elements will be .6em (~2 space characters) in IE7,
106
+ // instead of the 1 space in other browsers.
107
+ @mixin ie7-restore-left-whitespace() {
108
+ *margin-left: .3em;
109
+
110
+ &:first-child {
111
+ *margin-left: 0;
112
+ }
113
+ }
114
+
115
+ @mixin ie7-restore-right-whitespace() {
116
+ *margin-right: .3em;
117
+ }
118
+
119
+ // -------------------------------------------------------
120
+ // Text overflow
121
+ //
122
+ // @desc Requires inline-block or block for proper styling
123
+ // -------------------------------------------------------
124
+ @mixin text-overflow() {
125
+ overflow: hidden;
126
+ text-overflow: ellipsis;
127
+ white-space: nowrap;
128
+ }
129
+
130
+ // -------------------------------------------------------
131
+ // CSS image replacement
132
+ //
133
+ // @see https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
134
+ // -------------------------------------------------------
135
+ @mixin hide-text {
136
+ font: 0/0 a;
137
+ color: transparent;
138
+ text-shadow: none;
139
+ background-color: transparent;
140
+ border: 0;
141
+ }
142
+
143
+ // -------------------------------------------------------
144
+ // Icons background position
145
+ // --------------------------------------------------
146
+ @mixin icon-bg-big($column: 0, $row:0) {
147
+ background-position: (-1 * (30 * ($column - 1) + 5px)) ( -1 * (30 * ($row - 1) + 5px));
148
+ }
149
+ @mixin icon-bg($column: 0, $row:0) {
150
+ background-position: (-1 * (20 * ($column - 1) + 3.33px)) ( -1 * (20 * ($row - 1) + 3.33px));
151
+ @include background-size(($iconSpriteWidth/3*2) auto);
152
+ &.icon-big {
153
+ @include icon-bg-big($column,$row);
154
+ }
155
+ }
156
+
157
+
158
+ // -------------------------------------------------------
159
+ // Fonts
160
+ // --------------------------------------------------
161
+ @mixin font-family-serif() {
162
+ font-family: $serifFontFamily;
163
+ }
164
+ @mixin font-family-sans-serif() {
165
+ font-family: $sansFontFamily;
166
+ }
167
+ @mixin font-family-monospace() {
168
+ font-family: $monoFontFamily;
169
+ }
170
+ @mixin font-shorthand($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
171
+ font-size: $size;
172
+ font-weight: $weight;
173
+ line-height: $lineHeight;
174
+ }
175
+ @mixin font-serif($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
176
+ @include font-family-serif();
177
+ @include font-shorthand($size, $weight, $lineHeight);
178
+ }
179
+ @mixin font-sans-serif($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
180
+ @include font-family-sans-serif();
181
+ @include font-shorthand($size, $weight, $lineHeight);
182
+ }
183
+ @mixin font-monospace($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
184
+ @include font-family-monospace();
185
+ @include font-shorthand($size, $weight, $lineHeight);
186
+ }
187
+
188
+
189
+ // FORMS
190
+ // --------------------------------------------------
191
+
192
+ // Block level inputs
193
+ @mixin input-block-level {
194
+ display: block;
195
+ width: 100%;
196
+ min-height: 30px; // Make inputs at least the height of their button counterpart
197
+ @include box-sizing(border-box); // Makes inputs behave like true block-level elements
198
+ }
199
+
200
+
201
+
202
+ // Mixin for form field states
203
+ @mixin formFieldState($textColor: #555, $borderColor: #ccc, $backgroundColor: #f5f5f5) {
204
+ // Set the text color
205
+ > label,
206
+ .help-block,
207
+ .help-inline {
208
+ color: $textColor;
209
+ }
210
+ // Style inputs accordingly
211
+ .checkbox,
212
+ .radio,
213
+ input,
214
+ select,
215
+ textarea {
216
+ color: $textColor;
217
+ }
218
+ input,
219
+ select,
220
+ textarea {
221
+ border-color: $borderColor;
222
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
223
+ &:focus {
224
+ border-color: darken($borderColor, 10%);
225
+ @include box-shadow(#{inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($borderColor, 20%)});
226
+ }
227
+ }
228
+ // Give a small background color for input-prepend/-append
229
+ .input-prepend .add-on,
230
+ .input-append .add-on {
231
+ color: $textColor;
232
+ background-color: $backgroundColor;
233
+ border-color: $textColor;
234
+ }
235
+ }
236
+
237
+
238
+
239
+ // CSS3 PROPERTIES
240
+ // --------------------------------------------------
241
+
242
+ // User Select Text
243
+ @mixin user-select($select) {
244
+ -webkit-touch-callout: $select;
245
+ -webkit-user-select: $select;
246
+ -khtml-user-select: $select;
247
+ -moz-user-select: $select;
248
+ -ms-user-select: $select;
249
+ user-select: $select;
250
+ }
251
+
252
+ // Border Radius
253
+ @mixin border-radius($radius) {
254
+ -webkit-border-radius: $radius;
255
+ -moz-border-radius: $radius;
256
+ border-radius: $radius;
257
+ }
258
+
259
+ // Single Corner Border Radius
260
+ @mixin border-top-left-radius($radius) {
261
+ -webkit-border-top-left-radius: $radius;
262
+ -moz-border-radius-topleft: $radius;
263
+ border-top-left-radius: $radius;
264
+ }
265
+ @mixin border-top-right-radius($radius) {
266
+ -webkit-border-top-right-radius: $radius;
267
+ -moz-border-radius-topright: $radius;
268
+ border-top-right-radius: $radius;
269
+ }
270
+ @mixin border-bottom-right-radius($radius) {
271
+ -webkit-border-bottom-right-radius: $radius;
272
+ -moz-border-radius-bottomright: $radius;
273
+ border-bottom-right-radius: $radius;
274
+ }
275
+ @mixin border-bottom-left-radius($radius) {
276
+ -webkit-border-bottom-left-radius: $radius;
277
+ -moz-border-radius-bottomleft: $radius;
278
+ border-bottom-left-radius: $radius;
279
+ }
280
+
281
+ // Single Side Border Radius
282
+ @mixin border-top-radius($radius) {
283
+ @include border-top-right-radius($radius);
284
+ @include border-top-left-radius($radius);
285
+ }
286
+ @mixin border-right-radius($radius) {
287
+ @include border-top-right-radius($radius);
288
+ @include border-bottom-right-radius($radius);
289
+ }
290
+ @mixin border-bottom-radius($radius) {
291
+ @include border-bottom-right-radius($radius);
292
+ @include border-bottom-left-radius($radius);
293
+ }
294
+ @mixin border-left-radius($radius) {
295
+ @include border-top-left-radius($radius);
296
+ @include border-bottom-left-radius($radius);
297
+ }
298
+
299
+ // Drop shadows
300
+ @mixin box-shadow($shadow) { // ToDo: Multiple shadow solution for SASS
301
+ -webkit-box-shadow: $shadow;
302
+ -moz-box-shadow: $shadow;
303
+ box-shadow: $shadow;
304
+ }
305
+
306
+ // Transitions
307
+ @mixin transition($transition) {
308
+ -webkit-transition: $transition;
309
+ -moz-transition: $transition;
310
+ -o-transition: $transition;
311
+ transition: $transition;
312
+ }
313
+
314
+ @mixin transition-delay($transition-delay) {
315
+ -webkit-transition-delay: $transition-delay;
316
+ -moz-transition-delay: $transition-delay;
317
+ -o-transition-delay: $transition-delay;
318
+ transition-delay: $transition-delay;
319
+ }
320
+
321
+ // Transformations
322
+ @mixin rotate($degrees) {
323
+ -webkit-transform: rotate($degrees);
324
+ -moz-transform: rotate($degrees);
325
+ -ms-transform: rotate($degrees);
326
+ -o-transform: rotate($degrees);
327
+ transform: rotate($degrees);
328
+ }
329
+ @mixin scale($ratio) {
330
+ -webkit-transform: scale($ratio);
331
+ -moz-transform: scale($ratio);
332
+ -ms-transform: scale($ratio);
333
+ -o-transform: scale($ratio);
334
+ transform: scale($ratio);
335
+ }
336
+ @mixin translate($x, $y) {
337
+ -webkit-transform: translate($x, $y);
338
+ -moz-transform: translate($x, $y);
339
+ -ms-transform: translate($x, $y);
340
+ -o-transform: translate($x, $y);
341
+ transform: translate($x, $y);
342
+ }
343
+ @mixin skew($x, $y) {
344
+ -webkit-transform: skew($x, $y);
345
+ -moz-transform: skew($x, $y);
346
+ -ms-transform: skewX($x) skewY($y); // See https://github.com/twitter/bootstrap/issues/4885
347
+ -o-transform: skew($x, $y);
348
+ transform: skew($x, $y);
349
+ }
350
+ @mixin translate3d($x, $y, $z) {
351
+ -webkit-transform: translate3d($x, $y, $z);
352
+ -moz-transform: translate3d($x, $y, $z);
353
+ -o-transform: translate3d($x, $y, $z);
354
+ transform: translate3d($x, $y, $z);
355
+ }
356
+
357
+ // Backface visibility
358
+ // Prevent browsers from flickering when using CSS 3D transforms.
359
+ // Default value is `visible`, but can be changed to `hidden
360
+ // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
361
+ @mixin backface-visibility($visibility){
362
+ -webkit-backface-visibility: $visibility;
363
+ -moz-backface-visibility: $visibility;
364
+ backface-visibility: $visibility;
365
+ }
366
+
367
+ // Background clipping
368
+ // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
369
+ @mixin background-clip($clip) {
370
+ -webkit-background-clip: $clip;
371
+ -moz-background-clip: $clip;
372
+ background-clip: $clip;
373
+ }
374
+
375
+ // Background sizing
376
+ @mixin background-size($size) {
377
+ -webkit-background-size: $size;
378
+ -moz-background-size: $size;
379
+ -o-background-size: $size;
380
+ background-size: $size;
381
+ }
382
+
383
+
384
+ // Box sizing
385
+ @mixin box-sizing($boxmodel) {
386
+ -webkit-box-sizing: $boxmodel;
387
+ -moz-box-sizing: $boxmodel;
388
+ box-sizing: $boxmodel;
389
+ }
390
+
391
+ // User select
392
+ // For selecting text on the page
393
+ @mixin user-select($select) {
394
+ -webkit-user-select: $select;
395
+ -moz-user-select: $select;
396
+ -ms-user-select: $select;
397
+ -o-user-select: $select;
398
+ user-select: $select;
399
+ }
400
+
401
+ // Resize anything
402
+ @mixin resizable($direction) {
403
+ resize: $direction; // Options: horizontal, vertical, both
404
+ overflow: auto; // Safari fix
405
+ }
406
+
407
+ // CSS3 Content Columns
408
+ @mixin content-columns($columnCount, $columnGap: $gridGutterWidth) {
409
+ -webkit-column-count: $columnCount;
410
+ -moz-column-count: $columnCount;
411
+ column-count: $columnCount;
412
+ -webkit-column-gap: $columnGap;
413
+ -moz-column-gap: $columnGap;
414
+ column-gap: $columnGap;
415
+ }
416
+
417
+ // Optional hyphenation
418
+ @mixin hyphens($mode: auto) {
419
+ word-wrap: break-word;
420
+ -webkit-hyphens: $mode;
421
+ -moz-hyphens: $mode;
422
+ -ms-hyphens: $mode;
423
+ -o-hyphens: $mode;
424
+ hyphens: $mode;
425
+ }
426
+
427
+ // Opacity
428
+ @mixin opacity($opacity) {
429
+ opacity: $opacity / 100;
430
+ filter: alpha(opacity=$opacity);
431
+ }
432
+
433
+
434
+
435
+ // BACKGROUNDS
436
+ // --------------------------------------------------
437
+
438
+ // Add an alphatransparency value to any background or border color (via Elyse Holladay)
439
+ @mixin translucent-background($color: $white, $alpha: 1) {
440
+ background-color: hsla(hue($color), saturation($color), lightness($color), $alpha);
441
+ }
442
+
443
+ @mixin translucent-border($color: $white, $alpha: 1) {
444
+ border-color: hsla(hue($color), saturation($color), lightness($color), $alpha);
445
+ @include background-clip(padding-box);
446
+ }
447
+
448
+ // Gradient Bar Colors for buttons and alerts
449
+ @mixin gradientBar($primaryColor, $secondaryColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
450
+ color: $textColor;
451
+ text-shadow: $textShadow;
452
+ @include gradient-vertical($primaryColor, $secondaryColor);
453
+ border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%);
454
+ border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fade-in(rgba(0,0,0,.1), 0.15);
455
+ }
456
+
457
+ // Gradients
458
+ @mixin gradient-horizontal($startColor: #555, $endColor: #333) {
459
+ background-color: $endColor;
460
+ background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
461
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
462
+ background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
463
+ background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
464
+ background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
465
+ background-repeat: repeat-x;
466
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=1); // IE9 and down
467
+ }
468
+ @mixin gradient-vertical($startColor: #555, $endColor: #333) {
469
+ background-color: mix($startColor, $endColor, 62.5%);
470
+ background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+
471
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
472
+ background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+
473
+ background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10
474
+ background-image: linear-gradient(to bottom, $startColor, $endColor); // Standard, IE10
475
+ background-repeat: repeat-x;
476
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=0); // IE9 and down
477
+ }
478
+ @mixin gradient-directional($startColor: #555, $endColor: #333, $deg: 45deg) {
479
+ background-color: $endColor;
480
+ background-repeat: repeat-x;
481
+ background-image: -moz-linear-gradient($deg, $startColor, $endColor); // FF 3.6+
482
+ background-image: -webkit-linear-gradient($deg, $startColor, $endColor); // Safari 5.1+, Chrome 10+
483
+ background-image: -o-linear-gradient($deg, $startColor, $endColor); // Opera 11.10
484
+ background-image: linear-gradient($deg, $startColor, $endColor); // Standard, IE10
485
+ }
486
+ @mixin gradient-vertical-three-colors($startColor: #00b3ee, $midColor: #7a43b6, $colorStop: 50%, $endColor: #c3325f) {
487
+ background-color: mix($midColor, $endColor, 80%);
488
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), color-stop($colorStop, $midColor), to($endColor));
489
+ background-image: -webkit-linear-gradient($startColor, $midColor $colorStop, $endColor);
490
+ background-image: -moz-linear-gradient(top, $startColor, $midColor $colorStop, $endColor);
491
+ background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor);
492
+ background-image: linear-gradient($startColor, $midColor $colorStop, $endColor);
493
+ background-repeat: no-repeat;
494
+ 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
495
+ }
496
+ @mixin gradient-radial($innerColor: #555, $outerColor: #333) {
497
+ background-color: $outerColor;
498
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($innerColor), to($outerColor));
499
+ background-image: -webkit-radial-gradient(circle, $innerColor, $outerColor);
500
+ background-image: -moz-radial-gradient(circle, $innerColor, $outerColor);
501
+ background-image: -o-radial-gradient(circle, $innerColor, $outerColor);
502
+ background-repeat: no-repeat;
503
+ }
504
+ @mixin gradient-striped($color: #555, $angle: 45deg) {
505
+ background-color: $color;
506
+ 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));
507
+ 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);
508
+ 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);
509
+ 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);
510
+ 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);
511
+ }
512
+
513
+ // Reset filters for IE
514
+ @mixin gradient-reset-filter() {
515
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
516
+ }
517
+
518
+
519
+
520
+ // COMPONENT MIXINS
521
+ // --------------------------------------------------
522
+
523
+ // Horizontal dividers
524
+ // -------------------------
525
+ // Dividers (basically an hr) within dropdowns and nav lists
526
+ @mixin nav-divider($top: #e5e5e5, $bottom: $white) {
527
+ // IE7 needs a set width since we gave a height. Restricting just
528
+ // to IE7 to keep the 1px left/right space in other browsers.
529
+ // It is unclear where IE is getting the extra space that we need
530
+ // to negative-margin away, but so it goes.
531
+ *width: 100%;
532
+ height: 1px;
533
+ margin: (($baseLineHeight / 2) - 1) 1px; // 8px 1px
534
+ *margin: -5px 0 5px;
535
+ overflow: hidden;
536
+ background-color: $top;
537
+ border-bottom: 1px solid $bottom;
538
+ }
539
+
540
+ // Button backgrounds
541
+ // ------------------
542
+ @mixin buttonBackground($startColor, $endColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
543
+ // gradientBar will set the background to a pleasing blend of these, to support IE<=9
544
+ @include gradientBar($startColor, $endColor, $textColor, $textShadow);
545
+ *background-color: $endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
546
+ @include gradient-reset-filter();
547
+
548
+ // in these cases the gradient won't cover the background, so we override
549
+ &:hover, &:active, &.active, &.disabled, &[disabled] {
550
+ color: $textColor;
551
+ background-color: $endColor;
552
+ *background-color: darken($endColor, 5%);
553
+ }
554
+
555
+ // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
556
+ &:active,
557
+ &.active {
558
+ background-color: darken($endColor, 10%) / 9;
559
+ }
560
+ }
561
+
562
+ // Navbar vertical align
563
+ // -------------------------
564
+ // Vertically center elements in the navbar.
565
+ // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
566
+ @mixin navbarVerticalAlign($elementHeight) {
567
+ margin-top: ($navbarHeight - $elementHeight) / 2;
568
+ }
569
+
570
+
571
+
572
+ // Grid System
573
+ // -----------
574
+
575
+ // Centered container element
576
+ @mixin container-fixed() {
577
+ margin-right: auto;
578
+ margin-left: auto;
579
+ @include clearfix();
580
+ }
581
+
582
+ // Container width settings
583
+ @mixin container-width($width) {
584
+ .container {
585
+ width: $width;
586
+ @include container-fixed();
587
+ }
588
+ }
589
+
590
+ // Table columns
591
+ @mixin tableColumns($columnSpan: 1) {
592
+ float: none; // undo default grid column styles
593
+ width: (($gridColumnWidth) * $columnSpan) + ($gridGutterWidth * ($columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
594
+ margin-left: 0; // undo default grid column styles
595
+ }
596
+
597
+ // Make a Grid
598
+ // Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
599
+ @mixin makeRow() {
600
+ margin-left: $gridGutterWidth * -1;
601
+ @include clearfix();
602
+ }
603
+ @mixin makeColumn($columns: 1, $offset: 0) {
604
+ float: left;
605
+ margin-left: ($gridColumnWidth * $offset) + ($gridGutterWidth * ($offset - 1)) + ($gridGutterWidth * 2);
606
+ width: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns - 1));
607
+ }
608
+
609
+ // Generate te configration for
610
+ @mixin create-grid($columns: 1) {
611
+ .grid#{$columns} {
612
+ width: ($gridRespColumnWidth*$columns+($columns - 1)*$gridSpaceColumnWidth);
613
+ }
614
+ }
615
+ @mixin grid-column-setup() {
616
+ // generate .spanX and .offsetX
617
+ @include grid-span-x($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth);
618
+ @include grid-offset-x($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth);
619
+ }
620
+
621
+
622
+ @mixin grid-span-x($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth) {
623
+ @while $gridTotalColumns > 0 {
624
+ .grid#{$gridTotalColumns} { @include grid-span($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth); }
625
+ $gridTotalColumns: $gridTotalColumns - 1;
626
+ }
627
+ }
628
+
629
+ @mixin grid-offset-x($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth) {
630
+ @while $gridTotalColumns > 0 {
631
+ .offset#{$gridTotalColumns} { @include grid-offset($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth); }
632
+ .offset#{$gridTotalColumns}:first-child { @include grid-offset-first-child($gridTotalColumns, $gridRespColumnWidth, $gridSpaceColumnWidth); }
633
+ $gridTotalColumns: $gridTotalColumns - 1;
634
+ }
635
+ }
636
+
637
+ @mixin grid-span($columns, $gridRespColumnWidth, $gridSpaceColumnWidth) {
638
+ width: ($gridRespColumnWidth * $columns) + ($gridSpaceColumnWidth * ($columns - 1));
639
+ *width: ($gridRespColumnWidth * $columns) + ($gridSpaceColumnWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%);
640
+ }
641
+
642
+ @mixin grid-offset($columns, $gridRespColumnWidth, $gridSpaceColumnWidth) {
643
+ margin-left: ($gridRespColumnWidth * $columns) + ($gridSpaceColumnWidth * ($columns - 1)) + ($gridSpaceColumnWidth * 2);
644
+ *margin-left: ($gridRespColumnWidth * $columns) + ($gridSpaceColumnWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%) + ($gridSpaceColumnWidth * 2) - (.5 / $gridRowWidth * 100px * 1%);
645
+ }
646
+
647
+ @mixin grid-offset-first-child($columns, $gridRespColumnWidth, $gridSpaceColumnWidth) {
648
+ margin-left: ($gridRespColumnWidth * $columns) + ($gridSpaceColumnWidth * ($columns - 1)) + ($gridSpaceColumnWidth);
649
+ *margin-left: ($gridRespColumnWidth * $columns) + ($gridSpaceColumnWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%) + $gridSpaceColumnWidth - (.5 / $gridRowWidth * 100px * 1%);
650
+ }