flat-ui-sass 2.1.3

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 (122) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.gitmodules +3 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +256 -0
  7. data/Rakefile +14 -0
  8. data/app/helpers/flat_ui/rails/icon_helper.rb +60 -0
  9. data/bin/fui_convert +9 -0
  10. data/flat-ui-sass.gemspec +28 -0
  11. data/lib/flat-ui-sass.rb +98 -0
  12. data/lib/flat-ui-sass/cli.rb +56 -0
  13. data/lib/flat-ui-sass/engine.rb +13 -0
  14. data/lib/flat-ui-sass/sass_functions.rb +56 -0
  15. data/lib/flat-ui-sass/version.rb +4 -0
  16. data/lib/tasks/converter.rb +99 -0
  17. data/lib/tasks/converter/filesystem.rb +16 -0
  18. data/lib/tasks/converter/flat_ui_fonts_conversion.rb +19 -0
  19. data/lib/tasks/converter/flat_ui_images_conversion.rb +19 -0
  20. data/lib/tasks/converter/flat_ui_js_conversion.rb +28 -0
  21. data/lib/tasks/converter/flat_ui_less_conversion.rb +328 -0
  22. data/lib/tasks/converter/logger.rb +61 -0
  23. data/lib/tasks/flat-ui-sass.rake +8 -0
  24. data/templates/project/_variables.scss.erb +5 -0
  25. data/templates/project/manifest.rb +57 -0
  26. data/templates/project/styles.scss +4 -0
  27. data/vendor/assets/fonts/flat-ui/flat-ui-icons-regular.eot +0 -0
  28. data/vendor/assets/fonts/flat-ui/flat-ui-icons-regular.svg +140 -0
  29. data/vendor/assets/fonts/flat-ui/flat-ui-icons-regular.ttf +0 -0
  30. data/vendor/assets/fonts/flat-ui/flat-ui-icons-regular.woff +0 -0
  31. data/vendor/assets/images/flat-ui/icons/png/Book.png +0 -0
  32. data/vendor/assets/images/flat-ui/icons/png/Calendar.png +0 -0
  33. data/vendor/assets/images/flat-ui/icons/png/Chat.png +0 -0
  34. data/vendor/assets/images/flat-ui/icons/png/Clipboard.png +0 -0
  35. data/vendor/assets/images/flat-ui/icons/png/Compas.png +0 -0
  36. data/vendor/assets/images/flat-ui/icons/png/Gift-Box.png +0 -0
  37. data/vendor/assets/images/flat-ui/icons/png/Infinity-Loop.png +0 -0
  38. data/vendor/assets/images/flat-ui/icons/png/Mail.png +0 -0
  39. data/vendor/assets/images/flat-ui/icons/png/Map.png +0 -0
  40. data/vendor/assets/images/flat-ui/icons/png/Pensils.png +0 -0
  41. data/vendor/assets/images/flat-ui/icons/png/Pocket.png +0 -0
  42. data/vendor/assets/images/flat-ui/icons/png/Retina-Ready.png +0 -0
  43. data/vendor/assets/images/flat-ui/icons/png/Toilet-Paper.png +0 -0
  44. data/vendor/assets/images/flat-ui/icons/png/Watches.png +0 -0
  45. data/vendor/assets/images/flat-ui/icons/svg/book.svg +1 -0
  46. data/vendor/assets/images/flat-ui/icons/svg/calendar.svg +1 -0
  47. data/vendor/assets/images/flat-ui/icons/svg/chat.svg +1 -0
  48. data/vendor/assets/images/flat-ui/icons/svg/clipboard.svg +1 -0
  49. data/vendor/assets/images/flat-ui/icons/svg/clocks.svg +9 -0
  50. data/vendor/assets/images/flat-ui/icons/svg/compas.svg +1 -0
  51. data/vendor/assets/images/flat-ui/icons/svg/gift-box.svg +1 -0
  52. data/vendor/assets/images/flat-ui/icons/svg/loop.svg +5 -0
  53. data/vendor/assets/images/flat-ui/icons/svg/mail.svg +1 -0
  54. data/vendor/assets/images/flat-ui/icons/svg/map.svg +1 -0
  55. data/vendor/assets/images/flat-ui/icons/svg/paper-bag.svg +1 -0
  56. data/vendor/assets/images/flat-ui/icons/svg/pencils.svg +1 -0
  57. data/vendor/assets/images/flat-ui/icons/svg/retina.svg +1 -0
  58. data/vendor/assets/images/flat-ui/icons/svg/toilet-paper.svg +1 -0
  59. data/vendor/assets/images/flat-ui/login/icon.png +0 -0
  60. data/vendor/assets/images/flat-ui/login/imac-2x.png +0 -0
  61. data/vendor/assets/images/flat-ui/login/imac.png +0 -0
  62. data/vendor/assets/images/flat-ui/switch/mask-square.png +0 -0
  63. data/vendor/assets/images/flat-ui/switch/mask.png +0 -0
  64. data/vendor/assets/images/flat-ui/tile/ribbon-2x.png +0 -0
  65. data/vendor/assets/images/flat-ui/tile/ribbon.png +0 -0
  66. data/vendor/assets/images/flat-ui/todo/done-2x.png +0 -0
  67. data/vendor/assets/images/flat-ui/todo/done.png +0 -0
  68. data/vendor/assets/images/flat-ui/todo/search-2x.png +0 -0
  69. data/vendor/assets/images/flat-ui/todo/search.png +0 -0
  70. data/vendor/assets/images/flat-ui/todo/todo-2x.png +0 -0
  71. data/vendor/assets/images/flat-ui/todo/todo.png +0 -0
  72. data/vendor/assets/images/flat-ui/video/fullscreen-2x.png +0 -0
  73. data/vendor/assets/images/flat-ui/video/fullscreen.png +0 -0
  74. data/vendor/assets/images/flat-ui/video/pause-2x.png +0 -0
  75. data/vendor/assets/images/flat-ui/video/pause.png +0 -0
  76. data/vendor/assets/images/flat-ui/video/play-2x.png +0 -0
  77. data/vendor/assets/images/flat-ui/video/play.png +0 -0
  78. data/vendor/assets/images/flat-ui/video/poster.jpg +0 -0
  79. data/vendor/assets/images/flat-ui/video/volume-full-2x.png +0 -0
  80. data/vendor/assets/images/flat-ui/video/volume-full.png +0 -0
  81. data/vendor/assets/images/flat-ui/video/volume-off-2x.png +0 -0
  82. data/vendor/assets/images/flat-ui/video/volume-off.png +0 -0
  83. data/vendor/assets/javascripts/flat-ui.js +2 -0
  84. data/vendor/assets/javascripts/flat-ui/flatui-checkbox.js +112 -0
  85. data/vendor/assets/javascripts/flat-ui/flatui-radio.js +139 -0
  86. data/vendor/assets/stylesheets/flat-ui.scss +1 -0
  87. data/vendor/assets/stylesheets/flat-ui/_mixins.scss +878 -0
  88. data/vendor/assets/stylesheets/flat-ui/_spaces.scss +172 -0
  89. data/vendor/assets/stylesheets/flat-ui/_variables.scss +509 -0
  90. data/vendor/assets/stylesheets/flat-ui/flat-ui.scss +45 -0
  91. data/vendor/assets/stylesheets/flat-ui/modules/_button-groups.scss +110 -0
  92. data/vendor/assets/stylesheets/flat-ui/modules/_buttons.scss +151 -0
  93. data/vendor/assets/stylesheets/flat-ui/modules/_caret.scss +30 -0
  94. data/vendor/assets/stylesheets/flat-ui/modules/_checkbox-and-radio.scss +143 -0
  95. data/vendor/assets/stylesheets/flat-ui/modules/_code.scss +49 -0
  96. data/vendor/assets/stylesheets/flat-ui/modules/_dropdown.scss +223 -0
  97. data/vendor/assets/stylesheets/flat-ui/modules/_footer.scss +76 -0
  98. data/vendor/assets/stylesheets/flat-ui/modules/_forms.scss +188 -0
  99. data/vendor/assets/stylesheets/flat-ui/modules/_glyphicons.scss +135 -0
  100. data/vendor/assets/stylesheets/flat-ui/modules/_input-groups.scss +153 -0
  101. data/vendor/assets/stylesheets/flat-ui/modules/_input-icons.scss +72 -0
  102. data/vendor/assets/stylesheets/flat-ui/modules/_local-fonts.scss +69 -0
  103. data/vendor/assets/stylesheets/flat-ui/modules/_login.scss +111 -0
  104. data/vendor/assets/stylesheets/flat-ui/modules/_navbar.scss +876 -0
  105. data/vendor/assets/stylesheets/flat-ui/modules/_pager.scss +51 -0
  106. data/vendor/assets/stylesheets/flat-ui/modules/_pagination.scss +166 -0
  107. data/vendor/assets/stylesheets/flat-ui/modules/_palette.scss +71 -0
  108. data/vendor/assets/stylesheets/flat-ui/modules/_progress-bars.scss +34 -0
  109. data/vendor/assets/stylesheets/flat-ui/modules/_scaffolding.scss +64 -0
  110. data/vendor/assets/stylesheets/flat-ui/modules/_select.scss +145 -0
  111. data/vendor/assets/stylesheets/flat-ui/modules/_share.scss +44 -0
  112. data/vendor/assets/stylesheets/flat-ui/modules/_slider.scss +105 -0
  113. data/vendor/assets/stylesheets/flat-ui/modules/_switch.scss +150 -0
  114. data/vendor/assets/stylesheets/flat-ui/modules/_tagsinput.scss +121 -0
  115. data/vendor/assets/stylesheets/flat-ui/modules/_thumbnails.scss +38 -0
  116. data/vendor/assets/stylesheets/flat-ui/modules/_tile.scss +54 -0
  117. data/vendor/assets/stylesheets/flat-ui/modules/_todo.scss +110 -0
  118. data/vendor/assets/stylesheets/flat-ui/modules/_tooltip.scss +56 -0
  119. data/vendor/assets/stylesheets/flat-ui/modules/_type.scss +208 -0
  120. data/vendor/assets/stylesheets/flat-ui/modules/_typeahead.scss +41 -0
  121. data/vendor/assets/stylesheets/flat-ui/modules/_video.scss +458 -0
  122. metadata +251 -0
