codelation_assets 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17a1d079890929737b3a6ec0fb8b1f857e21e9d6
4
- data.tar.gz: 900a2c74873dfcbd6105919a11370af37adbe920
3
+ metadata.gz: fdebd262466fc70df3328ab7c43c7c1b07dd4f45
4
+ data.tar.gz: 0db96a3e23a92e411bf20918b5b8936fd644d144
5
5
  SHA512:
6
- metadata.gz: 1c577e9e4ede904fecfee1004622153f3813f341482320b0ab809689affbb155f498091fee5f58122d98bda31b902b6dcd4733abf1c6c1f906721f3dca4664e3
7
- data.tar.gz: 2eb0b031f14ac7357d061f7ff4788340338cb96f0307bba870952a1af8f2b6e54eac971e8de4045487291ea03d3212ddd6751aa000be542cc94057c100d67dbd
6
+ metadata.gz: a7e9b3740c57a73271d489624e0fb96e042f3f4643df49642fb0ecfba1e2bf42cfacafe3928bb9cb8e0baa7603279e125840f03bda30a9fd60259381fa1cbe86
7
+ data.tar.gz: d96524b63072206cffb7dbe8011dd63928adb3a32da0d1fde722e5b0b8553632071be0ccbe32d154158668ec204fb3bbfae0fd40d5da9f6f34984f303d1e192a
@@ -1,5 +1,11 @@
1
- // A collection of mixins used in Codelation Rails projects
1
+ // A collection of Sass functions and mixins used by Codelation
2
2
  // https://codelation.com
3
+
4
+ // Used to set the max-width with the outer-container mixin
5
+ $max-width: 1024px !default;
6
+
7
+ // Used for has-cards, has-columns, and has-grid mixins. When the
8
+ // viewport reaches the mobile-breakpoint, the columns will be stacked.
3
9
  $mobile-breakpoint: 767px !default;
4
10
 
5
11
  @import "bourbon/bourbon";
