lato_view 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +35 -0
  3. data/app/assets/fonts/lato-bold-webfont.eot +0 -0
  4. data/app/assets/fonts/lato-bold-webfont.svg +4551 -0
  5. data/app/assets/fonts/lato-bold-webfont.ttf +0 -0
  6. data/app/assets/fonts/lato-bold-webfont.woff +0 -0
  7. data/app/assets/fonts/lato-bold-webfont.woff2 +0 -0
  8. data/app/assets/fonts/lato-regular-webfont.eot +0 -0
  9. data/app/assets/fonts/lato-regular-webfont.svg +4241 -0
  10. data/app/assets/fonts/lato-regular-webfont.ttf +0 -0
  11. data/app/assets/fonts/lato-regular-webfont.woff +0 -0
  12. data/app/assets/fonts/lato-regular-webfont.woff2 +0 -0
  13. data/app/assets/images/lato_view/icons/_arrow-down.svg +1 -0
  14. data/app/assets/images/lato_view/icons/_arrow-left.svg +1 -0
  15. data/app/assets/images/lato_view/icons/_arrow-right.svg +1 -0
  16. data/app/assets/images/lato_view/icons/_arrow-up.svg +1 -0
  17. data/app/assets/images/lato_view/icons/_artist.svg +1 -0
  18. data/app/assets/images/lato_view/icons/_artwork.svg +1 -0
  19. data/app/assets/images/lato_view/icons/_attachment.svg +1 -0
  20. data/app/assets/images/lato_view/icons/_calendar.svg +1 -0
  21. data/app/assets/images/lato_view/icons/_clients.svg +1 -0
  22. data/app/assets/images/lato_view/icons/_close.svg +1 -0
  23. data/app/assets/images/lato_view/icons/_download.svg +1 -0
  24. data/app/assets/images/lato_view/icons/_file.svg +1 -0
  25. data/app/assets/images/lato_view/icons/_google-plus.svg +1 -0
  26. data/app/assets/images/lato_view/icons/_home.svg +1 -0
  27. data/app/assets/images/lato_view/icons/_info.svg +1 -0
  28. data/app/assets/images/lato_view/icons/_instagram.svg +1 -0
  29. data/app/assets/images/lato_view/icons/_lato-logo.svg +1 -0
  30. data/app/assets/images/lato_view/icons/_linkedin.svg +1 -0
  31. data/app/assets/images/lato_view/icons/_list.svg +1 -0
  32. data/app/assets/images/lato_view/icons/_magni-glass.svg +1 -0
  33. data/app/assets/images/lato_view/icons/_mail.svg +1 -0
  34. data/app/assets/images/lato_view/icons/_minus.svg +1 -0
  35. data/app/assets/images/lato_view/icons/_modify.svg +1 -0
  36. data/app/assets/images/lato_view/icons/_percentage.svg +1 -0
  37. data/app/assets/images/lato_view/icons/_plus.svg +1 -0
  38. data/app/assets/images/lato_view/icons/_power.svg +1 -0
  39. data/app/assets/images/lato_view/icons/_settings.svg +1 -0
  40. data/app/assets/images/lato_view/icons/_sweet.svg +1 -0
  41. data/app/assets/images/lato_view/icons/_trash.svg +1 -0
  42. data/app/assets/images/lato_view/icons/_twitter.svg +1 -0
  43. data/app/assets/images/lato_view/icons/_upload.svg +1 -0
  44. data/app/assets/images/lato_view/icons/_user.svg +1 -0
  45. data/app/assets/images/lato_view/icons/_users.svg +1 -0
  46. data/app/assets/images/lato_view/icons/_warning.svg +1 -0
  47. data/app/assets/images/lato_view/icons/_web.svg +1 -0
  48. data/app/assets/images/lato_view/vendor/trumbowyg_icons.svg +1 -0
  49. data/app/assets/images/lato_view/work-in-progress/da-scegliere.svg +225 -0
  50. data/app/assets/images/lato_view/work-in-progress/social.svg +76 -0
  51. data/app/assets/javascripts/lato_view/application.js +68 -0
  52. data/app/assets/javascripts/lato_view/build/ActionBar.js +65 -0
  53. data/app/assets/javascripts/lato_view/build/Dropdown.js +33 -0
  54. data/app/assets/javascripts/lato_view/build/Flash.js +23 -0
  55. data/app/assets/javascripts/lato_view/build/FormManager.js +159 -0
  56. data/app/assets/javascripts/lato_view/build/Navigation.js +79 -0
  57. data/app/assets/javascripts/lato_view/build/Util.js +91 -0
  58. data/app/assets/javascripts/lato_view/build/Validator.js +235 -0
  59. data/app/assets/javascripts/lato_view/vendor/dropzone.min.js +2 -0
  60. data/app/assets/javascripts/lato_view/vendor/jquery.email-autocomplete.min.js +9 -0
  61. data/app/assets/javascripts/lato_view/vendor/modernizr.js +3 -0
  62. data/app/assets/javascripts/lato_view/vendor/moment.min.js +7 -0
  63. data/app/assets/javascripts/lato_view/vendor/picker-it_IT.js +1 -0
  64. data/app/assets/javascripts/lato_view/vendor/picker.date.js +5 -0
  65. data/app/assets/javascripts/lato_view/vendor/picker.js +7 -0
  66. data/app/assets/javascripts/lato_view/vendor/picker.time.js +5 -0
  67. data/app/assets/javascripts/lato_view/vendor/trumbowyg.js +1522 -0
  68. data/app/assets/stylesheets/lato_view/application.scss.erb +32 -0
  69. data/app/assets/stylesheets/lato_view/base/_base.scss +53 -0
  70. data/app/assets/stylesheets/lato_view/base/_helpers.scss +491 -0
  71. data/app/assets/stylesheets/lato_view/base/_media.scss +32 -0
  72. data/app/assets/stylesheets/lato_view/base/_reset.scss +424 -0
  73. data/app/assets/stylesheets/lato_view/base/_typography.scss +138 -0
  74. data/app/assets/stylesheets/lato_view/config/_config.scss +143 -0
  75. data/app/assets/stylesheets/lato_view/config/templates/_base-template.scss +158 -0
  76. data/app/assets/stylesheets/lato_view/config/templates/_black-template.scss +158 -0
  77. data/app/assets/stylesheets/lato_view/modules/_action-bar.scss +62 -0
  78. data/app/assets/stylesheets/lato_view/modules/_arranger.scss +10 -0
  79. data/app/assets/stylesheets/lato_view/modules/_button-group.scss +70 -0
  80. data/app/assets/stylesheets/lato_view/modules/_buttons.scss +177 -0
  81. data/app/assets/stylesheets/lato_view/modules/_content-block.scss +33 -0
  82. data/app/assets/stylesheets/lato_view/modules/_datepicker.scss +580 -0
  83. data/app/assets/stylesheets/lato_view/modules/_dropdown.scss +166 -0
  84. data/app/assets/stylesheets/lato_view/modules/_flash.scss +55 -0
  85. data/app/assets/stylesheets/lato_view/modules/_form-controls.scss +83 -0
  86. data/app/assets/stylesheets/lato_view/modules/_form.scss +297 -0
  87. data/app/assets/stylesheets/lato_view/modules/_modules.scss +19 -0
  88. data/app/assets/stylesheets/lato_view/modules/_navbar.scss +262 -0
  89. data/app/assets/stylesheets/lato_view/modules/_pagination.scss +30 -0
  90. data/app/assets/stylesheets/lato_view/modules/_search-bar.scss +44 -0
  91. data/app/assets/stylesheets/lato_view/modules/_select.scss +313 -0
  92. data/app/assets/stylesheets/lato_view/modules/_sidebar.scss +211 -0
  93. data/app/assets/stylesheets/lato_view/modules/_status.scss +39 -0
  94. data/app/assets/stylesheets/lato_view/modules/_table.scss +94 -0
  95. data/app/assets/stylesheets/lato_view/modules/_upload.scss +371 -0
  96. data/app/assets/stylesheets/lato_view/modules/_wyswyg.scss +755 -0
  97. data/app/assets/stylesheets/lato_view/views/_admin.scss +30 -0
  98. data/app/assets/stylesheets/lato_view/views/_grid.scss +448 -0
  99. data/app/assets/stylesheets/lato_view/views/_login.scss +152 -0
  100. data/app/assets/stylesheets/lato_view/views/_print.scss +41 -0
  101. data/app/assets/stylesheets/lato_view/views/_views.scss +48 -0
  102. data/app/concepts/lato_view/actionbar/cell.rb +65 -0
  103. data/app/concepts/lato_view/actionbar/views/show.html.erb +21 -0
  104. data/app/concepts/lato_view/block/cell.rb +52 -0
  105. data/app/concepts/lato_view/buttongroup/cell.rb +50 -0
  106. data/app/concepts/lato_view/buttongroup/views/show.html.erb +7 -0
  107. data/app/concepts/lato_view/dropdown/cell.rb +46 -0
  108. data/app/concepts/lato_view/dropdown/views/show.html.erb +19 -0
  109. data/app/concepts/lato_view/index/cell.rb +112 -0
  110. data/app/concepts/lato_view/index/views/head.html.erb +12 -0
  111. data/app/concepts/lato_view/index/views/rows.html.erb +49 -0
  112. data/app/concepts/lato_view/input/cell.rb +148 -0
  113. data/app/concepts/lato_view/input/views/checkbox.html.erb +8 -0
  114. data/app/concepts/lato_view/input/views/date.html.erb +5 -0
  115. data/app/concepts/lato_view/input/views/editor.html.erb +7 -0
  116. data/app/concepts/lato_view/input/views/email.html.erb +5 -0
  117. data/app/concepts/lato_view/input/views/file.html.erb +17 -0
  118. data/app/concepts/lato_view/input/views/multiple-select.html.erb +12 -0
  119. data/app/concepts/lato_view/input/views/number.html.erb +5 -0
  120. data/app/concepts/lato_view/input/views/password.html.erb +8 -0
  121. data/app/concepts/lato_view/input/views/radio.html.erb +10 -0
  122. data/app/concepts/lato_view/input/views/select.html.erb +12 -0
  123. data/app/concepts/lato_view/input/views/text.html.erb +5 -0
  124. data/app/concepts/lato_view/input/views/textarea.html.erb +5 -0
  125. data/app/concepts/lato_view/input/views/time.html.erb +5 -0
  126. data/app/concepts/lato_view/searchbar/cell.rb +63 -0
  127. data/app/concepts/lato_view/searchbar/views/show.html.erb +6 -0
  128. data/app/concepts/lato_view/table/cell.rb +88 -0
  129. data/app/concepts/lato_view/table/views/head.html.erb +9 -0
  130. data/app/concepts/lato_view/table/views/row.html.erb +7 -0
  131. data/app/concepts/lato_view/table/views/rows.html.erb +5 -0
  132. data/app/controllers/lato_view/assets_controller.rb +18 -0
  133. data/app/controllers/lato_view/develop_controller.rb +18 -0
  134. data/app/helpers/lato_view/application_helper.rb +22 -0
  135. data/app/views/lato_view/develop/home.html.erb +281 -0
  136. data/app/views/lato_view/icons/_arrowdown.svg +1 -0
  137. data/app/views/lato_view/icons/_arrowleft.svg +1 -0
  138. data/app/views/lato_view/icons/_arrowright.svg +1 -0
  139. data/app/views/lato_view/icons/_arrowup.svg +1 -0
  140. data/app/views/lato_view/icons/_artist.svg +1 -0
  141. data/app/views/lato_view/icons/_artwork.svg +1 -0
  142. data/app/views/lato_view/icons/_attachment.svg +1 -0
  143. data/app/views/lato_view/icons/_calendar.svg +1 -0
  144. data/app/views/lato_view/icons/_clients.svg +1 -0
  145. data/app/views/lato_view/icons/_close.svg +1 -0
  146. data/app/views/lato_view/icons/_download.svg +1 -0
  147. data/app/views/lato_view/icons/_file.svg +1 -0
  148. data/app/views/lato_view/icons/_googleplus.svg +1 -0
  149. data/app/views/lato_view/icons/_home.svg +1 -0
  150. data/app/views/lato_view/icons/_info.svg +1 -0
  151. data/app/views/lato_view/icons/_instagram.svg +1 -0
  152. data/app/views/lato_view/icons/_latologo.svg +1 -0
  153. data/app/views/lato_view/icons/_linkedin.svg +1 -0
  154. data/app/views/lato_view/icons/_list.svg +1 -0
  155. data/app/views/lato_view/icons/_magni-glass.svg +1 -0
  156. data/app/views/lato_view/icons/_mail.svg +1 -0
  157. data/app/views/lato_view/icons/_minus.svg +1 -0
  158. data/app/views/lato_view/icons/_modify.svg +1 -0
  159. data/app/views/lato_view/icons/_percentage.svg +1 -0
  160. data/app/views/lato_view/icons/_plus.svg +1 -0
  161. data/app/views/lato_view/icons/_power.svg +1 -0
  162. data/app/views/lato_view/icons/_settings.svg +1 -0
  163. data/app/views/lato_view/icons/_sweet.svg +1 -0
  164. data/app/views/lato_view/icons/_trash.svg +1 -0
  165. data/app/views/lato_view/icons/_twitter.svg +1 -0
  166. data/app/views/lato_view/icons/_upload.svg +1 -0
  167. data/app/views/lato_view/icons/_user.svg +1 -0
  168. data/app/views/lato_view/icons/_users.svg +1 -0
  169. data/app/views/lato_view/icons/_warning.svg +1 -0
  170. data/app/views/lato_view/icons/_web.svg +1 -0
  171. data/app/views/lato_view/layout/_flash.html.erb +5 -0
  172. data/app/views/lato_view/layout/_header.html.erb +31 -0
  173. data/app/views/lato_view/layout/_sidebar.html.erb +28 -0
  174. data/app/views/lato_view/layout/_strings.html.erb +8 -0
  175. data/app/views/layouts/lato_layout.html.erb +81 -0
  176. data/config/example.yml +19 -0
  177. data/config/initializers/assets.rb +5 -0
  178. data/config/initializers/init.rb +5 -0
  179. data/config/initializers/lists.rb +34 -0
  180. data/config/initializers/ram.rb +23 -0
  181. data/config/routes.rb +9 -0
  182. data/lib/lato_view/concepts.rb +19 -0
  183. data/lib/lato_view/engine.rb +23 -0
  184. data/lib/lato_view/interface/assets.rb +90 -0
  185. data/lib/lato_view/interface/images.rb +69 -0
  186. data/lib/lato_view/interface/navigation.rb +17 -0
  187. data/lib/lato_view/interface/themes.rb +37 -0
  188. data/lib/lato_view/interface.rb +19 -0
  189. data/lib/lato_view.rb +20 -0
  190. data/lib/tasks/lato_starter_tasks.rake +11 -0
  191. data/test/controllers/lato_view/api/v1/api_controller_test.rb +9 -0
  192. data/test/controllers/lato_view/application_controller_test.rb +9 -0
  193. data/test/controllers/lato_view/back/back_controller_test.rb +9 -0
  194. data/test/dummy/README.rdoc +28 -0
  195. data/test/dummy/Rakefile +6 -0
  196. data/test/dummy/app/assets/javascripts/application.js +13 -0
  197. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  198. data/test/dummy/app/controllers/application_controller.rb +5 -0
  199. data/test/dummy/app/helpers/application_helper.rb +2 -0
  200. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  201. data/test/dummy/bin/bundle +3 -0
  202. data/test/dummy/bin/rails +4 -0
  203. data/test/dummy/bin/rake +4 -0
  204. data/test/dummy/bin/setup +29 -0
  205. data/test/dummy/config/application.rb +25 -0
  206. data/test/dummy/config/boot.rb +5 -0
  207. data/test/dummy/config/database.yml +25 -0
  208. data/test/dummy/config/environment.rb +5 -0
  209. data/test/dummy/config/environments/development.rb +41 -0
  210. data/test/dummy/config/environments/production.rb +79 -0
  211. data/test/dummy/config/environments/test.rb +42 -0
  212. data/test/dummy/config/initializers/assets.rb +11 -0
  213. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  214. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  215. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  216. data/test/dummy/config/initializers/inflections.rb +16 -0
  217. data/test/dummy/config/initializers/mime_types.rb +4 -0
  218. data/test/dummy/config/initializers/session_store.rb +3 -0
  219. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  220. data/test/dummy/config/locales/en.yml +23 -0
  221. data/test/dummy/config/routes.rb +3 -0
  222. data/test/dummy/config/secrets.yml +22 -0
  223. data/test/dummy/config.ru +4 -0
  224. data/test/dummy/public/404.html +67 -0
  225. data/test/dummy/public/422.html +67 -0
  226. data/test/dummy/public/500.html +66 -0
  227. data/test/dummy/public/favicon.ico +0 -0
  228. data/test/integration/navigation_test.rb +8 -0
  229. data/test/lato_view_test.rb +7 -0
  230. data/test/test_helper.rb +21 -0
  231. metadata +453 -0
