plinth 0.0.1.beta.1
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.
- data/.codoopts +10 -0
- data/.env +1 -0
- data/.gitignore +23 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +1 -0
- data/Capfile +4 -0
- data/Gemfile +52 -0
- data/Gemfile.lock +243 -0
- data/Guardfile +9 -0
- data/LICENSE +22 -0
- data/Procfile +1 -0
- data/README.md +79 -0
- data/Rakefile +35 -0
- data/app/assets/images/layouts/basic-marketing-site.png +0 -0
- data/app/assets/images/layouts/jumbotron-site.png +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/javascripts/application.js +17 -0
- data/app/assets/javascripts/base.js.coffee +3 -0
- data/app/assets/javascripts/grids.js.coffee +3 -0
- data/app/assets/javascripts/javascript.js.coffee +3 -0
- data/app/assets/javascripts/lib/modernizr.js +4 -0
- data/app/assets/javascripts/modules.js.coffee +3 -0
- data/app/assets/stylesheets/application-old-ie.css.scss +10 -0
- data/app/assets/stylesheets/application.css.scss +57 -0
- data/app/assets/stylesheets/base/_all.scss +6 -0
- data/app/assets/stylesheets/base/_reset.css.scss +16 -0
- data/app/assets/stylesheets/base/_type.scss +16 -0
- data/app/assets/stylesheets/modules/_coderay.css.scss +171 -0
- data/app/assets/stylesheets/modules/_layout_examples.css.scss +13 -0
- data/app/assets/stylesheets/modules/_webfont_table.css.scss +47 -0
- data/app/assets/stylesheets/vanilla-normal-old-ie.css.scss +11 -0
- data/app/assets/stylesheets/vanilla-normal.css.scss +33 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/base_controller.rb +52 -0
- data/app/controllers/grids_controller.rb +48 -0
- data/app/controllers/javascript_controller.rb +20 -0
- data/app/controllers/javascripts_controller.rb +4 -0
- data/app/controllers/modules_controller.rb +43 -0
- data/app/controllers/ui_controller.rb +2 -0
- data/app/helpers/plinth_helper.rb +33 -0
- data/app/views/base/_webfonts_social_standard.html +429 -0
- data/app/views/base/_webfonts_ss_standard.html +2413 -0
- data/app/views/base/buttons.html.haml +20 -0
- data/app/views/base/forms.html.haml +40 -0
- data/app/views/base/images.html.haml +20 -0
- data/app/views/base/index.html.haml +68 -0
- data/app/views/base/labels.html.haml +22 -0
- data/app/views/base/lists.html.haml +20 -0
- data/app/views/base/webfonts.html.haml +17 -0
- data/app/views/grids/index.html.haml +73 -0
- data/app/views/grids/layouts/basic-marketing-site.haml +69 -0
- data/app/views/grids/layouts/jumbotron-site.haml +92 -0
- data/app/views/grids/layouts.html.haml +9 -0
- data/app/views/layouts/_main_nav.html.haml +15 -0
- data/app/views/layouts/application.html.haml +15 -0
- data/app/views/modules/alerts.html.haml +12 -0
- data/app/views/modules/footer.html.haml +2 -0
- data/app/views/modules/index.html.haml +5 -0
- data/app/views/modules/nav.html.haml +12 -0
- data/app/views/modules/panels.html.haml +3 -0
- data/app/views/modules/tabs.html.haml +58 -0
- data/app/views/old_javascript/close.html.haml +2 -0
- data/app/views/old_javascript/forms.html.haml +2 -0
- data/app/views/old_javascript/ga_events.html.haml +2 -0
- data/app/views/old_javascript/index.html.haml +2 -0
- data/app/views/old_javascript/responsive_resize.html.haml +2 -0
- data/app/views/old_javascript/switch.html.haml +2 -0
- data/app/views/parts/base/_button.haml +3 -0
- data/app/views/parts/base/_button_colours.haml +4 -0
- data/app/views/parts/base/_button_group.haml +4 -0
- data/app/views/parts/base/_button_sizing.haml +3 -0
- data/app/views/parts/base/_button_states.haml +3 -0
- data/app/views/parts/base/_form_example.haml +26 -0
- data/app/views/parts/base/_form_example_horizontal.haml +26 -0
- data/app/views/parts/base/_form_group.haml +10 -0
- data/app/views/parts/base/_form_location.haml +3 -0
- data/app/views/parts/base/_labels.haml +5 -0
- data/app/views/parts/base/_labels_sizing.haml +3 -0
- data/app/views/parts/base/_list.haml +10 -0
- data/app/views/parts/base/_list_action.haml +5 -0
- data/app/views/parts/base/_list_nav.haml +12 -0
- data/app/views/parts/base/_list_unset.haml +10 -0
- data/app/views/parts/base/_type_body.haml +2 -0
- data/app/views/parts/base/_type_headings.haml +5 -0
- data/app/views/parts/base/_type_helpers.haml +3 -0
- data/app/views/parts/base/_type_links.haml +9 -0
- data/app/views/parts/base/_type_shouts.haml +4 -0
- data/app/views/parts/grids/_example_layout_1.haml +10 -0
- data/app/views/parts/grids/_live_grid.haml +29 -0
- data/app/views/parts/modules/_alerts.haml +11 -0
- data/app/views/parts/modules/_nav_footer.haml +34 -0
- data/app/views/parts/modules/_nav_header.haml +18 -0
- data/app/views/parts/modules/_panels.haml +9 -0
- data/app/views/parts/modules/_tabs_minimal.haml +11 -0
- data/app/views/parts/modules/_tabs_simple_group.haml +11 -0
- data/app/views/parts/modules/_tabs_simple_group_toggle.haml +11 -0
- data/app/views/parts/modules/_tabs_toggle.haml +5 -0
- data/app/views/parts/modules/_tabs_traditional.haml +11 -0
- data/app/views/shared/_placeholder_text.html.haml +1 -0
- data/app/views/shared/_title.html.haml +8 -0
- data/app/views/shared/_ui_nav.html.haml +5 -0
- data/app/views/ui/alert.html.haml +35 -0
- data/app/views/ui/buttons.html.haml +116 -0
- data/app/views/ui/footer.html.haml +69 -0
- data/app/views/ui/forms/_vertical_form.haml +7 -0
- data/app/views/ui/forms.html.haml +59 -0
- data/app/views/ui/grids.html.haml +18 -0
- data/app/views/ui/index.html.haml +5 -0
- data/app/views/ui/labels.html.haml +15 -0
- data/app/views/ui/modules/panel.html.haml +3 -0
- data/app/views/ui/nav.html.haml +48 -0
- data/app/views/ui/tabs.html.haml +171 -0
- data/app/views/ui/typography.html.haml +118 -0
- data/db/development.sqlite3 +0 -0
- data/db/seeds.rb +7 -0
- data/doc/README_FOR_APP +2 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/plinth/version.rb +3 -0
- data/lib/plinth.rb +11 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/templates/haml/scaffold/_form.html.haml +8 -0
- data/log/.gitkeep +0 -0
- data/plinth.gemspec +33 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +25 -0
- data/public/favicon.ico +0 -0
- data/public/javascripts/LICENSE.html +158 -0
- data/public/javascripts/README.md.html +163 -0
- data/public/javascripts/assets/codo.css +1 -0
- data/public/javascripts/assets/codo.js +21 -0
- data/public/javascripts/assets/search_data.js +1 -0
- data/public/javascripts/class_index.html +215 -0
- data/public/javascripts/class_list.html +58 -0
- data/public/javascripts/classes/Close.html +259 -0
- data/public/javascripts/classes/GAEvent.html +231 -0
- data/public/javascripts/classes/ResizeHandler.html +225 -0
- data/public/javascripts/classes/Switch.html +318 -0
- data/public/javascripts/classes/TBGForm.html +373 -0
- data/public/javascripts/extra_list.html +36 -0
- data/public/javascripts/file_list.html +74 -0
- data/public/javascripts/files/styleguide/plugins/tbg-close.js.coffee.html +160 -0
- data/public/javascripts/files/styleguide/plugins/tbg-forms.js.coffee.html +160 -0
- data/public/javascripts/files/styleguide/plugins/tbg-ga-events.js.coffee.html +160 -0
- data/public/javascripts/files/styleguide/plugins/tbg-respinsiveresize.js.coffee.html +160 -0
- data/public/javascripts/files/styleguide/plugins/tbg-switch.js.coffee.html +160 -0
- data/public/javascripts/index.html +14 -0
- data/public/javascripts/method_list.html +187 -0
- data/public/javascripts/mixin_list.html +28 -0
- data/public/robots.txt +5 -0
- data/script/rails +6 -0
- data/spec/javascripts/fixtures/plugins/tbg-close_fixture.html.haml +4 -0
- data/spec/javascripts/fixtures/plugins/tbg-forms_fixture.html.haml +12 -0
- data/spec/javascripts/fixtures/plugins/tbg-ga-events_fixture.html.haml +9 -0
- data/spec/javascripts/fixtures/plugins/tbg-switch_fixture.html.haml +11 -0
- data/spec/javascripts/plugins/tbg-close_spec.js.coffee +54 -0
- data/spec/javascripts/plugins/tbg-forms_spec.js.coffee +87 -0
- data/spec/javascripts/plugins/tbg-ga-events_spec.js.coffee +83 -0
- data/spec/javascripts/plugins/tbg-switch_spec.js.coffee +96 -0
- data/spec/javascripts/spec.js.coffee +2 -0
- data/vendor/assets/fonts/ss-social-circle.eot +0 -0
- data/vendor/assets/fonts/ss-social-circle.svg +139 -0
- data/vendor/assets/fonts/ss-social-circle.ttf +0 -0
- data/vendor/assets/fonts/ss-social-circle.woff +0 -0
- data/vendor/assets/fonts/ss-social-regular.eot +0 -0
- data/vendor/assets/fonts/ss-social-regular.svg +133 -0
- data/vendor/assets/fonts/ss-social-regular.ttf +0 -0
- data/vendor/assets/fonts/ss-social-regular.woff +0 -0
- data/vendor/assets/fonts/ss-social.js +75 -0
- data/vendor/assets/fonts/ss-standard.eot +0 -0
- data/vendor/assets/fonts/ss-standard.js +75 -0
- data/vendor/assets/fonts/ss-standard.svg +207 -0
- data/vendor/assets/fonts/ss-standard.ttf +0 -0
- data/vendor/assets/fonts/ss-standard.woff +0 -0
- data/vendor/assets/images/background.png +0 -0
- data/vendor/assets/images/logos/sb-logo-white.png +0 -0
- data/vendor/assets/images/logos/sb-logo-white.svg +5 -0
- data/vendor/assets/images/middleman.png +0 -0
- data/vendor/assets/index.html.haml +8 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/javascripts/plinth/lib/handlebars.js +3 -0
- data/vendor/assets/javascripts/plinth/lib/jquery.fitvids.js +81 -0
- data/vendor/assets/javascripts/plinth/lib/ss-social.js +75 -0
- data/vendor/assets/javascripts/plinth/lib/ss-standard.js +78 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/assets/codo.css +1 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/assets/codo.js +21 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/assets/search_data.js +1 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/class_index.html +194 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/class_list.html +58 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/classes/Close.html +215 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/classes/GAEvent.html +235 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/classes/ResizeHandler.html +192 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/classes/Switch.html +233 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/classes/TBGForm.html +318 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/extra_list.html +30 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/file_list.html +58 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/files/tbg-close.js.coffee.html +154 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/files/tbg-forms.js.coffee.html +154 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/files/tbg-ga-events.js.coffee.html +154 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/files/tbg-respinsiveresize.js.coffee.html +154 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/files/tbg-switch.js.coffee.html +154 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/index.html +14 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/method_list.html +163 -0
- data/vendor/assets/javascripts/plinth/plugins/doc/mixin_list.html +28 -0
- data/vendor/assets/javascripts/plinth/plugins/tbg-close.js.coffee +97 -0
- data/vendor/assets/javascripts/plinth/plugins/tbg-forms.js.coffee +156 -0
- data/vendor/assets/javascripts/plinth/plugins/tbg-ga-events.js.coffee +107 -0
- data/vendor/assets/javascripts/plinth/plugins/tbg-respinsiveresize.js.coffee +73 -0
- data/vendor/assets/javascripts/plinth/plugins/tbg-switch.js.coffee +121 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/_functions.scss +28 -0
- data/vendor/assets/stylesheets/_mixins.css.scss +273 -0
- data/vendor/assets/stylesheets/_settings.css.scss +120 -0
- data/vendor/assets/stylesheets/plinth/base/_all.css.scss +7 -0
- data/vendor/assets/stylesheets/plinth/base/_buttons.css.scss +166 -0
- data/vendor/assets/stylesheets/plinth/base/_form.css.scss +196 -0
- data/vendor/assets/stylesheets/plinth/base/_labels.css.scss +58 -0
- data/vendor/assets/stylesheets/plinth/base/_lists.css.scss +57 -0
- data/vendor/assets/stylesheets/plinth/base/_reset.css.scss +284 -0
- data/vendor/assets/stylesheets/plinth/base/_type.css.scss +328 -0
- data/vendor/assets/stylesheets/plinth/base/webfonts/_all.css.scss +2 -0
- data/vendor/assets/stylesheets/plinth/base/webfonts/ss-social.css.scss +57 -0
- data/vendor/assets/stylesheets/plinth/base/webfonts/ss-standard.css.scss +48 -0
- data/vendor/assets/stylesheets/plinth/grid/_grid.css.scss +127 -0
- data/vendor/assets/stylesheets/plinth/modules/_alert.css.scss +71 -0
- data/vendor/assets/stylesheets/plinth/modules/_all-grid.css.scss +1 -0
- data/vendor/assets/stylesheets/plinth/modules/_all-no-grid.css.scss +4 -0
- data/vendor/assets/stylesheets/plinth/modules/_footer.css.scss +93 -0
- data/vendor/assets/stylesheets/plinth/modules/_nav.css.scss +106 -0
- data/vendor/assets/stylesheets/plinth/modules/_panel.css.scss +28 -0
- data/vendor/assets/stylesheets/plinth/modules/_switch.css.scss +88 -0
- data/vendor/assets/stylesheets/plinth.css.scss +15 -0
- data/vendor/assets/views/buttons/_buttons.haml +9 -0
- data/vendor/assets/views/forms/_vertical_form.haml +7 -0
- data/vendor/assets/views/type/_headings.haml +6 -0
- data/vendor/assets/views/type/_paragraphs.haml +4 -0
- metadata +537 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# TBG switch v0.0.1
|
|
3
|
+
# ============================================================
|
|
4
|
+
# Copyright 2012 The Beans Group
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
plugin = ($)->
|
|
20
|
+
|
|
21
|
+
"use strict"
|
|
22
|
+
|
|
23
|
+
# SWITCH CLASS DEFINITION
|
|
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
|
+
#
|
|
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
|
+
#
|
|
42
|
+
constructor: ( @el ) ->
|
|
43
|
+
@parent = if (parent = @el.parent('li')).length then parent else @el.parent()
|
|
44
|
+
@content = @_getContent @el
|
|
45
|
+
@toggle = @el.attr('data-switch-toggle')?
|
|
46
|
+
@group = if ( groupName = @el.attr('data-switch-group') ) then $("[data-switch-group='#{groupName}']")
|
|
47
|
+
@container = @el.closest 'ul'
|
|
48
|
+
|
|
49
|
+
activeClass: "is-active"
|
|
50
|
+
|
|
51
|
+
_constructor: Switch
|
|
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
|
+
#
|
|
56
|
+
click: ->
|
|
57
|
+
if @parent.hasClass(@activeClass)
|
|
58
|
+
if @toggle then return @changeStateTo false else return
|
|
59
|
+
|
|
60
|
+
@_closeGroup() if @group
|
|
61
|
+
|
|
62
|
+
@changeStateTo true
|
|
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
|
+
#
|
|
69
|
+
changeStateTo: (action, elements = [@content, @parent]) ->
|
|
70
|
+
el["#{if action then "add" else "remove"}Class"] @activeClass for el in elements
|
|
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
|
+
#
|
|
77
|
+
_closeGroup: ->
|
|
78
|
+
if (activeEl = @container.find("li.#{@activeClass}")).length
|
|
79
|
+
activeContent = @_getContent activeEl.children('a')
|
|
80
|
+
@changeStateTo false, [activeContent, activeEl]
|
|
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
|
+
#
|
|
88
|
+
_getContent: ( el ) ->
|
|
89
|
+
$(el.attr 'href')
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# SWITCH PLUGIN DEFINITION
|
|
94
|
+
# ==========================
|
|
95
|
+
|
|
96
|
+
$.fn.switch = ( option ) ->
|
|
97
|
+
this.each ->
|
|
98
|
+
$this = $(@)
|
|
99
|
+
data = $this.data 'switchPlugin'
|
|
100
|
+
if !data then $this.data 'switchPlugin', (data = new Switch $this)
|
|
101
|
+
if typeof option is 'string' then data[option]()
|
|
102
|
+
|
|
103
|
+
$.fn.switch.Constructor = Switch
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# DATA API
|
|
107
|
+
# ===================================
|
|
108
|
+
|
|
109
|
+
$ ->
|
|
110
|
+
$('body').on 'click.switch.data-api', '[data-switch]', ( e ) ->
|
|
111
|
+
$el = if (el = $(e.target)).is('a') then el else el.closest('a')
|
|
112
|
+
$el.switch('click')
|
|
113
|
+
e.preventDefault()
|
|
114
|
+
|
|
115
|
+
do ( plugin ) ->
|
|
116
|
+
if typeof define is 'function' and define.amd
|
|
117
|
+
# AMD. Register as an anonymous module.
|
|
118
|
+
define(['jquery'], plugin);
|
|
119
|
+
else
|
|
120
|
+
# Browser globals
|
|
121
|
+
plugin(jQuery)
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SASS Functions
|
|
3
|
+
// @author Ad Taylor
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// ==========================================================================
|
|
8
|
+
// Convert number to word - https://github.com/zurb/foundation/blob/master/scss/foundation/functions/_convert-number-to-word.scss
|
|
9
|
+
// ==========================================================================
|
|
10
|
+
|
|
11
|
+
@function convert-number-to-word($num) {
|
|
12
|
+
$count:1;
|
|
13
|
+
@each $word in one,two,three,four,five,six,seven,eight,nine,ten,eleven,
|
|
14
|
+
twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,
|
|
15
|
+
twenty,twentyone,twentytwo,twentythree,twentyfour{
|
|
16
|
+
@if ($count == $num) { @return $word; }
|
|
17
|
+
$count: $count + 1;
|
|
18
|
+
}
|
|
19
|
+
@return "invalid";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ========================================================================
|
|
23
|
+
// Grid Calculation for Percentages - https://github.com/zurb/foundation/blob/master/scss/foundation/functions/_grid-calc.scss
|
|
24
|
+
// ========================================================================
|
|
25
|
+
|
|
26
|
+
@function gridCalc($colNumber, $totalColumns) {
|
|
27
|
+
@return percentage(($colNumber / $totalColumns));
|
|
28
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Mixins to help reduce verbose repeating markup
|
|
3
|
+
// @author Ad Taylor
|
|
4
|
+
//
|
|
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
|
+
|
|
41
|
+
// ==========================================================================
|
|
42
|
+
// Create column sizes
|
|
43
|
+
// ==========================================================================
|
|
44
|
+
|
|
45
|
+
@mixin create-column-sizes($grids) {
|
|
46
|
+
$query-pos: 4;
|
|
47
|
+
@each $grid in $grids {
|
|
48
|
+
// If there is a media query
|
|
49
|
+
@if(length($grid) == 1){}
|
|
50
|
+
@else if(length($grid) >= $query-pos) {
|
|
51
|
+
@include media-query($grid) {
|
|
52
|
+
@include build-column-size($grid);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@else {
|
|
56
|
+
@include build-column-size($grid);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
@include create-conditional-classes($grids);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ==========================================================================
|
|
63
|
+
// Build column size
|
|
64
|
+
// ==========================================================================
|
|
65
|
+
|
|
66
|
+
@mixin build-column-size($grid) {
|
|
67
|
+
$padding-pos: 3;
|
|
68
|
+
$total-columns: nth($grid,2);
|
|
69
|
+
|
|
70
|
+
@if(length($grid) >= $padding-pos ) {
|
|
71
|
+
.column {
|
|
72
|
+
padding: 0 (0.5 * nth($grid,$padding-pos));
|
|
73
|
+
@if($total-columns > 1){
|
|
74
|
+
float: left;
|
|
75
|
+
width: 100%;
|
|
76
|
+
& + &:last-child {
|
|
77
|
+
float: right;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@if($total-columns > 1) {
|
|
84
|
+
@for $i from 1 through $total-columns {
|
|
85
|
+
.#{nth($grid,1)}#{convert-number-to-word($i)} {
|
|
86
|
+
width: gridCalc($i, $total-columns);
|
|
87
|
+
}
|
|
88
|
+
.#{nth($grid,1)}push-#{convert-number-to-word($i)} {
|
|
89
|
+
left: gridCalc($i, $total-columns);
|
|
90
|
+
}
|
|
91
|
+
.#{nth($grid,1)}pull-#{convert-number-to-word($i)} {
|
|
92
|
+
right: gridCalc($i, $total-columns);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.#{nth($grid,1)}push-none {
|
|
96
|
+
left: 0;
|
|
97
|
+
}
|
|
98
|
+
.#{nth($grid,1)}pull-none {
|
|
99
|
+
right: 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ==========================================================================
|
|
105
|
+
// Conditional CSS - JS Detection
|
|
106
|
+
// ==========================================================================
|
|
107
|
+
|
|
108
|
+
@mixin conditional-CSS($grids) {
|
|
109
|
+
$query-pos: 5;
|
|
110
|
+
|
|
111
|
+
@each $grid in $grids {
|
|
112
|
+
@if(length($grid) < $query-pos){
|
|
113
|
+
body:after {
|
|
114
|
+
content: nth($grid,1);
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
@else {
|
|
119
|
+
@include media-query($grid) {
|
|
120
|
+
body:after {
|
|
121
|
+
content:nth($grid, 1);
|
|
122
|
+
display:none;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ==========================================================================
|
|
130
|
+
// Simple Media Query Generator
|
|
131
|
+
// ==========================================================================
|
|
132
|
+
|
|
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
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ==========================================================================
|
|
145
|
+
// Micro Clearfix - Nicolas Gallagher
|
|
146
|
+
// ==========================================================================
|
|
147
|
+
|
|
148
|
+
@mixin clearfix() { *zoom:1;
|
|
149
|
+
&:before, &:after { content: ""; display: table; }
|
|
150
|
+
&:after { clear: both; }
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ==========================================================================
|
|
154
|
+
// Internet Explorer Fixes
|
|
155
|
+
// ==========================================================================
|
|
156
|
+
|
|
157
|
+
// IE7 inline-block ~ twitter bootstrap
|
|
158
|
+
|
|
159
|
+
@mixin ie7-inline-block {
|
|
160
|
+
*display: inline;
|
|
161
|
+
*zoom: 1;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// IE7 likes to collapse whitespace on either side of the inline-block elements.
|
|
165
|
+
// Ems because we're attempting to match the width of a space character. Left
|
|
166
|
+
// version is for form buttons, which typically come after other elements, and
|
|
167
|
+
// right version is for icons, which come before. Applying both is ok, but it will
|
|
168
|
+
// mean that space between those elements will be .6em (~2 space characters) in IE7,
|
|
169
|
+
// instead of the 1 space in other browsers. ~ twitter bootstrap
|
|
170
|
+
|
|
171
|
+
@mixin ie7-restore-left-whitespace {
|
|
172
|
+
*margin-left: .3em;
|
|
173
|
+
|
|
174
|
+
&:first-child {
|
|
175
|
+
*margin-left: 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ==========================================================================
|
|
180
|
+
// Accessibility
|
|
181
|
+
// ==========================================================================
|
|
182
|
+
|
|
183
|
+
@mixin set-focus {
|
|
184
|
+
outline: 3px solid yellow;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
// ==========================================================================
|
|
189
|
+
// Uncle Dave's Ol' Padded Box
|
|
190
|
+
// ==========================================================================
|
|
191
|
+
|
|
192
|
+
@mixin ol-padded-box($ratioW, $ratioH) {
|
|
193
|
+
background-size: cover;
|
|
194
|
+
height: 0;
|
|
195
|
+
display: block;
|
|
196
|
+
padding-bottom: 0% + ($ratioH/$ratioW)*100;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
// ==========================================================================
|
|
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
|
|
204
|
+
// ==========================================================================
|
|
205
|
+
|
|
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
|
+
// ==========================================================================
|
|
226
|
+
|
|
227
|
+
@mixin is-responsive($grid){
|
|
228
|
+
@if length($grid) > 3 {
|
|
229
|
+
@include media-query($grid){
|
|
230
|
+
@content;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
@else {
|
|
234
|
+
@content;
|
|
235
|
+
}
|
|
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
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Site wide settings
|
|
3
|
+
// $author Ad Taylor
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
// ==========================================================================
|
|
7
|
+
// Grids
|
|
8
|
+
// ==========================================================================
|
|
9
|
+
|
|
10
|
+
$setBoxSizing: true !default;
|
|
11
|
+
$container-width: 960px !default;
|
|
12
|
+
$container-max-width: 100% !default;
|
|
13
|
+
$container-min-width: 320px !default;
|
|
14
|
+
|
|
15
|
+
$columns: 12 !default;
|
|
16
|
+
$column-gutter: 20px !default;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
$mob: 'mobile-', 1, 20px;
|
|
20
|
+
$desk: '', $columns, $column-gutter, "min", $container-width;
|
|
21
|
+
|
|
22
|
+
$grids : $mob, $desk !default;
|
|
23
|
+
|
|
24
|
+
$fixed-mqs: false !default;
|
|
25
|
+
$old-ie: false !default;
|
|
26
|
+
|
|
27
|
+
// ==========================================================================
|
|
28
|
+
// Colour Functions
|
|
29
|
+
// ==========================================================================
|
|
30
|
+
|
|
31
|
+
// Can be extended to add more shades:
|
|
32
|
+
// $blue-shades: join($blue-shades, rgb(13, 89, 224) );
|
|
33
|
+
|
|
34
|
+
$mono-shades: #201b21, #4d4d4d, #999999, #dcdde0, #f6f7fb !default;
|
|
35
|
+
@function mono($shade:1) {
|
|
36
|
+
@return nth($mono-shades, $shade);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
$blue-shades: #137795, #2ba6cb, #b1e5f5 !default;
|
|
41
|
+
@function blue($shade:1) {
|
|
42
|
+
@return nth($blue-shades, $shade);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
$orange-shades: #ff6633, #a32900 !default;
|
|
46
|
+
@function orange($shade:1) {
|
|
47
|
+
@return nth($orange-shades, $shade);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
$green-shades: #6b9b20, #557821 !default;
|
|
51
|
+
@function green($shade:1) {
|
|
52
|
+
@return nth($green-shades, $shade);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// ==========================================================================
|
|
57
|
+
// Colours
|
|
58
|
+
// ==========================================================================
|
|
59
|
+
|
|
60
|
+
$main-color: mono() !default;
|
|
61
|
+
$main-color-hover: mono(3) !default;
|
|
62
|
+
$secondary-color: blue() !default;
|
|
63
|
+
$alert-color: #c60f13 !default;
|
|
64
|
+
$success-color: green() !default;
|
|
65
|
+
$txt-color: mono(2) !default;
|
|
66
|
+
$body-color: #fff !default;
|
|
67
|
+
$bg-cover: mono(3) !default;
|
|
68
|
+
$black: mono() !default;
|
|
69
|
+
$white: #fff !default;
|
|
70
|
+
$shiny-edge: rgba(#fff, .8) !default;
|
|
71
|
+
$dark-edge: rgba(#000, .2) !default;
|
|
72
|
+
|
|
73
|
+
// icons
|
|
74
|
+
$facebook-color: #3c5994 !default;
|
|
75
|
+
$twitter-color: #2ca7c8 !default;
|
|
76
|
+
$email-color: #f70015 !default;
|
|
77
|
+
|
|
78
|
+
// ==========================================================================
|
|
79
|
+
// Fonts
|
|
80
|
+
// ==========================================================================
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// Module scale
|
|
84
|
+
$baseFontSize: 16px !default;
|
|
85
|
+
$importantModNum: 145px !default;
|
|
86
|
+
$base-size: $baseFontSize $importantModNum;
|
|
87
|
+
$ratio: fifth() !default;
|
|
88
|
+
|
|
89
|
+
$base-font-family: "Helvetica Neue", helvetica, arial, sans-serif !default;
|
|
90
|
+
$base-line-height: 1.5;
|
|
91
|
+
$base-line-height-px: 24px;
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
$header-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
|
|
95
|
+
$header-font-weight: bold !default;
|
|
96
|
+
$header-font-color: #222 !default;
|
|
97
|
+
$body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
|
|
98
|
+
$body-font-weight: normal !default;
|
|
99
|
+
$body-font-color: $txt-color !default;
|
|
100
|
+
|
|
101
|
+
// ==========================================================================
|
|
102
|
+
// Buttons
|
|
103
|
+
// ==========================================================================
|
|
104
|
+
|
|
105
|
+
$btn-radius: 4px !default;
|
|
106
|
+
$btn-base: 10px !default;
|
|
107
|
+
|
|
108
|
+
$small-btn-base: $btn-base - 2 !default;
|
|
109
|
+
$large-btn-base: $btn-base + 4 !default;
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
// ==========================================================================
|
|
115
|
+
// Media Queries
|
|
116
|
+
// ==========================================================================
|
|
117
|
+
|
|
118
|
+
$screen-small: 768px !default;
|
|
119
|
+
$screen-medium: 1279px !default;
|
|
120
|
+
$screen-xlarge: 1441px !default;
|