sb-styleguide 0.0.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/.codoopts +10 -0
  2. data/.env +1 -0
  3. data/.gitignore +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +10 -3
  6. data/Gemfile.lock +134 -94
  7. data/Procfile +1 -0
  8. data/README.md +3 -5
  9. data/Rakefile +3 -0
  10. data/app/assets/images/layouts/basic-marketing-site.png +0 -0
  11. data/app/assets/images/layouts/jumbotron-site.png +0 -0
  12. data/app/assets/javascripts/base.js.coffee +3 -0
  13. data/app/assets/javascripts/grids.js.coffee +3 -0
  14. data/app/assets/javascripts/javascript.js.coffee +3 -0
  15. data/app/assets/javascripts/modules.js.coffee +3 -0
  16. data/app/assets/stylesheets/application-old-ie.css.scss +11 -0
  17. data/app/assets/stylesheets/application.css.scss +33 -30
  18. data/app/assets/stylesheets/base/_all.scss +6 -0
  19. data/app/assets/stylesheets/base/_reset.css.scss +16 -0
  20. data/app/assets/stylesheets/base/_type.scss +16 -0
  21. data/app/assets/stylesheets/{coderay_githubish.css.scss → modules/_coderay.css.scss} +40 -0
  22. data/app/assets/stylesheets/modules/_layout_examples.css.scss +13 -0
  23. data/app/assets/stylesheets/modules/_webfont_table.css.scss +47 -0
  24. data/app/assets/stylesheets/vanilla-normal-old-ie.css.scss +11 -0
  25. data/app/assets/stylesheets/vanilla-normal.css.scss +33 -0
  26. data/app/controllers/application_controller.rb +2 -0
  27. data/app/controllers/base_controller.rb +52 -0
  28. data/app/controllers/grids_controller.rb +48 -0
  29. data/app/controllers/javascript_controller.rb +20 -0
  30. data/app/controllers/modules_controller.rb +43 -0
  31. data/app/helpers/styleguide_helper.rb +33 -0
  32. data/app/views/base/_webfonts_social_standard.html +429 -0
  33. data/app/views/base/_webfonts_ss_standard.html +2413 -0
  34. data/app/views/base/buttons.html.haml +20 -0
  35. data/app/views/base/forms.html.haml +40 -0
  36. data/app/views/base/images.html.haml +1 -0
  37. data/app/views/base/index.html.haml +68 -0
  38. data/app/views/base/labels.html.haml +22 -0
  39. data/app/views/base/lists.html.haml +20 -0
  40. data/app/views/base/webfonts.html.haml +17 -0
  41. data/app/views/grids/index.html.haml +73 -0
  42. data/app/views/grids/layouts.html.haml +9 -0
  43. data/app/views/grids/layouts/basic-marketing-site.haml +69 -0
  44. data/app/views/grids/layouts/jumbotron-site.haml +92 -0
  45. data/app/views/layouts/_main_nav.html.haml +6 -6
  46. data/app/views/layouts/application.html.haml +6 -32
  47. data/app/views/modules/alerts.html.haml +12 -0
  48. data/app/views/modules/footer.html.haml +2 -0
  49. data/app/views/modules/index.html.haml +5 -0
  50. data/app/views/modules/nav.html.haml +12 -0
  51. data/app/views/modules/panels.html.haml +3 -0
  52. data/app/views/modules/tabs.html.haml +58 -0
  53. data/app/views/old_javascript/close.html.haml +2 -0
  54. data/app/views/old_javascript/forms.html.haml +2 -0
  55. data/app/views/old_javascript/ga_events.html.haml +2 -0
  56. data/app/views/old_javascript/index.html.haml +2 -0
  57. data/app/views/old_javascript/responsive_resize.html.haml +2 -0
  58. data/app/views/old_javascript/switch.html.haml +2 -0
  59. data/app/views/parts/base/_button.haml +3 -0
  60. data/app/views/parts/base/_button_colours.haml +4 -0
  61. data/app/views/parts/base/_button_group.haml +4 -0
  62. data/app/views/parts/base/_button_sizing.haml +3 -0
  63. data/app/views/parts/base/_button_states.haml +3 -0
  64. data/app/views/parts/base/_form_example.haml +26 -0
  65. data/app/views/parts/base/_form_example_horizontal.haml +26 -0
  66. data/app/views/parts/base/_form_group.haml +10 -0
  67. data/app/views/parts/base/_form_location.haml +3 -0
  68. data/app/views/parts/base/_labels.haml +5 -0
  69. data/app/views/parts/base/_labels_sizing.haml +3 -0
  70. data/app/views/parts/base/_list.haml +10 -0
  71. data/app/views/parts/base/_list_action.haml +5 -0
  72. data/app/views/parts/base/_list_nav.haml +12 -0
  73. data/app/views/parts/base/_list_unset.haml +10 -0
  74. data/app/views/parts/base/_type_body.haml +2 -0
  75. data/app/views/parts/base/_type_headings.haml +5 -0
  76. data/app/views/parts/base/_type_helpers.haml +3 -0
  77. data/app/views/parts/base/_type_links.haml +9 -0
  78. data/app/views/parts/base/_type_shouts.haml +4 -0
  79. data/app/views/parts/grids/_example_layout_1.haml +10 -0
  80. data/app/views/parts/grids/_live_grid.haml +29 -0
  81. data/app/views/parts/modules/_alerts.haml +11 -0
  82. data/app/views/parts/modules/_nav_footer.haml +34 -0
  83. data/app/views/parts/modules/_nav_header.haml +18 -0
  84. data/app/views/parts/modules/_panels.haml +9 -0
  85. data/app/views/parts/modules/_tabs_minimal.haml +11 -0
  86. data/app/views/parts/modules/_tabs_simple_group.haml +11 -0
  87. data/app/views/parts/modules/_tabs_simple_group_toggle.haml +11 -0
  88. data/app/views/parts/modules/_tabs_toggle.haml +5 -0
  89. data/app/views/parts/modules/_tabs_traditional.haml +11 -0
  90. data/app/views/shared/_title.html.haml +8 -0
  91. data/app/views/shared/_ui_nav.html.haml +5 -0
  92. data/app/views/ui/typography.html.haml +86 -96
  93. data/lib/sb-styleguide.rb +1 -1
  94. data/lib/sb-styleguide/version.rb +1 -1
  95. data/lib/templates/haml/scaffold/_form.html.haml +8 -0
  96. data/public/javascripts/LICENSE.html +158 -0
  97. data/public/javascripts/README.md.html +164 -0
  98. data/public/javascripts/assets/codo.css +1 -0
  99. data/public/javascripts/assets/codo.js +21 -0
  100. data/public/javascripts/assets/search_data.js +1 -0
  101. data/public/javascripts/class_index.html +215 -0
  102. data/public/javascripts/class_list.html +58 -0
  103. data/public/javascripts/classes/Close.html +259 -0
  104. data/public/javascripts/classes/GAEvent.html +231 -0
  105. data/public/javascripts/classes/ResizeHandler.html +225 -0
  106. data/public/javascripts/classes/Switch.html +318 -0
  107. data/public/javascripts/classes/TBGForm.html +373 -0
  108. data/public/javascripts/extra_list.html +36 -0
  109. data/public/javascripts/file_list.html +74 -0
  110. data/public/javascripts/files/styleguide/plugins/tbg-close.js.coffee.html +160 -0
  111. data/public/javascripts/files/styleguide/plugins/tbg-forms.js.coffee.html +160 -0
  112. data/public/javascripts/files/styleguide/plugins/tbg-ga-events.js.coffee.html +160 -0
  113. data/public/javascripts/files/styleguide/plugins/tbg-respinsiveresize.js.coffee.html +160 -0
  114. data/public/javascripts/files/styleguide/plugins/tbg-switch.js.coffee.html +160 -0
  115. data/public/javascripts/index.html +14 -0
  116. data/public/javascripts/method_list.html +187 -0
  117. data/public/javascripts/mixin_list.html +28 -0
  118. data/vendor/assets/javascripts/styleguide/plugins/doc/assets/codo.css +1 -0
  119. data/vendor/assets/javascripts/styleguide/plugins/doc/assets/codo.js +21 -0
  120. data/vendor/assets/javascripts/styleguide/plugins/doc/assets/search_data.js +1 -0
  121. data/vendor/assets/javascripts/styleguide/plugins/doc/class_index.html +194 -0
  122. data/vendor/assets/javascripts/styleguide/plugins/doc/class_list.html +58 -0
  123. data/vendor/assets/javascripts/styleguide/plugins/doc/classes/Close.html +215 -0
  124. data/vendor/assets/javascripts/styleguide/plugins/doc/classes/GAEvent.html +235 -0
  125. data/vendor/assets/javascripts/styleguide/plugins/doc/classes/ResizeHandler.html +192 -0
  126. data/vendor/assets/javascripts/styleguide/plugins/doc/classes/Switch.html +233 -0
  127. data/vendor/assets/javascripts/styleguide/plugins/doc/classes/TBGForm.html +318 -0
  128. data/vendor/assets/javascripts/styleguide/plugins/doc/extra_list.html +30 -0
  129. data/vendor/assets/javascripts/styleguide/plugins/doc/file_list.html +58 -0
  130. data/vendor/assets/javascripts/styleguide/plugins/doc/files/tbg-close.js.coffee.html +154 -0
  131. data/vendor/assets/javascripts/styleguide/plugins/doc/files/tbg-forms.js.coffee.html +154 -0
  132. data/vendor/assets/javascripts/styleguide/plugins/doc/files/tbg-ga-events.js.coffee.html +154 -0
  133. data/vendor/assets/javascripts/styleguide/plugins/doc/files/tbg-respinsiveresize.js.coffee.html +154 -0
  134. data/vendor/assets/javascripts/styleguide/plugins/doc/files/tbg-switch.js.coffee.html +154 -0
  135. data/vendor/assets/javascripts/styleguide/plugins/doc/index.html +14 -0
  136. data/vendor/assets/javascripts/styleguide/plugins/doc/method_list.html +163 -0
  137. data/vendor/assets/javascripts/styleguide/plugins/doc/mixin_list.html +28 -0
  138. data/vendor/assets/javascripts/styleguide/plugins/tbg-close.js.coffee +28 -4
  139. data/vendor/assets/javascripts/styleguide/plugins/tbg-forms.js.coffee +52 -5
  140. data/vendor/assets/javascripts/styleguide/plugins/tbg-ga-events.js.coffee +28 -8
  141. data/vendor/assets/javascripts/styleguide/plugins/tbg-respinsiveresize.js.coffee +21 -2
  142. data/vendor/assets/javascripts/styleguide/plugins/tbg-switch.js.coffee +37 -2
  143. data/vendor/assets/stylesheets/_mixins.css.scss +128 -35
  144. data/vendor/assets/stylesheets/_settings.css.scss +7 -4
  145. data/vendor/assets/stylesheets/styleguide/base/_labels.css.scss +22 -6
  146. data/vendor/assets/stylesheets/styleguide/base/_lists.css.scss +23 -18
  147. data/vendor/assets/stylesheets/styleguide/base/_type.css.scss +11 -5
  148. data/vendor/assets/stylesheets/styleguide/grid/_grid.css.scss +9 -9
  149. data/vendor/assets/stylesheets/styleguide/modules/_switch.css.scss +32 -16
  150. metadata +134 -18
  151. data/.rvmrc +0 -1
  152. data/app/helpers/application_helper.rb +0 -13
  153. data/app/helpers/javascripts_helper.rb +0 -2
  154. data/app/helpers/ui_helper.rb +0 -2
  155. data/app/mailers/.gitkeep +0 -0
  156. data/app/models/.gitkeep +0 -0
  157. data/app/views/javascripts/_js_nav.html.haml +0 -5
  158. data/app/views/javascripts/index.html.haml +0 -45
  159. data/app/views/type/_headings.haml +0 -6
  160. data/app/views/type/_paragraphs.haml +0 -4
  161. data/app/views/ui/_ui_nav.html.haml +0 -13
  162. data/vendor/assets/stylesheets/styleguide/layout/_all.css.scss +0 -5
  163. data/vendor/plugins/.gitkeep +0 -0
