respond-to 2.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/stylesheets/_respond-to.scss +21 -45
  2. metadata +7 -18
@@ -11,54 +11,30 @@ $breakpoints: false !default;
11
11
  ////////////////////////
12
12
  // Respond-to API Mixin
13
13
  ////////////////////////
14
- @mixin respond-to($context, $media: "screen") {
15
- @if $breakpoints != false {
16
- // Check to see if the 2nd item is a number. If it is, we've got a single query
17
- @if type-of(nth($breakpoints, 2)) == 'number' {
18
- // Check to see if the context matches the breakpoint namespace
19
- @if $context == nth($breakpoints, 1) {
20
- // Call Media Query Generator
21
- @include media-query-gen($breakpoints, $media) {
22
- @content;
23
- }
24
- }
25
- }
26
- // Else, loop over all of them
27
- @else {
28
- // Loop over each breakpoint and check context
29
- @each $bkpt in $breakpoints {
30
- // If context is correct…
31
- @if $context == nth($bkpt, 1) {
32
- // Call the generator!
33
- @include media-query-gen($bkpt, $media) {
34
- @content;
14
+ @mixin respond-to($context, $media: $breakpoint-default-media) {
15
+ @if $breakpoints != false {
16
+ @each $bkpt in $breakpoints {
17
+ @if $context == nth($bkpt, 1) {
18
+ @debug $bkpt;
19
+ $length: length($bkpt);
20
+ $mq: false !default;
21
+
22
+ @for $i from 2 through $length {
23
+ // If it's the first item, override $mq
24
+ @if $i == 2 {
25
+ $mq: nth($bkpt, $i);
35
26
  }
27
+ // Else, join $mq
28
+ @else {
29
+ $mq: join($mq, nth($bkpt, $i));
30
+ }
31
+ }
32
+ @debug $mq;
33
+
34
+ @include breakpoint($mq, $media) {
35
+ @content;
36
36
  }
37
37
  }
38
38
  }
39
39
  }
40
- }
41
-
42
- ////////////////////////
43
- // Helper Mixin ebcause this stuff gets used twice
44
- ////////////////////////
45
- @mixin media-query-gen($bpt, $media) {
46
- // Get length of breakpoint variable, minus the namespace
47
- $length: length($bpt);
48
- // Go through all of the breakpoint items, starting at the second, and add them to a variable to be passed into the media query mixin
49
- $mq: false !default;
50
- @for $i from 2 through $length {
51
- // If it's the first item, override $mq
52
- @if $i == 2 {
53
- $mq: nth($bpt, $i);
54
- }
55
- // Else, join $mq
56
- @else {
57
- $mq: join($mq, nth($bpt, $i));
58
- }
59
- }
60
- // Call Media Query mixin
61
- @include breakpoint($mq, $media) {
62
- @content;
63
- }
64
40
  }
metadata CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- version: "2.0"
8
+ - 1
9
+ version: 2.0.1
9
10
  platform: ruby
10
11
  authors:
11
12
  - Sam Richard
@@ -16,32 +17,20 @@ cert_chain: []
16
17
  date: 2011-06-18 00:00:00 -04:00
17
18
  default_executable:
18
19
  dependencies:
19
- - !ruby/object:Gem::Dependency
20
- name: sass
21
- prerelease: false
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- segments:
27
- - 3
28
- - 1
29
- version: "3.1"
30
- type: :runtime
31
- version_requirements: *id001
32
20
  - !ruby/object:Gem::Dependency
33
21
  name: breakpoint
34
22
  prerelease: false
35
- requirement: &id002 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
36
24
  requirements:
37
25
  - - ">="
38
26
  - !ruby/object:Gem::Version
39
27
  segments:
28
+ - 1
40
29
  - 0
41
- - 2
42
- version: "0.2"
30
+ - 1
31
+ version: 1.0.1
43
32
  type: :runtime
44
- version_requirements: *id002
33
+ version_requirements: *id001
45
34
  description: Easy Media Query Handling
46
35
  email:
47
36
  - snugug@gmail.com