sb-styleguide 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sb-styleguide/version.rb +1 -1
- data/vendor/assets/javascripts/styleguide/lib/jquery.fitvids.js +81 -0
- data/vendor/assets/javascripts/styleguide/plugins/tbg-respinsiveresize.js.coffee +52 -0
- data/vendor/assets/stylesheets/_mixins.css.scss +30 -14
- data/vendor/assets/stylesheets/styleguide/base/_form.css.scss +2 -2
- data/vendor/assets/stylesheets/styleguide/base/_reset.css.scss +5 -7
- data/vendor/assets/stylesheets/styleguide/base/webfonts/ss-social.css.scss +1 -0
- data/vendor/assets/stylesheets/styleguide/base/webfonts/ss-standard.css.scss +1 -0
- data/vendor/assets/stylesheets/styleguide/grid/_grid.css.scss +20 -1
- data/vendor/assets/stylesheets/styleguide/modules/_switch.css.scss +1 -1
- metadata +4 -2
@@ -0,0 +1,81 @@
|
|
1
|
+
/*global jQuery */
|
2
|
+
/*jshint multistr:true browser:true */
|
3
|
+
/*!
|
4
|
+
* FitVids 1.0
|
5
|
+
*
|
6
|
+
* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
7
|
+
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
8
|
+
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
9
|
+
*
|
10
|
+
* Date: Thu Sept 01 18:00:00 2011 -0500
|
11
|
+
*/
|
12
|
+
|
13
|
+
(function( $ ){
|
14
|
+
|
15
|
+
"use strict";
|
16
|
+
|
17
|
+
$.fn.fitVids = function( options ) {
|
18
|
+
var settings = {
|
19
|
+
customSelector: null
|
20
|
+
};
|
21
|
+
|
22
|
+
var div = document.createElement('div'),
|
23
|
+
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
|
24
|
+
|
25
|
+
div.className = 'fit-vids-style';
|
26
|
+
div.innerHTML = '­<style> \
|
27
|
+
.fluid-width-video-wrapper { \
|
28
|
+
width: 100%; \
|
29
|
+
position: relative; \
|
30
|
+
padding: 0; \
|
31
|
+
} \
|
32
|
+
\
|
33
|
+
.fluid-width-video-wrapper iframe, \
|
34
|
+
.fluid-width-video-wrapper object, \
|
35
|
+
.fluid-width-video-wrapper embed { \
|
36
|
+
position: absolute; \
|
37
|
+
top: 0; \
|
38
|
+
left: 0; \
|
39
|
+
width: 100%; \
|
40
|
+
height: 100%; \
|
41
|
+
} \
|
42
|
+
</style>';
|
43
|
+
|
44
|
+
ref.parentNode.insertBefore(div,ref);
|
45
|
+
|
46
|
+
if ( options ) {
|
47
|
+
$.extend( settings, options );
|
48
|
+
}
|
49
|
+
|
50
|
+
return this.each(function(){
|
51
|
+
var selectors = [
|
52
|
+
"iframe[src*='player.vimeo.com']",
|
53
|
+
"iframe[src*='www.youtube.com']",
|
54
|
+
"iframe[src*='www.youtube-nocookie.com']",
|
55
|
+
"iframe[src*='www.kickstarter.com']",
|
56
|
+
"object",
|
57
|
+
"embed"
|
58
|
+
];
|
59
|
+
|
60
|
+
if (settings.customSelector) {
|
61
|
+
selectors.push(settings.customSelector);
|
62
|
+
}
|
63
|
+
|
64
|
+
var $allVideos = $(this).find(selectors.join(','));
|
65
|
+
|
66
|
+
$allVideos.each(function(){
|
67
|
+
var $this = $(this);
|
68
|
+
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
69
|
+
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
70
|
+
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
71
|
+
aspectRatio = height / width;
|
72
|
+
if(!$this.attr('id')){
|
73
|
+
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
74
|
+
$this.attr('id', videoID);
|
75
|
+
}
|
76
|
+
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
|
77
|
+
$this.removeAttr('height').removeAttr('width');
|
78
|
+
});
|
79
|
+
});
|
80
|
+
};
|
81
|
+
})( jQuery );
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# ============================================================
|
2
|
+
# TBG Responsive Resize v0.0.1
|
3
|
+
# http://URL
|
4
|
+
# ============================================================
|
5
|
+
# Copyright 2012 The Beans Group
|
6
|
+
#
|
7
|
+
# This plugin gives an event that is only fired once abrowser resize
|
8
|
+
# finished. This stops your 'resize' event handler being called
|
9
|
+
# continuously during a resize.
|
10
|
+
#
|
11
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
12
|
+
# you may not use this file except in compliance with the License.
|
13
|
+
# You may obtain a copy of the License at
|
14
|
+
#
|
15
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
#
|
17
|
+
# Unless required by applicable law or agreed to in writing, software
|
18
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
19
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20
|
+
# See the License for the specific language governing permissions and
|
21
|
+
# limitations under the License.
|
22
|
+
#
|
23
|
+
|
24
|
+
plugin = ($)->
|
25
|
+
|
26
|
+
"use strict"
|
27
|
+
|
28
|
+
class ResizeHandler
|
29
|
+
constructor: ->
|
30
|
+
$window = $(window)
|
31
|
+
@resizeEvent = =>
|
32
|
+
$window.trigger 'responsiveResize', @size()
|
33
|
+
@resizeTimer = null
|
34
|
+
|
35
|
+
resize: ->
|
36
|
+
if @resizeTimer then clearTimeout @resizeTimer
|
37
|
+
@resizeTimer = setTimeout @resizeEvent, 100
|
38
|
+
|
39
|
+
size: ->
|
40
|
+
window.getComputedStyle(document.body,':after').getPropertyValue('content').replace('-','') || ''
|
41
|
+
|
42
|
+
$ ->
|
43
|
+
resizeHandler = new ResizeHandler()
|
44
|
+
$(window).on 'resize', ()=> resizeHandler.resize()
|
45
|
+
|
46
|
+
do ( plugin ) ->
|
47
|
+
if typeof define is 'function' and define.amd
|
48
|
+
# AMD. Register as an anonymous module.
|
49
|
+
define(['jquery'], plugin);
|
50
|
+
else
|
51
|
+
# Browser globals
|
52
|
+
plugin(jQuery)
|
@@ -15,26 +15,22 @@
|
|
15
15
|
@else if(length($grid) == $query-pos) {
|
16
16
|
|
17
17
|
.#{nth($grid,1)}only {
|
18
|
-
display: none;
|
18
|
+
display: none !important;
|
19
19
|
}
|
20
20
|
|
21
21
|
// Add Rules wrapped in media query
|
22
|
-
@include media-query( nth($grid,$query-pos)
|
22
|
+
@include media-query( nth($grid,$query-pos)) {
|
23
23
|
@include build-column-size($grid);
|
24
24
|
.#{nth($grid,1)}only {
|
25
|
-
display: block;
|
25
|
+
display: block !important;
|
26
26
|
}
|
27
27
|
|
28
28
|
.#{nth($grid,1)}hide {
|
29
|
-
display: none;
|
29
|
+
display: none !important;
|
30
30
|
}
|
31
31
|
}
|
32
32
|
}
|
33
33
|
@else {
|
34
|
-
body:after {
|
35
|
-
content: nth($grid,1);
|
36
|
-
display: none;
|
37
|
-
}
|
38
34
|
@include build-column-size($grid);
|
39
35
|
}
|
40
36
|
}
|
@@ -79,16 +75,36 @@
|
|
79
75
|
}
|
80
76
|
|
81
77
|
// ==========================================================================
|
82
|
-
//
|
78
|
+
// Conditional CSS - JS Detection
|
83
79
|
// ==========================================================================
|
84
80
|
|
85
|
-
@mixin
|
86
|
-
|
87
|
-
|
88
|
-
|
81
|
+
@mixin conditional-CSS($grids) {
|
82
|
+
$query-pos: 4;
|
83
|
+
|
84
|
+
@each $grid in $grids {
|
85
|
+
@if(length($grid) < $query-pos){
|
86
|
+
body:after {
|
87
|
+
content: nth($grid,1);;
|
89
88
|
display: none;
|
89
|
+
}
|
90
90
|
}
|
91
|
+
@else {
|
92
|
+
@include media-query( nth($grid,$query-pos)) {
|
93
|
+
body:after {
|
94
|
+
content: nth($grid,1);;
|
95
|
+
display: none;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
// ==========================================================================
|
103
|
+
// Simple Media Query Generator
|
104
|
+
// ==========================================================================
|
91
105
|
|
106
|
+
@mixin media-query($size) {
|
107
|
+
@media ($size) {
|
92
108
|
@content;
|
93
109
|
}
|
94
110
|
}
|
@@ -158,7 +174,7 @@
|
|
158
174
|
$length: length($grids);
|
159
175
|
$mobile: nth($grids, $length);
|
160
176
|
|
161
|
-
@include media-query( nth($mobile,$query-position)
|
177
|
+
@include media-query( nth($mobile,$query-position)) {
|
162
178
|
@content;
|
163
179
|
}
|
164
180
|
}
|
@@ -107,7 +107,7 @@ fieldset {
|
|
107
107
|
*/
|
108
108
|
|
109
109
|
|
110
|
-
.location
|
110
|
+
.location.input {
|
111
111
|
position: relative;
|
112
112
|
|
113
113
|
.locate {
|
@@ -126,7 +126,7 @@ fieldset {
|
|
126
126
|
}
|
127
127
|
}
|
128
128
|
|
129
|
-
.geolocation .location
|
129
|
+
.geolocation .location.input .locate {
|
130
130
|
display: block;
|
131
131
|
}
|
132
132
|
|
@@ -51,13 +51,7 @@ audio:not([controls]) {
|
|
51
51
|
display: none;
|
52
52
|
}
|
53
53
|
|
54
|
-
|
55
|
-
@if $setBoxSizing {
|
56
|
-
* {
|
57
|
-
@include box-sizing(border-box);
|
58
|
-
*behavior: url(/boxsizing.htc);
|
59
|
-
}
|
60
|
-
}
|
54
|
+
|
61
55
|
|
62
56
|
// ==========================================================================
|
63
57
|
// Lists
|
@@ -122,6 +116,10 @@ figure {
|
|
122
116
|
margin: 0;
|
123
117
|
}
|
124
118
|
|
119
|
+
figure img {
|
120
|
+
max-width: 100% !important;
|
121
|
+
}
|
122
|
+
|
125
123
|
// ==========================================================================
|
126
124
|
// Forms
|
127
125
|
// ==========================================================================
|
@@ -5,6 +5,25 @@
|
|
5
5
|
@import "compass/css3";
|
6
6
|
|
7
7
|
|
8
|
+
// ==========================================================================
|
9
|
+
// Conditional CSS - JS Detection
|
10
|
+
// ==========================================================================
|
11
|
+
|
12
|
+
@include conditional-CSS($grids);
|
13
|
+
|
14
|
+
|
15
|
+
// ==========================================================================
|
16
|
+
// Set default box model
|
17
|
+
// ==========================================================================
|
18
|
+
|
19
|
+
@if $setBoxSizing {
|
20
|
+
* {
|
21
|
+
@include box-sizing(border-box);
|
22
|
+
*behavior: url(/boxsizing.htc);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
|
8
27
|
// ==========================================================================
|
9
28
|
// Container
|
10
29
|
// ==========================================================================
|
@@ -33,7 +52,7 @@
|
|
33
52
|
$query-pos: 4;
|
34
53
|
@each $grid in $grids {
|
35
54
|
@if(length($grid) == $query-pos ) {
|
36
|
-
@include media-query( nth($grid,$query-pos)
|
55
|
+
@include media-query( nth($grid,$query-pos)) {
|
37
56
|
.row {
|
38
57
|
margin: 0 0px-(0.5*nth($grid,$padding-pos));
|
39
58
|
}
|
@@ -20,7 +20,7 @@ $query-pos: 4;
|
|
20
20
|
@each $grid in $grids {
|
21
21
|
// If there is a media query
|
22
22
|
@if(length($grid) == $query-pos) {
|
23
|
-
@include media-query( nth($grid,$query-pos)
|
23
|
+
@include media-query( nth($grid,$query-pos)) {
|
24
24
|
.#{nth($grid,1)}switch-content {
|
25
25
|
display: none;
|
26
26
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sb-styleguide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-12-
|
13
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: haml
|
@@ -263,8 +263,10 @@ files:
|
|
263
263
|
- vendor/assets/images/middleman.png
|
264
264
|
- vendor/assets/index.html.haml
|
265
265
|
- vendor/assets/javascripts/.gitkeep
|
266
|
+
- vendor/assets/javascripts/styleguide/lib/jquery.fitvids.js
|
266
267
|
- vendor/assets/javascripts/styleguide/plugins/tbg-close.js.coffee
|
267
268
|
- vendor/assets/javascripts/styleguide/plugins/tbg-forms.js.coffee
|
269
|
+
- vendor/assets/javascripts/styleguide/plugins/tbg-respinsiveresize.js.coffee
|
268
270
|
- vendor/assets/javascripts/styleguide/plugins/tbg-switch.js.coffee
|
269
271
|
- vendor/assets/stylesheets/.gitkeep
|
270
272
|
- vendor/assets/stylesheets/_functions.scss
|