@@ -17,30 +17,45 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- # Useage:
21
- # ========================
22
- #
23
- # HAML> %a{:href=>"#clickyclick", :class=>"btn", :data=> {:gaevent=>"category|action|opt_label|opt_value|opt_noninteraction"}}
24
- # See: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
25
-
26
20
  plugin = ($)->
27
21
 
28
22
  "use strict"
29
23
 
30
24
  # GAEVENT CLASS DEFINITION
31
- # =========================
25
+ #
26
+ # @example How to use with Haml
27
+ # %a{ :href => '/some/link', :class => 'btn', :data => { :gaevent => 'category|action|opt_label|opt_value|opt_noninteraction' } }
28
+ # # See: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
29
+ #
30
+ # @example How to ensure plugin self initialises on element
31
+ # <form data-gaevent-load="true"> ... </form>
32
+ #
32
33
  class GAEvent
34
+
35
+ # Construct a GAEvent instance - split the event content string and pass to sendEvent
36
+ #
37
+ # @param [Object] element HTMLElement
38
+ # @param [String] eventcontent Pipe delimited string of event content
39
+ #
33
40
  constructor: ( element, @eventcontent ) ->
34
41
  $el = $(element)
35
42
  @sendEvent (if typeof eventcontent.split('|') isnt "array" then eventcontent.split('|') else [eventcontent])