@@ -1,3 +1,5 @@
1
+ // Used to create create columns in a row that span the width of multiple columns in another row.
2
+ // See the readme for more details on usage.
1
3
  @mixin col-span($span: $columns of $total-columns, $gutter: 0) {
2
4
  $columns: nth($span, 1);
3
5
  $container-columns: nth($span, 3);
@@ -1,6 +1,6 @@
1
1
  // Sets up a element and its child elements with the flexbox properties needed
2
2
  // to have the given number of columns with optional gutters or margins.
3
- @mixin has-cards($columns, $margin: 0) {
3
+ @mixin has-cards($columns, $margin: 0, $column-class: "auto", $mobile: "auto") {
4
4
  @include align-content(flex-start);
5
5
  @include align-items(stretch);
6
6
  @include display(flex);
@@ -10,7 +10,13 @@
10
10
  column-count: $columns; // Used as a reference for JavaScript functions
11
11
  padding: $margin 0 0 $margin;
12
12
 
13
- > *:not(script) {
13
+ $column-selector: "> *:not(script)";
14
+
15
+ @if $column-class != "auto" {
16
+ $column-selector: "." + $column-class;
17
+ }
18
+
19
+ #{$column-selector} {
14
20
  @include flex(1 1 auto);
15
21
  margin: 0 $margin $margin 0;
16
22
  width: (1 / $columns) * 85%;
@@ -22,12 +28,15 @@
22
28
  }
23
29
  }
24
30
 
25
- @media (max-width: $mobile-breakpoint) {
26
- > *:not(script) {
27
- width: 100%;
31
+ @if $mobile == "auto" {
32
+ // Stack columns on mobile by default
33
+ @media (max-width: $mobile-breakpoint) {
34
+ #{$column-selector} {
35
+ width: 100%;
28
36
 
29
- &:empty {
30
- display: none;
37
+ &:empty {
38
+ display: none;
39
+ }
31
40
  }
32
41
  }
33
42
  }
@@ -1,6 +1,6 @@
1
1
  // Sets up a element and its child elements with the flexbox properties needed
2
2
  // to have the given number of columns with an optional gutter value.
3
- @mixin has-columns($columns: 0, $gutter: 0, $grow: true) {
3
+ @mixin has-columns($columns: 0, $gutter: 0, $column-class: "auto", $mobile: "auto", $grow: true) {
4
4
  @include align-content(stretch);
5
5
  @include align-items(stretch);
6
6
  @include display(flex);
@@ -8,7 +8,13 @@
8
8
  @include flex-wrap(nowrap);
9
9
  @include justify-content(flex-start);
10
10
 
11
- > *:not(script) {
11
+ $column-selector: "> *:not(script)";
12
+
13
+ @if $column-class != "auto" {
14
+ $column-selector: "." + $column-class;
15
+ }
16
+
17
+ #{$column-selector} {
12
18
  @if $grow {
13
19
  @include flex(1 1 auto);
14
20
  }
@@ -41,17 +47,19 @@
41
47
  }
42
48
  }
43
49
 
44
- // Stack columns when the mobile breakpoint is set
45
- @media (max-width: $mobile-breakpoint) {
46
- @include flex-wrap(wrap);
50
+ @if $mobile == "auto" {
51
+ // Stack columns on mobile by default
52
+ @media (max-width: $mobile-breakpoint) {
53
+ @include flex-wrap(wrap);
47
54
 
48
- > *:not(script) {
49
- margin-bottom: $gutter;
50
- margin-right: 0;
51
- width: 100%;
55
+ #{$column-selector} {
56
+ margin-bottom: $gutter;
57
+ margin-right: 0;
58
+ width: 100%;
52
59
 
53
- &:last-child {
54
- margin-bottom: 0;
60
+ &:last-child {
61
+ margin-bottom: 0;
62
+ }
55
63
  }
56
64
  }
57
65
  }
@@ -1,7 +1,7 @@
1
1
  // Sets up a element and its child elements with the flexbox properties needed
2
2
  // to have the given number of columns per row with multiple rows in the container
3
3
  // and an optional gutter value that will be used between columns and rows.
4
- @mixin has-grid($columns, $gutter: 0) {
4
+ @mixin has-grid($columns, $gutter: 0, $column-class: "auto", $mobile: "auto") {
5
5
  @include align-content(stretch);
6
6
  @include align-items(stretch);
7
7
  @include display(flex);
@@ -10,7 +10,13 @@
10
10
  @include justify-content(space-around);
11
11
  column-count: $columns; // Used as a reference for JavaScript functions
12
12
 
13
- > *:not(script) {
13
+ $column-selector: "> *:not(script)";
14
+
15
+ @if $column-class != "auto" {
16
+ $column-selector: "." + $column-class;
17
+ }
18
+
19
+ #{$column-selector} {
14
20
  @include flex(1 1 auto);
15
21
 
16
22
  @if $gutter == 0 {
@@ -52,19 +58,22 @@
52
58
  }
53
59
  }
54
60
 
55
- @media (max-width: $mobile-breakpoint) {
56
- > *:not(script) {
57
- margin-bottom: $gutter;
58
- margin-right: 0;
59
- margin-top: 0;
60
- width: 100%;
61
+ @if $mobile == "auto" {
62
+ // Stack columns on mobile by default
63
+ @media (max-width: $mobile-breakpoint) {
64
+ #{$column-selector} {
65
+ margin-bottom: $gutter;
66
+ margin-right: 0;
67
+ margin-top: 0;
68
+ width: 100%;
61
69
 
62
- &:last-of-type {
63
- margin-bottom: 0;
64
- }
70
+ &:last-of-type {
71
+ margin-bottom: 0;
72
+ }
65
73
 
66
- &:empty {
67
- display: none;
74
+ &:empty {
75
+ display: none;
76
+ }
68
77
  }
69
78
  }
70
79
  }
@@ -1,5 +1,3 @@
1
- $max-width: 1024px !default;
2
-
3
1
  // Sets the max width of a container and centers it by setting margin-left and
4
2
  // margin-right to auto. The max width can be overridden by defining $max-width.
5
3
  // A left and right padding of 12px is added by default.
@@ -1,3 +1,3 @@
1
1
  module CodelationAssets
2
- VERSION = "0.4.0".freeze
2
+ VERSION = "0.5.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codelation_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -177,9 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.6.3
180
+ rubygems_version: 2.5.1
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: A collection of Sass mixins and JavaScript helpers.
184
184
  test_files: []
185
- has_rdoc: