singularity-extras 0.0.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/lib/singularity-extras.rb +11 -0
- data/stylesheets/_singularity-extras.scss +3 -0
- data/stylesheets/singularity-extras/_generators.scss +3 -0
- data/stylesheets/singularity-extras/_helpers.scss +3 -0
- data/stylesheets/singularity-extras/_output.scss +0 -0
- data/stylesheets/singularity-extras/generators/_compound.scss +45 -0
- data/stylesheets/singularity-extras/generators/_ratio-spiral.scss +40 -0
- data/stylesheets/singularity-extras/generators/_ratio.scss +20 -0
- data/stylesheets/singularity-extras/helpers/_list-sum.scss +10 -0
- data/stylesheets/singularity-extras/helpers/_repeat.scss +8 -0
- data/stylesheets/singularity-extras/helpers/_reverse.scss +9 -0
- metadata +116 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'compass'
|
2
|
+
require 'singularitygs'
|
3
|
+
require 'modular-scale'
|
4
|
+
require 'sassy-math'
|
5
|
+
|
6
|
+
Compass::Frameworks.register("singularity-extras", :path => "#{File.dirname(__FILE__)}/..")
|
7
|
+
|
8
|
+
module SingularityExtras
|
9
|
+
VERSION = "0.0.1"
|
10
|
+
DATE = "2012-04-04"
|
11
|
+
end
|
File without changes
|
@@ -0,0 +1,45 @@
|
|
1
|
+
// 16 arguments can be passed into this function
|
2
|
+
// a max of 16 comma seperated grids
|
3
|
+
@function compound($cg1: 1, $cg2: 1, $cg3: 1, $cg4: 1, $cg5: 1, $cg6: 1, $cg7: 1, $cg8: 1, $cg9: 1, $cg10: 1, $cg11: 1, $cg12: 1, $cg13: 1, $cg14: 1, $cg15: 1, $cg16: 1) {
|
4
|
+
|
5
|
+
// merge arguments into a single list.
|
6
|
+
$compound-grids: $cg1, $cg2, $cg3, $cg4, $cg5, $cg6, $cg7, $cg8, $cg9, $cg10, $cg11, $cg12, $cg13, $cg14, $cg15, $cg16;
|
7
|
+
|
8
|
+
// Find the base resolution of grid
|
9
|
+
$resolution: 1;
|
10
|
+
@each $item in $compound-grids {
|
11
|
+
$resolution: $resolution * $item;
|
12
|
+
}
|
13
|
+
|
14
|
+
$compound-grid: ();
|
15
|
+
$compound-counter: 1;
|
16
|
+
// cycle through each step in grid resolution
|
17
|
+
@for $i from 1 through $resolution {
|
18
|
+
|
19
|
+
// dont add a column by default
|
20
|
+
$add-col: false;
|
21
|
+
|
22
|
+
// cycle through all grids to see if any grids match
|
23
|
+
@each $grid in $compound-grids {
|
24
|
+
|
25
|
+
// if the grid divides evenly into the resolution, add a column
|
26
|
+
// divide the resolution by number of columns to get the column resolution
|
27
|
+
@if $i / ($resolution / $grid) == round($i / ($resolution / $grid)) {
|
28
|
+
$add-col: true;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
// add the counter value to the compound grid list, reset counter
|
33
|
+
// this marks where one column ends and a new one begins
|
34
|
+
@if $add-col {
|
35
|
+
$compound-grid: join($compound-grid, $compound-counter, comma);
|
36
|
+
$compound-counter: 1;
|
37
|
+
}
|
38
|
+
// if no column is added, bump up counter
|
39
|
+
@else {
|
40
|
+
$compound-counter: $compound-counter + 1;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
@return $compound-grid;
|
45
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
@import "modular-scale";
|
2
|
+
|
3
|
+
// centralize spiral steps.
|
4
|
+
@function ratio-spiral-i($i) {
|
5
|
+
@return (($i * 2) + 1);
|
6
|
+
}
|
7
|
+
|
8
|
+
@function ratio-spiral($depth: 5, $ratio: golden(), $invert: false) {
|
9
|
+
|
10
|
+
// write the middle most column, a little out of step from the other columns.
|
11
|
+
$list: ms(ratio-spiral-i(-$depth) + 1, 100, $ratio);
|
12
|
+
|
13
|
+
// flip the direction the order columns are written in.
|
14
|
+
@if $invert == false {
|
15
|
+
@for $i from -($depth - 1) to 0 {
|
16
|
+
// if the number is even
|
17
|
+
@if $i/2 == round($i/2) {
|
18
|
+
// append after the list
|
19
|
+
$list: append($list, ms(ratio-spiral-i($i), 100, $ratio));
|
20
|
+
}
|
21
|
+
@else {
|
22
|
+
// append before the list
|
23
|
+
$list: append(ms(ratio-spiral-i($i), 100, $ratio), $list);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
@else {
|
29
|
+
@for $i from -($depth - 1) to 0 {
|
30
|
+
@if $i/2 == round($i/2) {
|
31
|
+
$list: append(ms(ratio-spiral-i($i), 100, $ratio), $list);
|
32
|
+
}
|
33
|
+
@else {
|
34
|
+
$list: append($list, ms(ratio-spiral-i($i), 100, $ratio));
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
@return $list;
|
40
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Creates a list based on a ratio
|
2
|
+
// Valid options for $start: 'large' or 'small'
|
3
|
+
@function ratio($ratio, $steps, $start: 'small') {
|
4
|
+
$x: 1;
|
5
|
+
$return: ();
|
6
|
+
|
7
|
+
@for $i from 0 through $steps - 1 {
|
8
|
+
$xr: $x * pow($ratio, $i);
|
9
|
+
$return: append($return, $xr, comma);
|
10
|
+
}
|
11
|
+
|
12
|
+
@if $start == 'small' and $ratio < 1 {
|
13
|
+
$return: reverse($return);
|
14
|
+
}
|
15
|
+
@else if $start == 'large' and $ratio > 1 {
|
16
|
+
$return: reverse($return);
|
17
|
+
}
|
18
|
+
|
19
|
+
@return $return;
|
20
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// Calculate the total sum of a list
|
2
|
+
@function list-sum($list) {
|
3
|
+
// zero out the initial sum
|
4
|
+
$sum: 0;
|
5
|
+
// loop through each value in the list adding it to $list-sum
|
6
|
+
@for $i from 1 through length($list) {
|
7
|
+
$sum: $sum + nth(nth($list, $i), 1);
|
8
|
+
}
|
9
|
+
@return nth($sum, 1);
|
10
|
+
}
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: singularity-extras
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Scott Kellum
|
13
|
+
- Sam Richard
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-04-04 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: singularitygs
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 0
|
31
|
+
- 1
|
32
|
+
version: 0.0.1
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: sassy-math
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 1
|
44
|
+
- 5
|
45
|
+
version: "1.5"
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: modular-scale
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 0
|
58
|
+
- 6
|
59
|
+
version: 1.0.6
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
62
|
+
description: Advanced responsive grid system for Sass and Compass
|
63
|
+
email:
|
64
|
+
- scott@scottkellum.com
|
65
|
+
- snugug@gmail.com
|
66
|
+
executables: []
|
67
|
+
|
68
|
+
extensions: []
|
69
|
+
|
70
|
+
extra_rdoc_files: []
|
71
|
+
|
72
|
+
files:
|
73
|
+
- lib/singularity-extras.rb
|
74
|
+
- stylesheets/_singularity-extras.scss
|
75
|
+
- stylesheets/singularity-extras/_generators.scss
|
76
|
+
- stylesheets/singularity-extras/_helpers.scss
|
77
|
+
- stylesheets/singularity-extras/_output.scss
|
78
|
+
- stylesheets/singularity-extras/generators/_compound.scss
|
79
|
+
- stylesheets/singularity-extras/generators/_ratio-spiral.scss
|
80
|
+
- stylesheets/singularity-extras/generators/_ratio.scss
|
81
|
+
- stylesheets/singularity-extras/helpers/_list-sum.scss
|
82
|
+
- stylesheets/singularity-extras/helpers/_repeat.scss
|
83
|
+
- stylesheets/singularity-extras/helpers/_reverse.scss
|
84
|
+
has_rdoc: true
|
85
|
+
homepage: http://singularity.gs
|
86
|
+
licenses: []
|
87
|
+
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options: []
|
90
|
+
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
segments:
|
105
|
+
- 1
|
106
|
+
- 2
|
107
|
+
version: "1.2"
|
108
|
+
requirements: []
|
109
|
+
|
110
|
+
rubyforge_project: singularity-extras
|
111
|
+
rubygems_version: 1.3.6
|
112
|
+
signing_key:
|
113
|
+
specification_version: 3
|
114
|
+
summary: Singularity is a fluid grid system that can generate uniform columns as well as asymmetric and compound grids with tools to write grids as functions, mixins, or class based objects.
|
115
|
+
test_files: []
|
116
|
+
|