36
43
 
37
44
  _constructor: GAEvent
38
45
 
46
+ # Send the event to Google Analytics
47
+ #
48
+ # @param [Array] data If Google Analytics _gaq array defined then push data array after inserting '_trackEvent' string at beginning of data array
49
+ #
39
50
  sendEvent : (data)->
40
51
  data.unshift('_trackEvent')
41
52
  _gaq?.push data
42
53
 
43
- # Private method
54
+ # Remove data and data attributes from jQuery object
55
+ #
56
+ # @param [Object] $el jQuery wrapped HTMLElement from which to remove data
57
+ # @param [String] ev Data string to be removed
58
+ #
44
59
  removeData = ( $el, ev )->
45
60
  $el.removeAttr('data-' + ev)
46
61
  $el.removeData(ev)
@@ -63,6 +78,11 @@ plugin = ($)->
63
78
  # DATA API
64
79
  # ===================================
65
80
 
81
+ # On document ready, delegate a click handler on the body for 'click.gaEvent.data-api'
82
+ # event with target of '[data-gaevent]' and attach plugin; attach a handler for
83
+ # 'tbgform-success.gaEvent.data-api' event and attach plugin; attach plugin to each
84
+ # element with '[data-gaevent-load]' attribute
85
+ #
66
86
  $ ->
