patterns 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -18,7 +18,7 @@ And in your .scss file:
|
|
18
18
|
### Other
|
19
19
|
Otherwise, clone the repo and copy app/assets/stylesheets where your SASS assets should be. And in your .scss file:
|
20
20
|
|
21
|
-
@import 'some
|
21
|
+
@import 'some-relative-directories/patterns';
|
22
22
|
|
23
23
|
## Use
|
24
24
|
See http://patterns-examples.herokuapp.com for functions and variables.
|
@@ -27,7 +27,7 @@ See http://patterns-examples.herokuapp.com for functions and variables.
|
|
27
27
|
Tested on Chrome 23, Firefox 16 and IE8.
|
28
28
|
|
29
29
|
## Credits
|
30
|
-
Extracted out of [
|
30
|
+
Extracted out of [Hockeystick](https://www.hockeystick.co/). Thanks to [Scalability Inc.](http://www.scalability.ca/) for giving me permission to open source this.
|
31
31
|
|
32
32
|
Code inspired by the css class based version in [Placemarklist](https://www.placemarklist.com) and copied gem scaffold from [bourbon](https://github.com/thoughtbot/bourbon).
|
33
33
|
|
@@ -1,10 +1,12 @@
|
|
1
|
-
@import 'helpers/clearfix';
|
2
|
-
|
3
1
|
@import 'alignment/center';
|
4
2
|
@import 'alignment/float';
|
5
3
|
@import 'alignment/lines';
|
6
4
|
@import 'alignment/overflow';
|
7
5
|
@import 'alignment/spacing';
|
8
6
|
|
7
|
+
@import 'helpers/clearfix';
|
8
|
+
|
9
|
+
@import 'layout/image_background';
|
10
|
+
|
9
11
|
@import 'widgets/clean_list';
|
10
12
|
@import 'widgets/scroll';
|
@@ -1,3 +1,7 @@
|
|
1
|
+
@import 'float';
|
2
|
+
|
3
|
+
$unit_base: 5px;
|
4
|
+
|
1
5
|
@function unit_multiplier($n, $base: $unit_base) {
|
2
6
|
@if unitless($n) {
|
3
7
|
@return $n * $base;
|
@@ -9,27 +13,32 @@
|
|
9
13
|
|
10
14
|
@mixin horizontally_spaced($n: 1) {
|
11
15
|
&:first-child { margin-left: 0; }
|
12
|
-
& {
|
16
|
+
& {
|
17
|
+
float: left;
|
18
|
+
margin-left: unit_multiplier($n);
|
19
|
+
}
|
13
20
|
}
|
14
21
|
@mixin vertically_spaced($n: 1) {
|
15
22
|
&:first-child { margin-top: 0; }
|
16
23
|
& { margin-top: unit_multiplier($n); }
|
17
24
|
}
|
18
25
|
|
19
|
-
@mixin horizontal_spacer_container($n: 1, $
|
20
|
-
@
|
26
|
+
@mixin horizontal_spacer_container($n: 1, $borders: false) {
|
27
|
+
@include float_left_container;
|
28
|
+
|
29
|
+
@if $borders {
|
21
30
|
& > :first-child { margin-left: 0; padding-left: 0; }
|
22
|
-
& > * { margin-left: unit_multiplier($n, 2
|
31
|
+
& > * { margin-left: unit_multiplier($n, $unit_base/2); padding-left: unit_multiplier($n, $unit_base/2); }
|
23
32
|
}
|
24
33
|
@else {
|
25
34
|
& > :first-child { margin-left: 0; }
|
26
35
|
& > * { margin-left: unit_multiplier($n); }
|
27
36
|
}
|
28
37
|
}
|
29
|
-
@mixin vertical_spacer_container($n: 1, $
|
30
|
-
@if $
|
38
|
+
@mixin vertical_spacer_container($n: 1, $borders: false) {
|
39
|
+
@if $borders {
|
31
40
|
& > :first-child { margin-top: 0; padding-top: 0; }
|
32
|
-
& > * { margin-top: unit_multiplier($n, 2
|
41
|
+
& > * { margin-top: unit_multiplier($n, $unit_base/2); padding-top: unit_multiplier($n, $unit_base/2); }
|
33
42
|
}
|
34
43
|
@else {
|
35
44
|
& > *:first-child { margin-top: 0; }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// from http://css-tricks.com/perfect-full-page-background-image/
|
2
|
+
// should use http://stackoverflow.com/questions/1342994/check-browser-css-property-support to degrade
|
3
|
+
@mixin image_background($image_url) {
|
4
|
+
background: $image_url no-repeat center center fixed;
|
5
|
+
-webkit-background-size: cover;
|
6
|
+
-moz-background-size: cover;
|
7
|
+
-o-background-size: cover;
|
8
|
+
background-size: cover;
|
9
|
+
}
|
data/lib/patterns/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Patterns
|
2
|
-
VERSION = "0.0
|
3
|
-
end
|
2
|
+
VERSION = "0.1.0"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patterns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- app/assets/stylesheets/alignment/_overflow.scss
|
63
63
|
- app/assets/stylesheets/alignment/_spacing.scss
|
64
64
|
- app/assets/stylesheets/helpers/_clearfix.scss
|
65
|
+
- app/assets/stylesheets/layout/_image_background.scss
|
65
66
|
- app/assets/stylesheets/widgets/_clean_list.scss
|
66
67
|
- app/assets/stylesheets/widgets/_scroll.scss
|
67
68
|
- lib/patterns.rb
|