@@ -0,0 +1,32 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ */
14
+
15
+ // Jeet grid system
16
+ @import "jeet/_settings";
17
+ @import "jeet/_functions";
18
+ @import "jeet/_grid";
19
+
20
+ // Config files
21
+ @import "config/config.scss";
22
+
23
+ <% if view_getCurrentTemplateName %>
24
+ @import "config/templates/<%= view_getCurrentTemplateName %>-template.scss";
25
+ <% else %>
26
+ @import "config/templates/base-template.scss";
27
+ <% end %>
28
+
29
+ // Main Styles
30
+ @import "base/base.scss";
31
+ @import "modules/modules.scss";
32
+ @import "views/views.scss";
@@ -0,0 +1,53 @@
1
+ @import "helpers";
2
+ @import "reset";
3
+
4
+ /* BASE */
5
+
6
+ * {
7
+ &, &:before, &:after { box-sizing: border-box; }
8
+ }
9
+
10
+ html, body {
11
+ width: 100%;
12
+ height: 100%;
13
+ margin: 0;
14
+ padding: 0;
15
+ }
16
+
17
+ html {
18
+ position: relative;
19
+ }
20
+
21
+ body {
22
+ background: $body-bg;
23
+ color: $text-color;
24
+ font-size: $font-size-base;
25
+ font-family: $font-stack;
26
+ line-height: $line-base;
27
+ overflow: hidden;
28
+ -webkit-tap-highlight-color: transparent;
29
+ @if settings('use-font-smooth') {
30
+ -webkit-font-smoothing: antialiased;
31
+ -moz-osx-font-smoothing: grayscale;
32
+ }
33
+ }
34
+
35
+ // Selection colors
36
+ ::selection {
37
+ background: $selection-bg;
38
+ color: $selection-color;
39
+ text-shadow: none;
40
+ }
41
+
42
+ ::-webkit-selection {
43
+ background: $selection-bg;
44
+ color: $selection-color;
45
+ text-shadow: none;
46
+ }
47
+
48
+ img::selection {
49
+ background: transparent;
50
+ }
51
+
52
+ @import "typography";
53
+ @import "media";
@@ -0,0 +1,491 @@
1
+ // Strip the units from a value
2
+ @function strip-units($value) {
3
+ @return $value / ($value * 0 + 1);
4
+ }
5
+
6
+ // Calculate ems from a px value
7
+ @function em($px, $context: $em-base) {
8
+ @if not unitless($px) {
9
+ $px: strip-units($px);
10
+ }
11
+ @if not unitless($context) {
12
+ $context: strip-units($context);
13
+ }
14
+ @return ($px / $context) * 1em;
15
+ }
16
+
17
+ // Mix with black
18
+ @function _shade($color, $percent){
19
+ @return mix(black, $color, $percent);
20
+ }
21
+
22
+ // Mix with white
23
+ @function _tint($color, $percent){
24
+ @return mix(white, $color, $percent);
25
+ }
26
+
27
+ // Assets helper functions
28
+ @function _img($filename) {
29
+ @return url('../img/'#{$filename});
30
+ }
31
+
32
+ @function _icon($filename) {
33
+ @return url('../icons/'#{$filename});
34
+ }
35
+
36
+ // Managing Z-Layers & icon font names
37
+ @function z($layer: "base") {
38
+ @if not map-has-key($z-layers, $layer) {
39
+ @warn "No z-index found in $z-layers map for '#{$layer}'. Property omitted.";
40
+ }
41
+ @return map-get($z-layers, $layer);
42
+ }
43
+
44
+ // Assign every icon to its content value
45
+ @function icf($icon: null) {
46
+ @if not map-has-key($icons, $icon) {
47
+ @warn "No icon name found in $icons for '#{$icon}'. Property omitted.";
48
+ }
49
+ @return map-get($icons, $icon);
50
+ }
51
+
52
+ // Classic Clearfix
53
+ @mixin clearfix {
54
+ &:before, &:after {
55
+ content: " ";
56
+ display: table;
57
+ }
58
+ &:after {
59
+ clear: both;
60
+ }
61
+ }
62
+
63
+ @mixin position($type, $top: null, $right: null, $bottom: null, $left: null) {
64
+ position: $type;
65
+ $allowed_types: absolute relative fixed;
66
+ @if not index($allowed_types, $type) {
67
+ @warn "Unknown position: #{$type}.";
68
+ }
69
+ @each $data in top $top, right $right, bottom $bottom, left $left {
70
+ #{nth($data, 1)}: nth($data, 2);
71
+ }
72
+ }
73
+
74
+ // Quantity queries
75
+ // Find the last simple selector in a given selector
76
+ @function _last-simple-selector($selector) {
77
+ $parsed: selector-parse($selector);
78
+ @if length($parsed) > 1 {
79
+ @error '`#{$selector}` contains #{length($parsed)} selectors and the `_last-simple-selector()`function accepts only 1.';
80
+ }
81
+ $last-simple-selector: nth(nth($parsed, 1), -1);
82
+ @return $last-simple-selector;
83
+ }
84
+ // Builds the selector for the quantity query
85
+ @function _build-quantity-selector($selector-append, $last-selector) {
86
+ $quantity-selector: ();
87
+ @each $s in & {
88
+ $last-simple-selector: '~' + if($last-selector, $last-selector, _last-simple-selector($s));
89
+ $sel: selector-append($s, $selector-append);
90
+ $sel2: selector-nest($sel, $last-simple-selector);
91
+ $quantity-selector: append($quantity-selector, $sel, 'comma');
92
+ $quantity-selector: append($quantity-selector, $sel2 , 'comma');
93
+ }
94
+ @return $quantity-selector;
95
+ }
96
+
97
+ // Query when total items is at least N items
98
+ @mixin at-least($count, $selector: null) {
99
+ $selector-append: ':nth-last-child(n+#{$count})';
100
+ @if type-of($count) != 'number' or not unitless($count) or $count < 1 {
101
+ @error '`#{$count}` is not a valid number for `at-least`';
102
+ }
103
+ @if $selector != null and (type-of($selector) != 'string' or length($selector) > 1) {
104
+ @error '`#{$selector}` is not a valid selector for `at-least`';
105
+ }
106
+ $at-least-selector: _build-quantity-selector($selector-append, $selector);
107
+ @at-root #{$at-least-selector} {
108
+ @content;
109
+ }
110
+ }
111
+
112
+ // Query when total items is at most N items
113
+ @mixin at-most($count, $selector: null) {
114
+ $selector-append: ':nth-last-child(-n+#{$count}):first-child';
115
+ @if type-of($count) != 'number' or not unitless($count) or $count < 1 {
116
+ @error '`#{$count}` is not a valid number for `at-most`.';
117
+ }
118
+ @if $selector != null and (type-of($selector) != 'string' or length($selector) > 1) {
119
+ @error '`#{$selector}` is not a valid selector for `at-most`';
120
+ }
121
+ $at-most-selector: _build-quantity-selector($selector-append, $selector);
122
+ @at-root #{$at-most-selector} {
123
+ @content;
124
+ }
125
+ }
126
+
127
+ // Query when total items is at least X items and at most Y items
128
+ @mixin between($first, $last, $selector: null) {
129
+ $selector-append: ':nth-last-child(n+#{$first}):nth-last-child(-n+#{$last}):first-child';
130
+ @if type-of($first) != 'number' or not unitless($first) or $first < 1 {
131
+ @error '`#{$first}` is not a valid number for `between`';
132
+ }
133
+ @if type-of($last) != 'number' or not unitless($last) or $last < 1 {
134
+ @error '`#{$last}` is not a valid number for `between`';
135
+ }
136
+ @if $first > $last {
137
+ @error '#{$first} can´t be larger that #{$last} for `between`';
138
+ }
139
+ @if $selector != null and (type-of($selector) != 'string' or length($selector) > 1) {
140
+ @error '`#{$selector}` is not a valid selector for `between`';
141
+ }
142
+ $between-selector: _build-quantity-selector($selector-append, $selector);
143
+ @at-root #{$between-selector} {
144
+ @content;
145
+ }
146
+ }
147
+
148
+ // Query when total items is exactly N items
149
+ @mixin exactly($count, $selector: null) {
150
+ $selector-append: ':nth-last-child(#{$count}):first-child';
151
+ @if type-of($count) != 'number' or not unitless($count) or $count < 1 {
152
+ @error '`#{$count}` is not a valid number for `exactly`';
153
+ }
154
+ @if $selector != null and (type-of($selector) != 'string' or length($selector) > 1) {
155
+ @error '`#{$selector}` is not a valid selector for `exactly`';
156
+ }
157
+ $exactly-selector: _build-quantity-selector($selector-append, $selector);
158
+ @at-root #{$exactly-selector} {
159
+ @content;
160
+ }
161
+ }
162
+
163
+ // Visually hide but still accessible to screenreaders
164
+ @mixin visual-hide() {
165
+ clip: rect(1px, 1px, 1px, 1px);
166
+ height: 1px;
167
+ overflow: hidden;
168
+ position: absolute;
169
+ width: 1px;
170
+ }
171
+
172
+ @mixin visual-hide-off {
173
+ position: static;
174
+ height: auto;
175
+ width: auto;
176
+ overflow: visible;
177
+ clip: auto;
178
+ }
179
+
180
+ // Text hiding for image based text replacement.
181
+ // Higher performance than -9999px because it only renders
182
+ // the size of the actual text, not a full 9999px box.
183
+ @mixin hide-text() {
184
+ overflow: hidden;
185
+ text-indent: 100%;
186
+ white-space: nowrap;
187
+ }
188
+
189
+ // Text overflow
190
+ // Requires inline-block or block for proper styling
191
+ @mixin text-overflow($overflow: ellipsis) {
192
+ overflow: hidden;
193
+ text-overflow: $overflow;
194
+ white-space: nowrap;
195
+ }
196
+
197
+ @mixin bg($pos1: center, $pos2: center, $size: cover, $rep: no-repeat) {
198
+ background-position: $pos1 $pos2;
199
+ background-size: $size;
200
+ background-repeat: $rep
201
+ }
202
+
203
+ // Keeping text vertically centered at all screen sizes(Fixed Height)
204
+ // Apply on the parent. Requires inline-block on the child
205
+ @mixin pseudo-mid-align() {
206
+ &:before {
207
+ content: '';
208
+ display: inline-block;
209
+ height: 100%;
210
+ vertical-align: middle;
211
+ }
212
+ }
213
+
214
+ // Placeholder text
215
+ $pseudo-phprefix: "::-webkit-input-placeholder" "::-moz-placeholder" ":-ms-input-placeholder" "::placeholder";
216
+ @mixin placeholder {
217
+ @each $pseudo in $pseudo-phprefix {
218
+ @at-root #{&}#{$pseudo} {
219
+ @content
220
+ }
221
+ }
222
+ }
223
+
224
+ // Insert icon font through pseudo el
225
+ @mixin insertChar($char-name, $icf-name: $icon-font-name) {
226
+ font-family: $icf-name;
227
+ content: icf(#{$char-name});
228
+ @content;
229
+ }
230
+
231
+ // Sizing
232
+ @mixin size($width, $height: $width) {
233
+ width: $width;
234
+ height: $height;
235
+ }
236
+
237
+ @mixin centerer($width: null, $height: null) {
238
+ position: absolute;
239
+ top: 50%;
240
+ left: 50%;
241
+ @if not $width and not $height {
242
+ transform: translate(-50%, -50%);
243
+ } @else if $width and $height {
244
+ width: $width;
245
+ height: $height;
246
+ margin: -($width / 2) #{0 0} -($height / 2);
247
+ } @else if not $height {
248
+ width: $width;
249
+ margin-left: -($width / 2);
250
+ transform: translateY(-50%);
251
+ } @else {
252
+ height: $height;
253
+ margin-top: -($height / 2);
254
+ transform: translateX(-50%);
255
+ }
256
+ }
257
+
258
+ @mixin center-block() {
259
+ display: block;
260
+ float: none;
261
+ margin-left: auto;
262
+ margin-right: auto;
263
+ }
264
+
265
+ // Add a filter to the bg
266
+ @mixin filter($opacity: 0.3, $background: #000, $fixed: false) {
267
+ &:before {
268
+ @if $fixed == true {
269
+ position: fixed;
270
+ } @else {
271
+ position: absolute;
272
+ }
273
+ left: 0;
274
+ top: 0;
275
+ height: 100%;
276
+ width: 100%;
277
+ display: block;
278
+ content: " ";
279
+ background: $background;
280
+ opacity: $opacity;
281
+ transition: opacity 0.3s ease;
282
+ z-index: z("header");
283
+ }
284
+ }
285
+
286
+ @mixin list-unstyle() {
287
+ list-style: none;
288
+ margin: 0;
289
+ padding: 0;
290
+ }
291
+
292
+ @mixin list-inline() {
293
+ list-style: none;
294
+ margin: 0;
295
+ padding: 0;
296
+ li {
297
+ display: inline-block;
298
+ }
299
+ }
300
+
301
+ @mixin triangle($direction, $color: white, $size: 7px) {
302
+ width: 0;
303
+ height: 0;
304
+ @if $direction == 'up' {
305
+ border-left: $size solid transparent;
306
+ border-right: $size solid transparent;
307
+ border-bottom: $size solid $color;
308
+ } @else if $direction == 'right' {
309
+ border-top: $size solid transparent;
310
+ border-bottom: $size solid transparent;
311
+ border-left: $size solid $color;
312
+ } @else if $direction == 'down' {
313
+ border-left: $size solid transparent;
314
+ border-right: $size solid transparent;
315
+ border-top: $size solid $color;
316
+ } @else if $direction == 'left' {
317
+ border-top: $size solid transparent;
318
+ border-bottom: $size solid transparent;
319
+ border-right: $size solid $color;
320
+ } @else {
321
+ @error "Valore errato inserito per '#{$direction}'. ";
322
+ }
323
+ }
324
+
325
+ // Shorthand for border property
326
+ // @include border(1px, solid, red); // Apply to all four borders
327
+ // @include border(5px 0, solid, green); // vertical | horizontal
328
+ // @include border(2px 3px 5px, solid, blue); // border-top | horizontal | border-bottom
329
+ // @include border(2px 1em 0 25px, dotted, pink); // border-top | border-right | border-bottom | border-left
330
+
331
+ @mixin border($widths, $styles, $colors) {
332
+ @if type-of($widths) == 'number' and
333
+ type-of($styles) == 'string' and
334
+ type-of($colors) == 'color' {
335
+ border: $widths $styles $colors;
336
+ } @else if (type-of($widths) == 'list' or 'number') and
337
+ (type-of($styles) == 'list' or 'string') and
338
+ (type-of($colors) == 'list' or 'color') {
339
+
340
+ // Define border property placeholders
341
+ $border-top: ();
342
+ $border-right: ();
343
+ $border-bottom: ();
344
+ $border-left: ();
345
+
346
+ // Measure length of each argument value and
347
+ // append it to appropriate placeholder recursivly
348
+ @each $property in ($widths, $styles, $colors) {
349
+ @if length($property) == 1 {
350
+ $border-top: append($border-top, $property);
351
+ $border-right: append($border-right, $property);
352
+ $border-bottom: append($border-bottom, $property);
353
+ $border-left: append($border-left, $property);
354
+ } @else if length($property) == 2 {
355
+ $border-top: append($border-top, nth($property, 1));
356
+ $border-right: append($border-right, nth($property, 2));
357
+ $border-bottom: append($border-bottom, nth($property, 1));
358
+ $border-left: append($border-left, nth($property, 2));
359
+ } @else if length($property) == 3 {
360
+ $border-top: append($border-top, nth($property, 1));
361
+ $border-right: append($border-right, nth($property, 2));
362
+ $border-bottom: append($border-bottom, nth($property, 3));
363
+ $border-left: append($border-left, nth($property, 2));
364
+ } @else if length($property) == 4 {
365
+ $border-top: append($border-top, nth($property, 1));
366
+ $border-right: append($border-right, nth($property, 2));
367
+ $border-bottom: append($border-bottom, nth($property, 3));
368
+ $border-left: append($border-left, nth($property, 4));
369
+ } @else {
370
+ @warn "Invalid list length for border mixin arguments";
371
+ }
372
+ }
373
+
374
+ @each $border-property in ($border-top, $border-right, $border-bottom, $border-left) {
375
+ @if nth($border-property, 1) == 0 {
376
+ $border-property: nth($border-property, 1);
377
+ }
378
+ }
379
+
380
+ // Output generated properties
381
+ border-top: $border-top;
382
+ border-right: $border-right;
383
+ border-bottom: $border-bottom;
384
+ border-left: $border-left;
385
+ } @else {
386
+ @warn 'Check border mixin arguments';
387
+ }
388
+ }
389
+
390
+ @mixin gradient (
391
+ $bgColor, // background-color
392
+ $angle, // gradient angle
393
+ $gradientColor, // gradient color
394
+ $opacityStart, // opacity at start > 1 - 0
395
+ $opacityEnd // opacity at end > 1 - 0
396
+ ) {
397
+ background-color: $bgColor;
398
+ background-image: linear-gradient(
399
+ ($angle * 1deg),
400
+ rgba($gradientColor, $opacityStart),
401
+ rgba($gradientColor, $opacityEnd)
402
+ );
403
+ background-size: 100% 100%;
404
+ background-position: 0 0;
405
+ background-repeat: no-repeat;
406
+ }
407
+ // example
408
+ // @include gradient($purple-base, 180, $mint-base, 0.8, 0.6);
409
+
410
+ // Predefined gradients from http://mrmrs.io/gradients/
411
+ @mixin linear-gradient($type: 'aqua') {
412
+ @if $type == 'aqua' {
413
+ background: rgba(127,219,255,1);
414
+ background: linear-gradient(to bottom, rgba(127,219,255,1) 0%, rgba(82,140,163,1) 100%);
415
+ } @else if $type == 'blue' {
416
+ background: rgba(0,116,217,1);
417
+ background: linear-gradient(to bottom, rgba(0,116,217,1) 0%, rgba(0,65,122,1) 100%);
418
+ } @else if $type == 'navy' {
419
+ background: rgba(0,32,63,1);
420
+ background: linear-gradient(to bottom, rgba(0,32,63,1) 0%, rgba(0,10,20,1) 100%);
421
+ } @else if $type == 'teal' {
422
+ background: rgba(57,204,204,1);
423
+ background: linear-gradient(to bottom, rgba(57,204,204,1) 0%, rgba(34,122,122,1) 100%);
424
+ } @else if $type == 'lime' {
425
+ background: rgba(1,255,111,1);
426
+ background: linear-gradient(to bottom, rgba(1,255,111,1) 0%, rgba(2,163,72,1) 100%);
427
+ } @else if $type == 'orange' {
428
+ background: rgba(255,133,27,1);
429
+ background: linear-gradient(to bottom, rgba(255,133,27,1) 0%, rgba(255,80,27,1) 100%);
430
+ } @else if $type == 'red' {
431
+ background: rgba(246,46,36,1);
432
+ background: linear-gradient(to bottom, rgba(246,46,36,1) 0%, rgba(255,54,121,1) 100%);
433
+ } @else if $type == 'fuxia' {
434
+ background: rgba(240,18,188,1);
435
+ background: linear-gradient(to bottom, rgba(240,18,188,1) 0%, rgba(163,11,128,1) 100%);
436
+ } @else if $type == 'purple' {
437
+ background: rgba(176,13,201,1);
438
+ background: linear-gradient(to bottom, rgba(176,13,201,1) 0%, rgba(107,7,122,1) 100%);
439
+ } @else if $type == 'maroon' {
440
+ background: rgba(204,31,115,1);
441
+ background: linear-gradient(to bottom, rgba(204,31,115,1) 0%, rgba(133,20,75,1) 100%);
442
+ } @else {
443
+ @warn 'Check gradient mixin arguments';
444
+ }
445
+ }
446
+
447
+ // Write currencies the right way
448
+ %currency {
449
+ position: relative;
450
+ &:before {
451
+ content: '$';
452
+ position: relative;
453
+ left: 0;
454
+ }
455
+ }
456
+ .usd %currency:before {
457
+ content: '$';
458
+ }
459
+ .eur %currency:before {
460
+ content: '\20AC';
461
+ }
462
+
463
+ // Media Query Mixins
464
+ @mixin mq($minWidth, $maxWidth) {
465
+ @media only screen and (min-width: em($minWidth)) and (max-width: em($maxWidth)) {
466
+ @content;
467
+ }
468
+ }
469
+
470
+ @mixin mq-max($maxWidth) {
471
+ @media only screen and (max-width: em($maxWidth)) {
472
+ @content;
473
+ }
474
+ }
475
+
476
+ @mixin mq-min($minWidth) {
477
+ @media only screen and (min-width: em($minWidth)) {
478
+ @content;
479
+ }
480
+ }
481
+
482
+ // HiDPI mixin
483
+ @mixin mq-hidpi($ratio: 2) {
484
+ @media only screen and (-webkit-min-device-pixel-ratio: $ratio),
485
+ only screen and (min--moz-device-pixel-ratio: $ratio),
486
+ only screen and (-o-min-device-pixel-ratio: #{$ratio}/1),
487
+ only screen and (min-resolution: round($ratio * 96dpi)),
488
+ only screen and (min-resolution: $ratio * 1dppx) {
489
+ @content;
490
+ }
491
+ }
@@ -0,0 +1,32 @@
1
+ /* Media elements */
2
+ // Responsive Media Elements
3
+
4
+ img, picture, video, audio, embed, object, input, iframe {
5
+ max-width: 100%;
6
+ margin: 0;
7
+ }
8
+
9
+ img {
10
+ display: inline-block;
11
+ vertical-align: middle;
12
+ border: 0;
13
+ -ms-interpolation-mode: bicubic;
14
+ // Fix for SVGs
15
+ &[src*=".svg"] {
16
+ width: 100% \9;
17
+ }
18
+
19
+ // prevents border/background on linked image hover
20
+ a:hover & {
21
+ border: none;
22
+ background: none;
23
+ }
24
+ }
25
+
26
+ x::-ms-reveal, img[src*=".svg"] {
27
+ width: 100%;
28
+ }
29
+
30
+ a img {
31
+ border: none;
32
+ }