67
87
 
68
88
  $('body').on 'click.gaEvent.data-api', '[data-gaevent]' , ( e ) ->
@@ -25,22 +25,41 @@ plugin = ($)->
25
25
 
26
26
  "use strict"
27
27
 
28
+ # RESIZEHANDLER CLASS DEFINITION
29
+ #
30
+ # @example How to use the class
31
+ # resizeHandlerInstance = new ResizeHandler()
32
+ #
28
33
  class ResizeHandler
34
+
35
+ # Construct a new ResizeHandler instance
36
+ #
37
+ # Create resizeEvent method to trigger 'responsiveResize' event with current size
38
+ #
29
39
  constructor: ->
30
40
  $window = $(window)
31
41
  @resizeEvent = =>
32
42
  $window.trigger 'responsiveResize', @size()
33
43
  @resizeTimer = null
34
44
 
35
-
45
+ # Set a timeout to call resizeEvent after 100ms, clearing existing timeout if one set
46
+ #
36
47
  resize: ->
37
48
  if @resizeTimer then clearTimeout @resizeTimer
38
49
  @resizeTimer = setTimeout @resizeEvent, 100
39
50
 
51
+ # Get a string representation of grid name
52
+ #
53
+ # Grid name set in CSS content on body::after pseudo-element
54
+ #
55
+ # @return [String] Grid name if available or empty string
56
+ #
40
57
  size: ->
41
58
  if not window.getComputedStyle? then return ''
42
59
  window.getComputedStyle(document.body,':after').getPropertyValue('content').replace('-','') || ''
43
-
60
+
61
+ # Create instance of ResizeHandler on document ready, call resize() on window 'resize' event
62
+ #
44
63
  $ ->
45
64
  resizeHandler = new ResizeHandler()