@@ -0,0 +1,139 @@
1
+ /* =============================================================
2
+ * flatui-radio v0.0.3
3
+ * ============================================================ */
4
+
5
+ !function ($) {
6
+
7
+ /* RADIO PUBLIC CLASS DEFINITION
8
+ * ============================== */
9
+
10
+ var Radio = function (element, options) {
11
+ this.init(element, options);
12
+ }
13
+
14
+ Radio.prototype = {
15
+
16
+ constructor: Radio
17
+
18
+ , init: function (element, options) {
19
+ var $el = this.$element = $(element)
20
+
21
+ this.options = $.extend({}, $.fn.radio.defaults, options);
22
+ $el.before(this.options.template);
23
+ this.setState();
24
+ }
25
+
26
+ , setState: function () {
27
+ var $el = this.$element
28
+ , $parent = $el.closest('.radio');
29
+
30
+ $el.prop('disabled') && $parent.addClass('disabled');
31
+ $el.prop('checked') && $parent.addClass('checked');
32
+ }
33
+
34
+ , toggle: function () {
35
+ var d = 'disabled'
36
+ , ch = 'checked'
37
+ , $el = this.$element
38
+ , checked = $el.prop(ch)
39
+ , $parent = $el.closest('.radio')
40
+ , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
41
+ , $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
42
+ , e = $.Event('toggle')
43
+
44
+ $elemGroup.not($el).each(function () {
45
+ var $el = $(this)
46
+ , $parent = $(this).closest('.radio');
47
+
48
+ if ($el.prop(d) == false) {
49
+ $parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
50
+ }
51
+ });
52
+
53
+ if ($el.prop(d) == false) {
54
+ if (checked == false) $parent.addClass(ch) && $el.prop(ch, true);
55
+ $el.trigger(e);
56
+
57
+ if (checked !== $el.prop(ch)) {
58
+ $el.trigger('change');
59
+ }
60
+ }
61
+ }
62
+
63
+ , setCheck: function (option) {
64
+ var ch = 'checked'
65
+ , $el = this.$element
66
+ , $parent = $el.closest('.radio')
67
+ , checkAction = option == 'check' ? true : false
68
+ , checked = $el.prop(ch)
69
+ , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
70
+ , $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
71
+ , e = $.Event(option)
72
+
73
+ $elemGroup.not($el).each(function () {
74
+ var $el = $(this)
75
+ , $parent = $(this).closest('.radio');
76
+
77
+ $parent.removeClass(ch) && $el.removeAttr(ch);
78
+ });
79
+
80
+ $parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
81
+ $el.trigger(e);
82
+
83
+ if (checked !== $el.prop(ch)) {
84
+ $el.trigger('change');
85
+ }
86
+ }
87
+
88
+ }
89
+
90
+
91
+ /* RADIO PLUGIN DEFINITION
92
+ * ======================== */
93
+
94
+ var old = $.fn.radio
95
+
96
+ $.fn.radio = function (option) {
97
+ return this.each(function () {
98
+ var $this = $(this)
99
+ , data = $this.data('radio')
100
+ , options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
101
+ if (!data) $this.data('radio', (data = new Radio(this, options)));
102
+ if (option == 'toggle') data.toggle()
103
+ if (option == 'check' || option == 'uncheck') data.setCheck(option)
104
+ else if (option) data.setState();
105
+ });
106
+ }
107
+
108
+ $.fn.radio.defaults = {
109
+ template: '<span class="icons"><span class="first-icon fui-radio-unchecked"></span><span class="second-icon fui-radio-checked"></span></span>'
110
+ }
111
+
112
+
113
+ /* RADIO NO CONFLICT
114
+ * ================== */
115
+
116
+ $.fn.radio.noConflict = function () {
117
+ $.fn.radio = old;
118
+ return this;
119
+ }
120
+
121
+
122
+ /* RADIO DATA-API
123
+ * =============== */
124
+
125
+ $(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
126
+ var $radio = $(e.target);
127
+ e && e.preventDefault() && e.stopPropagation();
128
+ if (!$radio.hasClass('radio')) $radio = $radio.closest('.radio');
129
+ $radio.find(':radio').radio('toggle');
130
+ });
131
+
132
+ $(function () {
133
+ $('[data-toggle="radio"]').each(function () {
134
+ var $radio = $(this);
135
+ $radio.radio();
136
+ });
137
+ });
138
+
139
+ }(window.jQuery);
@@ -0,0 +1 @@
1
+ @import "flat-ui/flat-ui";
@@ -0,0 +1,878 @@
1
+ //
2
+ // Mixins
3
+ // --------------------------------------------------
4
+
5
+ // Utilities
6
+ // -------------------------
7
+
8
+ // Clearfix
9
+ // Source: http://nicolasgallagher.com/micro-clearfix-hack/
10
+ //
11
+ // For modern browsers
12
+ // 1. The space content is one way to avoid an Opera bug when the
13
+ // contenteditable attribute is included anywhere else in the document.
14
+ // Otherwise it causes space to appear at the top and bottom of elements
15
+ // that are clearfixed.
16
+ // 2. The use of `table` rather than `block` is only necessary if using
17
+ // `:before` to contain the top-margins of child elements.
18
+ @mixin clearfix() {
19
+ &:before,
20
+ &:after {
21
+ content: " "; /* 1 */
22
+ display: table; /* 2 */
23
+ }
24
+ &:after {
25
+ clear: both;
26
+ }
27
+ }
28
+
29
+ // Webkit-style focus
30
+ @mixin tab-focus() {
31
+ // Default
32
+ outline: thin dotted;
33
+ // Webkit
34
+ outline: 5px auto -webkit-focus-ring-color;
35
+ outline-offset: -2px;
36
+ }
37
+
38
+ // Center-align a block level element
39
+ @mixin center-block() {
40
+ display: block;
41
+ margin-left: auto;
42
+ margin-right: auto;
43
+ }
44
+
45
+ // Sizing shortcuts
46
+ @mixin size($width, $height) {
47
+ width: $width;
48
+ height: $height;
49
+ }
50
+ @mixin square($size) {
51
+ @include size($size, $size);
52
+ }
53
+
54
+ // Placeholder text
55
+ @mixin placeholder($color: $input-color-placeholder) {
56
+ &:-moz-placeholder { color: $color; } // Firefox 4-18
57
+ &::-moz-placeholder { color: $color; // Firefox 19+
58
+ opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526
59
+ &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
60
+ &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
61
+ &.placeholder { color: $color; } // Fallback
62
+ }
63
+
64
+ @mixin placeholder-height($height) {
65
+ &:-moz-placeholder {
66
+ line-height: $height;
67
+ }
68
+ &::-webkit-input-placeholder {
69
+ line-height: $height;
70
+ }
71
+ &.placeholder {
72
+ line-height: $height;
73
+ }
74
+ }
75
+
76
+ // Text overflow
77
+ // Requires inline-block or block for proper styling
78
+ @mixin text-overflow() {
79
+ overflow: hidden;
80
+ text-overflow: ellipsis;
81
+ white-space: nowrap;
82
+ }
83
+
84
+ // CSS image replacement
85
+ @mixin text-hide() {
86
+ font: #{0/0} a;
87
+ color: transparent;
88
+ text-shadow: none;
89
+ background-color: transparent;
90
+ border: 0;
91
+ }
92
+
93
+ // CSS3 PROPERTIES
94
+ // --------------------------------------------------
95
+
96
+ @mixin mask($arguments) {
97
+ -webkit-mask: $arguments;
98
+ mask: $arguments;
99
+ }
100
+
101
+ // Single side border-radius
102
+ @mixin border-top-radius($radius) {
103
+ border-top-right-radius: $radius;
104
+ border-top-left-radius: $radius;
105
+ }
106
+ @mixin border-right-radius($radius) {
107
+ border-bottom-right-radius: $radius;
108
+ border-top-right-radius: $radius;
109
+ }
110
+ @mixin border-bottom-radius($radius) {
111
+ border-bottom-right-radius: $radius;
112
+ border-bottom-left-radius: $radius;
113
+ }
114
+ @mixin border-left-radius($radius) {
115
+ border-bottom-left-radius: $radius;
116
+ border-top-left-radius: $radius;
117
+ }
118
+
119
+ // Drop shadows
120
+ @mixin box-shadow($shadow...) {
121
+ -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
122
+ box-shadow: $shadow;
123
+ }
124
+
125
+ // Transitions
126
+ @mixin transition($transition...) {
127
+ -webkit-transition: $transition;
128
+ transition: $transition;
129
+ }
130
+ @mixin transition-property($transition-property...) {
131
+ -webkit-transition-property: $transition-property;
132
+ transition-property: $transition-property;
133
+ }
134
+ @mixin transition-delay($transition-delay) {
135
+ -webkit-transition-delay: $transition-delay;
136
+ transition-delay: $transition-delay;
137
+ }
138
+ @mixin transition-duration($transition-duration...) {
139
+ -webkit-transition-duration: $transition-duration;
140
+ transition-duration: $transition-duration;
141
+ }
142
+ @mixin transition-transform($transition...) {
143
+ -webkit-transition: -webkit-transform $transition;
144
+ -moz-transition: -moz-transform $transition;
145
+ -o-transition: -o-transform $transition;
146
+ transition: transform $transition;
147
+ }
148
+
149
+ // Transformations
150
+ @mixin rotate($degrees) {
151
+ -webkit-transform: rotate($degrees);
152
+ -ms-transform: rotate($degrees); // IE9+
153
+ transform: rotate($degrees);
154
+ }
155
+ @mixin scale($scale-args...) {
156
+ -webkit-transform: scale($scale-args);
157
+ -ms-transform: scale($scale-args); // IE9 only
158
+ transform: scale($scale-args);
159
+ }
160
+ @mixin translate($x, $y) {
161
+ -webkit-transform: translate($x, $y);
162
+ -ms-transform: translate($x, $y); // IE9+
163
+ transform: translate($x, $y);
164
+ }
165
+ @mixin skew($x, $y) {
166
+ -webkit-transform: skew($x, $y);
167
+ -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
168
+ transform: skew($x, $y);
169
+ }
170
+ @mixin translate3d($x, $y, $z) {
171
+ -webkit-transform: translate3d($x, $y, $z);
172
+ transform: translate3d($x, $y, $z);
173
+ }
174
+
175
+ @mixin rotateX($degrees) {
176
+ -webkit-transform: rotateX($degrees);
177
+ -ms-transform: rotateX($degrees); // IE9+
178
+ transform: rotateX($degrees);
179
+ }
180
+ @mixin rotateY($degrees) {
181
+ -webkit-transform: rotateY($degrees);
182
+ -ms-transform: rotateY($degrees); // IE9+
183
+ transform: rotateY($degrees);
184
+ }
185
+ @mixin perspective($perspective) {
186
+ -webkit-perspective: $perspective;
187
+ -moz-perspective: $perspective;
188
+ perspective: $perspective;
189
+ }
190
+ @mixin perspective-origin($perspective) {
191
+ -webkit-perspective-origin: $perspective;
192
+ -moz-perspective-origin: $perspective;
193
+ perspective-origin: $perspective;
194
+ }
195
+ @mixin transform-origin($origin) {
196
+ -webkit-transform-origin: $origin;
197
+ -moz-transform-origin: $origin;
198
+ -ms-transform-origin: $origin; // IE9 only
199
+ transform-origin: $origin;
200
+ }
201
+
202
+ // Animations
203
+ @mixin animation($animation) {
204
+ -webkit-animation: $animation;
205
+ animation: $animation;
206
+ }
207
+ @mixin animation-name($name) {
208
+ -webkit-animation-name: $name;
209
+ animation-name: $name;
210
+ }
211
+ @mixin animation-duration($duration) {
212
+ -webkit-animation-duration: $duration;
213
+ animation-duration: $duration;
214
+ }
215
+ @mixin animation-timing-function($timing-function) {
216
+ -webkit-animation-timing-function: $timing-function;
217
+ animation-timing-function: $timing-function;
218
+ }
219
+ @mixin animation-delay($delay) {
220
+ -webkit-animation-delay: $delay;
221
+ animation-delay: $delay;
222
+ }
223
+ @mixin animation-iteration-count($iteration-count) {
224
+ -webkit-animation-iteration-count: $iteration-count;
225
+ animation-iteration-count: $iteration-count;
226
+ }
227
+ @mixin animation-direction($direction) {
228
+ -webkit-animation-direction: $direction;
229
+ animation-direction: $direction;
230
+ }
231
+
232
+
233
+ // Backface visibility
234
+ // Prevent browsers from flickering when using CSS 3D transforms.
235
+ // Default value is `visible`, but can be changed to `hidden`
236
+ // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
237
+ @mixin backface-visibility($visibility){
238
+ -webkit-backface-visibility: $visibility;
239
+ -moz-backface-visibility: $visibility;
240
+ backface-visibility: $visibility;
241
+ }
242
+
243
+ // Background clip
244
+ @mixin background-clip($clip: border-box) {
245
+ -webkit-background-clip: $clip;
246
+ -moz-background-clip: $clip;
247
+ background-clip: $clip;
248
+ }
249
+
250
+ // Box sizing
251
+ @mixin box-sizing($boxmodel) {
252
+ -webkit-box-sizing: $boxmodel;
253
+ -moz-box-sizing: $boxmodel;
254
+ box-sizing: $boxmodel;
255
+ }
256
+
257
+ // User select
258
+ // For selecting text on the page
259
+ @mixin user-select($select) {
260
+ -webkit-user-select: $select;
261
+ -moz-user-select: $select;
262
+ -ms-user-select: $select; // IE10+
263
+ -o-user-select: $select;
264
+ user-select: $select;
265
+ }
266
+
267
+ // Resize anything
268
+ @mixin resizable($direction) {
269
+ resize: $direction; // Options: horizontal, vertical, both
270
+ overflow: auto; // Safari fix
271
+ }
272
+
273
+ // CSS3 Content Columns
274
+ @mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
275
+ -webkit-column-count: $column-count;
276
+ -moz-column-count: $column-count;
277
+ column-count: $column-count;
278
+ -webkit-column-gap: $column-gap;
279
+ -moz-column-gap: $column-gap;
280
+ column-gap: $column-gap;
281
+ }
282
+
283
+ // Optional hyphenation
284
+ @mixin hyphens($mode: auto) {
285
+ word-wrap: break-word;
286
+ -webkit-hyphens: $mode;
287
+ -moz-hyphens: $mode;
288
+ -ms-hyphens: $mode; // IE10+
289
+ -o-hyphens: $mode;
290
+ hyphens: $mode;
291
+ }
292
+
293
+ // Opacity
294
+ @mixin opacity($opacity) {
295
+ opacity: $opacity;
296
+ // IE8 filter
297
+ $opacity-ie: ($opacity * 100);
298
+ filter: #{alpha(opacity=$opacity-ie)};
299
+ }
300
+
301
+
302
+
303
+ // GRADIENTS
304
+ // --------------------------------------------------
305
+
306
+
307
+
308
+ // Horizontal gradient, from left to right
309
+ //
310
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
311
+ // Color stops are not available in IE9 and below.
312
+ @mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
313
+ background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1-6, Chrome 10+
314
+ 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+
315
+ background-repeat: repeat-x;
316
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
317
+ }
318
+
319
+ // Vertical gradient, from top to bottom
320
+ //
321
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
322
+ // Color stops are not available in IE9 and below.
323
+ @mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
324
+ background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+
325
+ 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+
326
+ background-repeat: repeat-x;
327
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
328
+ }
329
+
330
+ @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
331
+ background-repeat: repeat-x;
332
+ background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+
333
+ background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
334
+ }
335
+ @mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
336
+ background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
337
+ background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
338
+ background-repeat: no-repeat;
339
+ 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
340
+ }
341
+ @mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
342
+ background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
343
+ background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
344
+ background-repeat: no-repeat;
345
+ 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
346
+ }
347
+ @mixin gradient-radial($inner-color: #555, $outer-color: #333) {
348
+ background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
349
+ background-image: radial-gradient(circle, $inner-color, $outer-color);
350
+ background-repeat: no-repeat;
351
+ }
352
+ @mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) {
353
+ background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
354
+ background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
355
+ }
356
+
357
+ // Reset filters for IE
358
+ //
359
+ // When you need to remove a gradient background, do not forget to use this to reset
360
+ // the IE filter for IE9 and below.
361
+ @mixin reset-filter() {
362
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
363
+ }
364
+
365
+
366
+
367
+ // Retina images
368
+ //
369
+ // Short retina mixin for setting background-image and -size
370
+
371
+ @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
372
+ background-image: url(if($flat-ui-sass-asset-helper, flat-ui-image-path("#{$file-1x}"), "#{$file-1x}"));
373
+
374
+ @media
375
+ only screen and (-webkit-min-device-pixel-ratio: 2),
376
+ only screen and ( min--moz-device-pixel-ratio: 2),
377
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
378
+ only screen and ( min-device-pixel-ratio: 2),
379
+ only screen and ( min-resolution: 192dpi),
380
+ only screen and ( min-resolution: 2dppx) {
381
+ background-image: url(if($flat-ui-sass-asset-helper, flat-ui-image-path("#{$file-2x}"), "#{$file-2x}"));
382
+ background-size: $width-1x $height-1x;
383
+ }
384
+ }
385
+
386
+
387
+ // Responsive image
388
+ //
389
+ // Keep images from scaling beyond the width of their parents.
390
+
391
+ @mixin img-responsive($display: block) {
392
+ display: $display;
393
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
394
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
395
+ }
396
+
397
+ // Responsive utilities
398
+ // -------------------------
399
+ // More easily include all the states for responsive-utilities.less.
400
+ // [converter] $parent hack
401
+ @mixin responsive-visibility($parent) {
402
+ #{$parent} {
403
+ display: block !important;
404
+ }
405
+ tr#{$parent} { display: table-row !important; }
406
+ th#{$parent},
407
+ td#{$parent} { display: table-cell !important; }
408
+ }
409
+
410
+ // [converter] $parent hack
411
+ @mixin responsive-invisibility($parent) {
412
+ #{$parent},
413
+ tr#{$parent},
414
+ th#{$parent},
415
+ td#{$parent} { display: none !important; }
416
+ }
417
+
418
+ // Grid System
419
+ // -----------
420
+
421
+ // Centered container element
422
+ @mixin container-fixed() {
423
+ margin-right: auto;
424
+ margin-left: auto;
425
+ padding-left: ($grid-gutter-width / 2);
426
+ padding-right: ($grid-gutter-width / 2);
427
+ @include clearfix();
428
+ }
429
+
430
+ // Creates a wrapper for a series of columns
431
+ @mixin make-row($gutter: $grid-gutter-width) {
432
+ margin-left: ($gutter / -2);
433
+ margin-right: ($gutter / -2);
434
+ @include clearfix();
435
+ }
436
+
437
+ // Generate the extra small columns
438
+ @mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
439
+ position: relative;
440
+ float: left;
441
+ width: percentage(($columns / $grid-columns));
442
+ min-height: 1px;
443
+ padding-left: ($gutter / 2);
444
+ padding-right: ($gutter / 2);
445
+ }
446
+ @mixin make-xs-column-offset($columns) {
447
+ @media (min-width: $screen-xs-min) {
448
+ margin-left: percentage(($columns / $grid-columns));
449
+ }
450
+ }
451
+ @mixin make-xs-column-push($columns) {
452
+ @media (min-width: $screen-xs-min) {
453
+ left: percentage(($columns / $grid-columns));
454
+ }
455
+ }
456
+ @mixin make-xs-column-pull($columns) {
457
+ @media (min-width: $screen-xs-min) {
458
+ right: percentage(($columns / $grid-columns));
459
+ }
460
+ }
461
+
462
+
463
+ // Generate the small columns
464
+ @mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
465
+ position: relative;
466
+ min-height: 1px;
467
+ padding-left: ($gutter / 2);
468
+ padding-right: ($gutter / 2);
469
+
470
+ @media (min-width: $screen-sm-min) {
471
+ float: left;
472
+ width: percentage(($columns / $grid-columns));
473
+ }
474
+ }
475
+ @mixin make-sm-column-offset($columns) {
476
+ @media (min-width: $screen-sm-min) {
477
+ margin-left: percentage(($columns / $grid-columns));
478
+ }
479
+ }
480
+ @mixin make-sm-column-push($columns) {
481
+ @media (min-width: $screen-sm-min) {
482
+ left: percentage(($columns / $grid-columns));
483
+ }
484
+ }
485
+ @mixin make-sm-column-pull($columns) {
486
+ @media (min-width: $screen-sm-min) {
487
+ right: percentage(($columns / $grid-columns));
488
+ }
489
+ }
490
+
491
+
492
+ // Generate the medium columns
493
+ @mixin make-md-column($columns, $gutter: $grid-gutter-width) {
494
+ position: relative;
495
+ min-height: 1px;
496
+ padding-left: ($gutter / 2);
497
+ padding-right: ($gutter / 2);
498
+
499
+ @media (min-width: $screen-md-min) {
500
+ float: left;
501
+ width: percentage(($columns / $grid-columns));
502
+ }
503
+ }
504
+ @mixin make-md-column-offset($columns) {
505
+ @media (min-width: $screen-md-min) {
506
+ margin-left: percentage(($columns / $grid-columns));
507
+ }
508
+ }
509
+ @mixin make-md-column-push($columns) {
510
+ @media (min-width: $screen-md-min) {
511
+ left: percentage(($columns / $grid-columns));
512
+ }
513
+ }
514
+ @mixin make-md-column-pull($columns) {
515
+ @media (min-width: $screen-md-min) {
516
+ right: percentage(($columns / $grid-columns));
517
+ }
518
+ }
519
+
520
+
521
+ // Generate the large columns
522
+ @mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
523
+ position: relative;
524
+ min-height: 1px;
525
+ padding-left: ($gutter / 2);
526
+ padding-right: ($gutter / 2);
527
+
528
+ @media (min-width: $screen-lg-min) {
529
+ float: left;
530
+ width: percentage(($columns / $grid-columns));
531
+ }
532
+ }
533
+ @mixin make-lg-column-offset($columns) {
534
+ @media (min-width: $screen-lg-min) {
535
+ margin-left: percentage(($columns / $grid-columns));
536
+ }
537
+ }
538
+ @mixin make-lg-column-push($columns) {
539
+ @media (min-width: $screen-lg-min) {
540
+ left: percentage(($columns / $grid-columns));
541
+ }
542
+ }
543
+ @mixin make-lg-column-pull($columns) {
544
+ @media (min-width: $screen-lg-min) {
545
+ right: percentage(($columns / $grid-columns));
546
+ }
547
+ }
548
+
549
+
550
+ // COMPONENT MIXINS
551
+ // --------------------------------------------------
552
+
553
+ // Color swatches grid
554
+ @mixin calc-color($first-color, $second-color) {
555
+ .palette-#{$first-color} {
556
+ background-color: interpolate_variable($first-color);
557
+ }
558
+ .palette-#{$second-color} {
559
+ background-color: interpolate_variable($second-color);
560
+ }
561
+ }
562
+
563
+ // Dropdown arrow
564
+ // -------------------------
565
+ @mixin dropdown-arrow($color: $brand-primary, $top: 5px, $left: 15px, $size: 9px) {
566
+ &:before {
567
+ content: "";
568
+ border-style: solid;
569
+ border-width: 0 $size $size $size;
570
+ border-color: transparent transparent $color transparent;
571
+ height: 0;
572
+ position: absolute;
573
+ left: $left;
574
+ top: $top;
575
+ width: 0;
576
+ // Make corners smooth
577
+ -webkit-transform: rotate(360deg);
578
+ }
579
+ }
580
+
581
+ // Button variants
582
+ // -------------------------
583
+ // Easily pump out default styles, as well as :hover, :focus, :active,
584
+ // and disabled options for all buttons
585
+ @mixin button-variant($color, $background, $hover-background, $active-background, $disabled-background: $gray-light) {
586
+ color: $color;
587
+ background-color: $background;
588
+
589
+ &:hover,
590
+ &:focus,
591
+ &:active,
592
+ &.active {
593
+ color: $color;
594
+ background-color: $hover-background;
595
+ border-color: $hover-background;
596
+ }
597
+ .open & { &.dropdown-toggle {
598
+ color: $color;
599
+ background-color: $hover-background;
600
+ border-color: $hover-background;
601
+ } }
602
+ &:active,
603
+ &.active {
604
+ background: $active-background;
605
+ border-color: $active-background;
606
+ }
607
+ .open & { &.dropdown-toggle {
608
+ background: $active-background;
609
+ border-color: $active-background;
610
+ } }
611
+ &.disabled,
612
+ &[disabled],
613
+ fieldset[disabled] & {
614
+ &,
615
+ &:hover,
616
+ &:focus,
617
+ &:active,
618
+ &.active {
619
+ background-color: $background;
620
+ border-color: $background;
621
+ }
622
+ }
623
+ }
624
+
625
+ // Button sizes
626
+ // -------------------------
627
+ @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
628
+ padding: $padding-vertical $padding-horizontal;
629
+ font-size: $font-size;
630
+ line-height: $line-height;
631
+ border-radius: $border-radius;
632
+ }
633
+
634
+ // Social button variants
635
+ // -------------------------
636
+ @mixin social-button-variant($color, $background) {
637
+ color: $color;
638
+ background-color: $background;
639
+
640
+ &:hover,
641
+ &:focus {
642
+ background-color: mix($background, white, 80%);
643
+ }
644
+ &:active,
645
+ &.active {
646
+ background-color: mix($background, black, 85%);
647
+ }
648
+ }
649
+
650
+ @mixin swap-dialog-color($color) {
651
+ background-color: mix($color, white, 9%);
652
+ border-top-color: mix($color, white, 20%);
653
+ }
654
+
655
+ .dropdown-arrow-inverse {
656
+ border-bottom-color: $brand-primary !important;
657
+ border-top-color: $brand-primary !important;
658
+ }
659
+
660
+ @mixin swap-iconbar-color($color) {
661
+ background-color: $color;
662
+ > ul {
663
+ > li {
664
+ &.active {
665
+ > a {
666
+ color: mix($color, black, 66%);
667
+ }
668
+ }
669
+ > a {
670
+ &:hover, &:focus {
671
+ color: mix($color, black, 66%);
672
+ }
673
+ }
674
+ }
675
+ }
676
+ .iconbar-unread { background-color: mix($color, black, 66%); }
677
+ }
678
+
679
+ @mixin swap-pagination-color($color, $hover, $active) {
680
+ ul {
681
+ background-color: $color;
682
+
683
+ li {
684
+ &.previous {
685
+ > a {
686
+ border-right-color: mix($color, white, 66%);
687
+ }
688
+ }
689
+ > a, > span {
690
+ border-left-color: mix($color, white, 66%);
691
+
692
+ &:hover, &:focus {
693
+ background-color: $hover;
694
+ }
695
+ &:active {
696
+ background-color: $active;
697
+ }
698
+ }
699
+ &.active {
700
+ > a, > span {
701
+ background-color: $active;
702
+ }
703
+ }
704
+
705
+ &.pagination-dropdown.dropup {
706
+ .dropdown-arrow {
707
+ border-top-color: $color;
708
+ }
709
+ }
710
+ }
711
+ }
712
+ }
713
+
714
+ // Labels
715
+ // -------------------------
716
+ @mixin label-variant($color, $hover-color, $text-color: $inverse) {
717
+ background-color: $color;
718
+ color: $text-color;
719
+
720
+ &[href] {
721
+ color: $text-color;
722
+
723
+ &:hover,
724
+ &:focus {
725
+ color: $text-color;
726
+ background-color: $hover-color;
727
+ }
728
+ }
729
+ }
730
+
731
+ // Contextual backgrounds
732
+ // -------------------------
733
+ // [converter] $parent hack
734
+ @mixin bg-variant($parent, $color) {
735
+ #{$parent} {
736
+ background-color: $color;
737
+ }
738
+ a#{$parent}:hover {
739
+ background-color: darken($color, 10%);
740
+ }
741
+ }
742
+
743
+ // Typography
744
+ // -------------------------
745
+ // [converter] $parent hack
746
+ @mixin text-emphasis-variant($parent, $color) {
747
+ #{$parent} {
748
+ color: $color;
749
+ }
750
+ a#{$parent}:hover {
751
+ color: mix($color, black, 80%);
752
+ }
753
+ }
754
+
755
+ // Navbar vertical align
756
+ // -------------------------
757
+ // Vertically center elements in the navbar.
758
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
759
+ @mixin navbar-vertical-align($element-height, $navbar-height: $navbar-height-base) {
760
+ padding-top: (($navbar-height - $element-height) / 2);
761
+ padding-bottom: (($navbar-height - $element-height) / 2);
762
+ }
763
+
764
+ // Form validation states
765
+ //
766
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
767
+ // and successes.
768
+
769
+ @mixin form-control-validation($text-color: $brand-primary, $border-color: $gray-light, $background-color: $inverse) {
770
+ // Color the label and help text
771
+ .help-block,
772
+ .control-label,
773
+ .radio,
774
+ .checkbox,
775
+ .radio-inline,
776
+ .checkbox-inline {
777
+ color: $text-color;
778
+ }
779
+ // Set the border and box shadow on specific inputs to match
780
+ .form-control {
781
+ color: $text-color;
782
+ border-color: $border-color;
783
+ @include box-shadow(none);
784
+ @include placeholder($text-color);
785
+
786
+ &:focus {
787
+ border-color: $border-color;
788
+ @include box-shadow(none);
789
+ }
790
+ }
791
+ // Set validation states also for addons
792
+ .input-group-addon {
793
+ color: $text-color;
794
+ border-color: $border-color;
795
+ background-color: $background-color;
796
+ }
797
+ }
798
+
799
+ // Form control focus state
800
+ //
801
+ // Generate a customized focus state and for any input with the specified color,
802
+ // which defaults to the `$input-focus-border` variable.
803
+ //
804
+ // We highly encourage you to not customize the default value, but instead use
805
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
806
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
807
+ // usability and accessibility should be taken into account with any change.
808
+ //
809
+ // Example usage: change the default blue border and shadow to white for better
810
+ // contrast against a dark gray background.
811
+
812
+ @mixin form-control-focus($color: $brand-secondary) {
813
+ .form-group.focus &,
814
+ &:focus {
815
+ border-color: $color;
816
+ outline: 0;
817
+ @include box-shadow(none);
818
+ }
819
+ }
820
+
821
+ // Form control sizing
822
+ //
823
+ // Relative text size, padding, and border-radii changes for form controls. For
824
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
825
+ // element gets special love because it's special, and that's a fact!
826
+
827
+ // [converter] $parent hack
828
+ @mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius: $border-radius-large) {
829
+ #{$parent} {
830
+ height: $input-height;
831
+ padding: $padding-vertical $padding-horizontal;
832
+ font-size: $font-size;
833
+ line-height: $line-height;
834
+ border-radius: $border-radius;
835
+ }
836
+
837
+ select#{$parent} {
838
+ height: $input-height;
839
+ line-height: $input-height;
840
+ }
841
+
842
+ textarea#{$parent},
843
+ select[multiple]#{$parent} {
844
+ height: auto;
845
+ }
846
+ }
847
+
848
+ // Reset rounded corners for form controls
849
+ //
850
+ @mixin form-controls-corners-reset() {
851
+ .input-group .form-control:first-child,
852
+ .input-group-addon:first-child,
853
+ .input-group-btn:first-child > .btn,
854
+ .input-group-btn:first-child > .dropdown-toggle,
855
+ .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
856
+ @include border-right-radius(0);
857
+ }
858
+ .input-group .form-control:last-child,
859
+ .input-group-addon:last-child,
860
+ .input-group-btn:last-child > .btn,
861
+ .input-group-btn:last-child > .dropdown-toggle,
862
+ .input-group-btn:first-child > .btn:not(:first-child) {
863
+ @include border-left-radius(0);
864
+ }
865
+ }
866
+
867
+ // Spinner variants
868
+ // -------------------------
869
+ @mixin spinner-variant($up-btn-height, $down-btn-height, $line-height) {
870
+ & + .ui-spinner-button {
871
+ height: $up-btn-height;
872
+ line-height: $line-height;
873
+ }
874
+ & + .ui-spinner-button + .ui-spinner-button {
875
+ height: $down-btn-height;
876
+ line-height: $line-height;
877
+ }
878
+ }