46
65
  $(window).on 'resize', ()=> resizeHandler.resize()
@@ -21,8 +21,24 @@ plugin = ($)->
21
21
  "use strict"
22
22
 
23
23
  # SWITCH CLASS DEFINITION
24
- # =========================
24
+ #
25
+ # @example How to ensure plugin self initialises on element
26
+ # <div data-switch="true"> ... </div>
27
+ #
28
+ # @example How to group switches and allow them to change state of other switches in that group
29
+ # <div data-switch-group="[group name]"> ... </div>
30
+ #
31
+ # @example How to toggle switch state
32
+ # <div data-switch-toggle="true"> ... </div>
33
+ #
25
34
  class Switch
35
+
36
+ # Construct a new Switch instance
37
+ #
38
+ # Set this.parent, this.target, this.group and this.container elements for this.el; set this.toggle if attribute present
39
+ #
40
+ # @param [Object] el HTMLElement, this.el, that acts as the switch
41
+ #
26
42
  constructor: ( @el ) ->
27
43
  @parent = if (parent = @el.parent('li')).length then parent else @el.parent()
28
44
  @content = @_getContent @el
@@ -32,8 +48,11 @@ plugin = ($)->
32
48
 
33
49
  activeClass: "is-active"
34
50
 
35
- _constructor: Switch
51
+ _constructor: Switch
36
52
 
53
+ # Click handler - If this.parent isn't active, close group if this.group defined and change state to true;
54
+ # if this.parent is active and this.toggle set then change state to false otherwise return undefined
55
+ #
37
56
  click: ->
38
57
  if @parent.hasClass(@activeClass)
39
58
  if @toggle then return @changeStateTo false else return
@@ -42,14 +61,30 @@ plugin = ($)->
42
61
 
43
62
  @changeStateTo true
44
63
 
64
+ # Change active state of target content - add or remove activeClass from content and parent elements
65
+ #
66
+ # @param [Boolean] action true to addClass to elements, false to removeClass from elements
67
+ # @param [Array] elements array of jQuery wrapped HTMLElements - target content element and parent element
68
+ #
45
69
  changeStateTo: (action, elements = [@content, @parent]) ->
46
70
  el["#{if action then "add" else "remove"}Class"] @activeClass for el in elements
47
71
 
72
+ # Close group - if any content is active, get the target for that element's descendant link element and pass false and
73
+ # elements array [activeContent, activeEl] to switch group
74
+ #
75
+ # @private
76
+ #
48
77
  _closeGroup: ->
49
78
  if (activeEl = @container.find("li.#{@activeClass}")).length
50
79
  activeContent = @_getContent activeEl.children('a')
51
80
  @changeStateTo false, [activeContent, activeEl]
52
81
 
82
+ # Get target element to do switch on
83
+ #
84
+ # @private
85
+ # @param [Object] el jQuery wrapped HTMLElement to get target element from
86
+ # @return [Object] jQuery wrapped HTMLElement for el's target element
87
+ #
53
88
  _getContent: ( el ) ->
54
89
  $(el.attr 'href')
55
90
 
@@ -3,6 +3,41 @@
3
3
  // @author Ad Taylor
4
4
  //
5
5
 
6
+ // ==========================================================================
7
+ // Column helper
8
+ // For each grid, output conditional display classes, within media queries if appropriate
9
+ // ==========================================================================
10
+
11
+ @mixin create-conditional-classes($grids) {
12
+ @each $grid in $grids {
13
+ $grid-name: nth($grid, 1);
14
+
15
+ @each $nested-grid in $grids {
16
+ $nested-grid-name: nth($nested-grid, 1);
17
+
18
+ @include is-responsive($nested-grid){
19
+ @include conditional-display($grid-name, $nested-grid-name);
20
+ }
21
+ }
22
+ }
23
+ }
24
+
25
+ // ==========================================================================
26
+ // Column helper
27
+ // Abstract the conditional display classes from @mixin create-conditional-classes
28
+ // ==========================================================================
29
+
30
+ @mixin conditional-display($grid-name, $nested-grid-name){
31
+ @if($grid-name == $nested-grid-name) {
32
+ .#{$grid-name}hide{display:none !important}
33
+ .#{$grid-name}only{display:block !important}
34
+ }
35
+ @else {
36
+ .#{$grid-name}hide{display:block !important}
37
+ .#{$grid-name}only{display:none !important}
38
+ }
39
+ }
40
+
6
41
  // ==========================================================================
7
42
  // Create column sizes
8
43
  // ==========================================================================
@@ -12,41 +47,35 @@
12
47
  @each $grid in $grids {
13
48
  // If there is a media query
14
49
  @if(length($grid) == 1){}
15
- @else if(length($grid) == $query-pos) {
16
-
17
- .#{nth($grid,1)}only {
18
- display: none !important;
19
- }
20
-
21
- // Add Rules wrapped in media query
22
- @include media-query( nth($grid,$query-pos)) {
50
+ @else if(length($grid) >= $query-pos) {
51
+ @include media-query($grid) {
23
52
  @include build-column-size($grid);
24
- .#{nth($grid,1)}only {
25
- display: block !important;
26
- }
27
-
28
- .#{nth($grid,1)}hide {
29
- display: none !important;
30
- }
31
53
  }
32
54
  }
33
55
  @else {
34
56
  @include build-column-size($grid);
35
57
  }
36
58
  }
59
+ @include create-conditional-classes($grids);
37
60
  }
38
61
 
62
+ // ==========================================================================
63
+ // Build column size
64
+ // ==========================================================================
65
+
39
66
  @mixin build-column-size($grid) {
40
67
  $padding-pos: 3;
41
68
  $total-columns: nth($grid,2);
69
+
42
70
  @if(length($grid) >= $padding-pos ) {
43
71
  .column {
44
72
  padding: 0 (0.5 * nth($grid,$padding-pos));
45
- @if($total-columns == 1){
46
- float: none;
47
- width: auto;
48
- right: auto;
49
- left: auto;
73
+ @if($total-columns > 1){
74
+ float: left;
75
+ width: 100%;
76
+ & + &:last-child {
77
+ float: right;
78
+ }
50
79
  }
51
80
  }
52
81
  }
@@ -70,8 +99,6 @@
70
99
  right: 0;
71
100
  }
72
101
  }
73
-
74
-
75
102
  }
76
103
 
77
104
  // ==========================================================================
@@ -79,20 +106,20 @@
79
106
  // ==========================================================================
80
107
 
81
108
  @mixin conditional-CSS($grids) {
82
- $query-pos: 4;
109
+ $query-pos: 5;
83
110
 
84
111
  @each $grid in $grids {
85
112
  @if(length($grid) < $query-pos){
86
113
  body:after {
87
- content: nth($grid,1);;
114
+ content: nth($grid,1);
88
115
  display: none;
89
116
  }
90
117
  }
91
118
  @else {
92
- @include media-query( nth($grid,$query-pos)) {
119
+ @include media-query($grid) {
93
120
  body:after {
94
- content: nth($grid,1);;
95
- display: none;
121
+ content:nth($grid, 1);
122
+ display:none;
96
123
  }
97
124
  }
98
125
  }
@@ -103,9 +130,14 @@
103
130
  // Simple Media Query Generator
104
131
  // ==========================================================================
105
132
 
106
- @mixin media-query($size) {
107
- @media ($size) {
108
- @content;
133
+ @mixin media-query($gridObj) {
134
+ @if length($gridObj) > 3 {
135
+ $queryType: nth($gridObj, 4);
136
+ $querySize: nth($gridObj, 5);
137
+
138
+ @include respond-to($queryType, $querySize) {
139
+ @content;
140
+ }
109
141
  }
110
142
  }
111
143
 
@@ -167,14 +199,75 @@
167
199
 
168
200
  // ==========================================================================
169
201
  // Smallest query
202
+ // Output within a media query for the smallest breakpoint
203
+ // @param [Boolean] $ie-override - if true and $old-ie true, output regularly
170
204
  // ==========================================================================
171
205
 
172
- @mixin smallest-query {
173
- $query-position: 4;
174
- $length: length($grids);
175
- $mobile: nth($grids, $length);
206
+ @mixin smallest-query($ie-override: false) {
207
+ @if length($grids) > 1 {
208
+ $length: length($grids);
209
+ $mobile: nth($grids, 2);
210
+
211
+ @include media-query($mobile) {
212
+ @content;
213
+ }
214
+ }
215
+ // If old IE and override both set,
216
+ // output without query
217
+ @if $old-ie and $ie-override {
218
+ @content;
219
+ }
220
+ }
221
+
222
+ // ==========================================================================
223
+ // Is Responsive? - helper
224
+ // Pass in content to be conditionally output either in a media query or by default
225
+ // ==========================================================================
176
226
 
177
- @include media-query( nth($mobile,$query-position)) {
227
+ @mixin is-responsive($grid){
228
+ @if length($grid) > 3 {
229
+ @include media-query($grid){
230
+ @content;
231
+ }
232
+ }
233
+ @else {
178
234
  @content;
179
235
  }
180
236
  }
237
+
238
+ // ==========================================================================
239
+ // Respond to - helper
240
+ // If IE has a fixed query ($fixed-mqs) set, output it by default, otherwise output media query
241
+ // ==========================================================================
242
+
243
+ @mixin respond-to($query, $size) {
244
+ @if $fixed-mqs {
245
+ @if $query == "max" {
246
+ @if $container-width == $size {
247
+ @content;
248
+ }
249
+ }
250
+ @else if $query == "min" {
251
+ @if $container-width == $size {
252
+ @content;
253
+ }
254
+ }
255
+ }
256
+ @else {
257
+ // output normally
258
+ @media ("#{$query}-width: #{$size}") {
259
+ @content;
260
+ }
261
+ }
262
+ }
263
+
264
+ // ==========================================================================
265
+ // Old IE
266
+ // If old IE version (7,8) output IE only styles
267
+ // ==========================================================================
268
+
269
+ @mixin old-ie {
270
+ @if $old-ie {
271
+ @content;
272
+ }
273
+ }
@@ -13,13 +13,16 @@ $container-max-width: 100% !default;
13
13
  $container-min-width: 320px !default;
14
14
 
15
15
  $columns: 12 !default;
16
- $column-gutter: 10px !default;
16
+ $column-gutter: 20px !default;
17
17
 
18
18
 
19
- $mob: 'mobile-', 1, 20px, "max-width: 780px" ;
20
- $desk: '', $columns, $column-gutter;
19
+ $mob: 'mobile-', 1, 20px;
20
+ $desk: '', $columns, $column-gutter, "min", $container-width;
21
21
 
22
- $grids : $desk, $mob !default;
22
+ $grids : $mob, $desk !default;
23
+
24
+ $fixed-mqs: false !default;
25
+ $old-ie: false !default;
23
26
 
24
27
  // ==========================================================================
25
28
  // Colour Functions
@@ -4,6 +4,23 @@
4
4
  //
5
5
  @import "compass/css3";
6
6
 
7
+ // ==========================================================================
8
+ // Label colouring in
9
+ // ==========================================================================
10
+
11
+ @mixin label-color($color, $hover-color, $txt-color, $hover-txt-color: false) {
12
+ background-color: $color;
13
+ color: $txt-color;
14
+
15
+ &:hover, &.is-active {
16
+ background-color: $hover-color;
17
+ @if $hover-txt-color {
18
+ color: $hover-txt-color;
19
+ } @else {
20
+ color: $txt-color;
21
+ }
22
+ }
23
+ }
7
24
 
8
25
  // ==========================================================================
9
26
  // Default alert
@@ -17,9 +34,7 @@
17
34
 
18
35
  @include border-radius( ms(0)/4 );
19
36
 
20
- background-color: mono(2);
21
-
22
- color: $white;
37
+ @include label-color( mono(2), mono(3) , $white);
23
38
  @extend small;
24
39
  line-height: 1;
25
40
  text-align: center;
@@ -28,15 +43,16 @@
28
43
 
29
44
  /* Label colors */
30
45
  &.orange {
31
- background-color: orange();
46
+ @include label-color( orange(), orange(2), $white );
32
47
  }
33
48
 
34
49
  &.blue {
35
- background-color: blue();
50
+ @include label-color( blue(), blue(2), $white );
36
51
  }
37
52
 
38
53
  &.green {
39
- background-color: green();
54
+ @include label-color( green(), green(2), $white);
40
55
  }
41
56
 
42
57
  }
58
+