susy 2.0.0.alpha.1 → 2.0.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/susy.rb +0 -1
- data/sass/_susy.scss +3 -54
- data/sass/susy/_core.scss +6 -0
- data/sass/susy/_helpers.scss +5 -13
- data/sass/susy/_math.scss +5 -2
- data/sass/susy/_settings.scss +52 -0
- data/sass/susy/api/_float.scss +6 -71
- data/sass/susy/api/_shared.scss +7 -0
- data/sass/susy/api/float/_container.scss +12 -0
- data/sass/susy/api/float/_end.scss +21 -0
- data/sass/susy/api/float/_isolate.scss +14 -0
- data/sass/susy/api/float/_span.scss +23 -0
- data/sass/susy/api/shared/_container.scss +22 -0
- data/sass/susy/api/shared/_grid-background.scss +20 -0
- data/sass/susy/api/shared/_margins.scss +15 -0
- data/sass/susy/api/shared/_padding.scss +15 -0
- data/sass/susy/helpers/_direction.scss +28 -0
- data/sass/susy/helpers/_nth.scss +15 -0
- data/sass/susy/helpers/_sass-lists.scss +45 -26
- data/sass/susy/language/_shared.scss +6 -0
- data/sass/susy/language/_susy.scss +16 -0
- data/sass/susy/language/_susy1.scss +9 -0
- data/sass/susy/language/shared/_context.scss +35 -0
- data/sass/susy/language/shared/_settings.scss +216 -0
- data/sass/susy/language/susy/_background.scss +132 -0
- data/sass/susy/language/susy/_container.scss +100 -0
- data/sass/susy/language/susy/_functions.scss +58 -0
- data/sass/susy/language/susy/_gallery.scss +94 -0
- data/sass/susy/language/susy/_isolate.scss +51 -0
- data/sass/susy/language/susy/_math.scss +153 -0
- data/sass/susy/language/susy/_rows.scss +78 -0
- data/sass/susy/language/susy/_span.scss +204 -0
- data/sass/susy/language/susy1/_settings.scss +60 -0
- data/sass/susy/math/_columns.scss +79 -55
- data/sass/susy/math/_container.scss +45 -0
- data/sass/susy/math/_location.scss +47 -0
- data/templates/project/README.md +36 -11
- data/templates/project/_base.scss +1 -1
- data/templates/project/manifest.rb +0 -3
- data/templates/project/screen.scss +1 -1
- metadata +33 -45
- data/sass/README.md +0 -33
- data/sass/susy/_api.scss +0 -39
- data/sass/susy/_grids.scss +0 -2
- data/sass/susy/_gutters.scss +0 -2
- data/sass/susy/_language.scss +0 -3
- data/sass/susy/api/_isolation.scss +0 -16
- data/sass/susy/grids/_add.scss +0 -10
- data/sass/susy/grids/_find.scss +0 -10
- data/sass/susy/gutters/_add.scss +0 -10
- data/sass/susy/gutters/_find.scss +0 -10
- data/sass/susy/helpers/_background-grid.scss +0 -65
- data/sass/susy/helpers/_box-sizing.scss +0 -25
- data/sass/susy/helpers/_clearfix.scss +0 -51
- data/sass/susy/helpers/_columns.scss +0 -15
- data/sass/susy/helpers/_find.scss +0 -63
- data/sass/susy/helpers/_span-shared.scss +0 -9
- data/sass/susy/language/_parse-add.scss +0 -19
- data/sass/susy/language/_parse-list.scss +0 -53
- data/sass/susy/language/_span.scss +0 -20
- data/sass/susy/math/_context.scss +0 -3
- data/sass/susy/math/_gutters.scss +0 -11
- data/templates/box-sizing/behaviors/box-sizing/boxsizing.htc +0 -399
- data/templates/box-sizing/behaviors/box-sizing/boxsizing.php +0 -23
- data/templates/box-sizing/manifest.rb +0 -4
- data/templates/project/behaviors/box-sizing/boxsizing.htc +0 -399
- data/templates/project/behaviors/box-sizing/boxsizing.php +0 -23
@@ -0,0 +1,45 @@
|
|
1
|
+
// Container math
|
2
|
+
// ==============
|
3
|
+
|
4
|
+
// Parse the $container-position into margin values
|
5
|
+
@function parse-container-position(
|
6
|
+
$justify: $container-position
|
7
|
+
) {
|
8
|
+
$left : null;
|
9
|
+
$right : null;
|
10
|
+
|
11
|
+
@if type-of($justify) == list {
|
12
|
+
$left: nth($justify,1);
|
13
|
+
$right: nth($justify,2);
|
14
|
+
} @else if type-of($justify) == number and not unitless($justify) {
|
15
|
+
$left: $justify;
|
16
|
+
$right: $justify;
|
17
|
+
} @else if $justify == left {
|
18
|
+
$left: 0;
|
19
|
+
} @else if $justify == right {
|
20
|
+
$right: 0;
|
21
|
+
} @else if $justify == center {
|
22
|
+
$left: auto;
|
23
|
+
$right: auto;
|
24
|
+
}
|
25
|
+
|
26
|
+
@return $left $right;
|
27
|
+
}
|
28
|
+
|
29
|
+
// Calculate the width of a container based on columns and gutters
|
30
|
+
@function calculate-container-width(
|
31
|
+
$columns : $columns,
|
32
|
+
$gutters : $gutters,
|
33
|
+
$column-width : $column-width,
|
34
|
+
$outer : false
|
35
|
+
) {
|
36
|
+
$width: null;
|
37
|
+
|
38
|
+
@if $column-width {
|
39
|
+
$width: column-sum($columns, $gutters, $outer) * $column-width;
|
40
|
+
} @else {
|
41
|
+
@warn "We need either `$column-width` or `$container` in order to create your container.";
|
42
|
+
}
|
43
|
+
|
44
|
+
@return $width;
|
45
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
// Location math
|
2
|
+
// =============
|
3
|
+
|
4
|
+
// Find if a span covers the last columns
|
5
|
+
@function is-last(
|
6
|
+
$span,
|
7
|
+
$location,
|
8
|
+
$columns: $columns
|
9
|
+
) {
|
10
|
+
$is-last: false;
|
11
|
+
|
12
|
+
@if $location == "last" or $location == "omega" {
|
13
|
+
$is-last: true;
|
14
|
+
} @else if $location + ($span - 1) == column-count($columns) {
|
15
|
+
$is-last: true;
|
16
|
+
}
|
17
|
+
|
18
|
+
@return $is-last;
|
19
|
+
}
|
20
|
+
|
21
|
+
// Find if a span covers the first columns
|
22
|
+
@function is-first(
|
23
|
+
$location
|
24
|
+
) {
|
25
|
+
@if $location == "first" or $location == "alpha" or $location == 1 {
|
26
|
+
@return true;
|
27
|
+
} @else {
|
28
|
+
@return false;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
// Return a numeric location, even if a first/last keyword is used
|
33
|
+
@function get-location-position(
|
34
|
+
$span,
|
35
|
+
$location,
|
36
|
+
$columns: $columns
|
37
|
+
) {
|
38
|
+
@if type-of($location) == number {
|
39
|
+
@return $location;
|
40
|
+
} @else if $location == first or $location == alpha {
|
41
|
+
@return 1;
|
42
|
+
} @else if $location == last or $location == omega {
|
43
|
+
@return column-count($columns) - $span + 1;
|
44
|
+
} @else {
|
45
|
+
@return false;
|
46
|
+
}
|
47
|
+
}
|
data/templates/project/README.md
CHANGED
@@ -3,16 +3,6 @@
|
|
3
3
|
*This document currently represents the plans for Susy Next syntax,
|
4
4
|
and not necessarily the existing functionality.*
|
5
5
|
|
6
|
-
## Output Settings
|
7
|
-
|
8
|
-
**Document direction:**
|
9
|
-
- `$layout-direction: 'left to right' !default;`
|
10
|
-
- 'ltr' | 'left to right' | 'rtl' | 'right to left' | 'both'
|
11
|
-
|
12
|
-
**Default output style:**
|
13
|
-
- `$output-style: 'float' !default;`
|
14
|
-
- 'float' | 'isolate' | *others TBD?*
|
15
|
-
|
16
6
|
## Defining Layouts
|
17
7
|
|
18
8
|
*We should avoid the "grid" terminology
|
@@ -28,7 +18,14 @@ For grids, we need:
|
|
28
18
|
- width/ratio of columns
|
29
19
|
- width/ratio of gutters
|
30
20
|
|
31
|
-
|
21
|
+
Layout styles to support:
|
22
|
+
- ltr, rtl, mixed-direction
|
23
|
+
- content-box or border-box sizing
|
24
|
+
- gutters inside (padding) or outside (margin)
|
25
|
+
- gutters before, after, or split
|
26
|
+
|
27
|
+
|
28
|
+
*(?) Do we really need to manage grid margins at all? Or can they be handled easily by the user?*
|
32
29
|
|
33
30
|
Any solution should support:
|
34
31
|
- Arbitrary non-grid layouts
|
@@ -36,6 +33,34 @@ Any solution should support:
|
|
36
33
|
- Symmetric and asymmetric grids
|
37
34
|
- Any arbitrary breakpoints (min/max/both)
|
38
35
|
|
36
|
+
## Functions
|
37
|
+
|
38
|
+
- Need to access the width of a certain number of columns
|
39
|
+
- Symmetric or asymmetric
|
40
|
+
- With or without edge gutters (inner or outer width)
|
41
|
+
- In context
|
42
|
+
|
43
|
+
```scss
|
44
|
+
// symmetric
|
45
|
+
width: span(4);
|
46
|
+
width: span(4 of 3);
|
47
|
+
width: span(4 of 3 outer);
|
48
|
+
|
49
|
+
// asymmetric
|
50
|
+
width: span(4 at 2);
|
51
|
+
width: span(4 at 2 of 3 4 5 4 3);
|
52
|
+
width: span(4 at 2 of 3 4 5 4 3 outer);
|
53
|
+
```
|
54
|
+
|
55
|
+
- Need to access the width of a single gutter
|
56
|
+
- In context
|
57
|
+
|
58
|
+
```scss
|
59
|
+
// symmetric
|
60
|
+
width: gutter();
|
61
|
+
width: gutter(3);
|
62
|
+
```
|
63
|
+
|
39
64
|
## Container
|
40
65
|
|
41
66
|
Establish a container element: `container($width)`
|
@@ -1,9 +1,6 @@
|
|
1
1
|
stylesheet 'screen.scss', :media => "screen, projection"
|
2
2
|
stylesheet '_base.scss'
|
3
3
|
|
4
|
-
file 'behaviors/box-sizing/boxsizing.htc'
|
5
|
-
file 'behaviors/box-sizing/boxsizing.php'
|
6
|
-
|
7
4
|
description "Susy: a flexible static/fluid/elastic grid system native to compass."
|
8
5
|
|
9
6
|
help %Q{
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: susy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: -1173656864
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 2.0.0.alpha.
|
11
|
+
- 2
|
12
|
+
version: 2.0.0.alpha.2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Eric Meyer
|
@@ -24,7 +24,7 @@ autorequire:
|
|
24
24
|
bindir: bin
|
25
25
|
cert_chain: []
|
26
26
|
|
27
|
-
date: 2013-
|
27
|
+
date: 2013-05-03 00:00:00 Z
|
28
28
|
dependencies:
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: compass
|
@@ -58,21 +58,6 @@ dependencies:
|
|
58
58
|
version: 3.2.0
|
59
59
|
type: :runtime
|
60
60
|
version_requirements: *id002
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: breakpoint
|
63
|
-
prerelease: false
|
64
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
hash: 9
|
70
|
-
segments:
|
71
|
-
- 1
|
72
|
-
- 3
|
73
|
-
version: "1.3"
|
74
|
-
type: :runtime
|
75
|
-
version_requirements: *id003
|
76
61
|
description: Susy is a tool for building layouts of any type with a simple shared syntax.
|
77
62
|
email:
|
78
63
|
- eric@oddbird.net
|
@@ -95,38 +80,41 @@ extra_rdoc_files:
|
|
95
80
|
files:
|
96
81
|
- lib/susy.rb
|
97
82
|
- sass/_susy.scss
|
98
|
-
- sass/
|
99
|
-
- sass/susy/_api.scss
|
100
|
-
- sass/susy/_grids.scss
|
101
|
-
- sass/susy/_gutters.scss
|
83
|
+
- sass/susy/_core.scss
|
102
84
|
- sass/susy/_helpers.scss
|
103
|
-
- sass/susy/_language.scss
|
104
85
|
- sass/susy/_math.scss
|
86
|
+
- sass/susy/_settings.scss
|
105
87
|
- sass/susy/api/_float.scss
|
106
|
-
- sass/susy/api/
|
107
|
-
- sass/susy/
|
108
|
-
- sass/susy/
|
109
|
-
- sass/susy/
|
110
|
-
- sass/susy/
|
111
|
-
- sass/susy/
|
112
|
-
- sass/susy/
|
113
|
-
- sass/susy/
|
114
|
-
- sass/susy/
|
115
|
-
- sass/susy/helpers/
|
88
|
+
- sass/susy/api/_shared.scss
|
89
|
+
- sass/susy/api/float/_container.scss
|
90
|
+
- sass/susy/api/float/_end.scss
|
91
|
+
- sass/susy/api/float/_isolate.scss
|
92
|
+
- sass/susy/api/float/_span.scss
|
93
|
+
- sass/susy/api/shared/_container.scss
|
94
|
+
- sass/susy/api/shared/_grid-background.scss
|
95
|
+
- sass/susy/api/shared/_margins.scss
|
96
|
+
- sass/susy/api/shared/_padding.scss
|
97
|
+
- sass/susy/helpers/_direction.scss
|
98
|
+
- sass/susy/helpers/_nth.scss
|
116
99
|
- sass/susy/helpers/_sass-lists.scss
|
117
|
-
- sass/susy/
|
118
|
-
- sass/susy/language/
|
119
|
-
- sass/susy/language/
|
120
|
-
- sass/susy/language/
|
100
|
+
- sass/susy/language/_shared.scss
|
101
|
+
- sass/susy/language/_susy.scss
|
102
|
+
- sass/susy/language/_susy1.scss
|
103
|
+
- sass/susy/language/shared/_context.scss
|
104
|
+
- sass/susy/language/shared/_settings.scss
|
105
|
+
- sass/susy/language/susy/_background.scss
|
106
|
+
- sass/susy/language/susy/_container.scss
|
107
|
+
- sass/susy/language/susy/_functions.scss
|
108
|
+
- sass/susy/language/susy/_gallery.scss
|
109
|
+
- sass/susy/language/susy/_isolate.scss
|
110
|
+
- sass/susy/language/susy/_math.scss
|
111
|
+
- sass/susy/language/susy/_rows.scss
|
112
|
+
- sass/susy/language/susy/_span.scss
|
113
|
+
- sass/susy/language/susy1/_settings.scss
|
121
114
|
- sass/susy/math/_columns.scss
|
122
|
-
- sass/susy/math/
|
123
|
-
- sass/susy/math/
|
124
|
-
- templates/box-sizing/behaviors/box-sizing/boxsizing.htc
|
125
|
-
- templates/box-sizing/behaviors/box-sizing/boxsizing.php
|
126
|
-
- templates/box-sizing/manifest.rb
|
115
|
+
- sass/susy/math/_container.scss
|
116
|
+
- sass/susy/math/_location.scss
|
127
117
|
- templates/project/_base.scss
|
128
|
-
- templates/project/behaviors/box-sizing/boxsizing.htc
|
129
|
-
- templates/project/behaviors/box-sizing/boxsizing.php
|
130
118
|
- templates/project/manifest.rb
|
131
119
|
- templates/project/README.md
|
132
120
|
- templates/project/screen.scss
|
data/sass/README.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
SUSY NEXT
|
2
|
-
============================
|
3
|
-
|
4
|
-
## Guiding Principles
|
5
|
-
|
6
|
-
Susy Next is a next-generation css layout system,
|
7
|
-
allowing a single natural-language input API
|
8
|
-
to create any structural output you might want.
|
9
|
-
|
10
|
-
* The input API must be output-system agnostic.
|
11
|
-
* The input API must be easy to use.
|
12
|
-
* The output style must always be defined by the user.
|
13
|
-
* The system must be future friendly.
|
14
|
-
* The system must be cross-browser compatible.
|
15
|
-
* We will not assume anything about the source HTML.
|
16
|
-
|
17
|
-
## A Separation of Concerns
|
18
|
-
|
19
|
-
In order to accomplish that flexibility,
|
20
|
-
we need to split the Susy architecture into segments:
|
21
|
-
|
22
|
-
1. Input Layer
|
23
|
-
* User facing
|
24
|
-
* Natural language keywords/sentence structure
|
25
|
-
* User facing global variables
|
26
|
-
2. Translation Layer
|
27
|
-
* Translates Input into local variables to be used to calculate output
|
28
|
-
3. Plugin API
|
29
|
-
* Architecture to allow for plugins. Ideally utilizing [Mixin Interpolation](https://github.com/nex3/sass/issues/626) but, until that's available, I suggest a system [similar to this](https://github.com/Snugug/sass-api-test)
|
30
|
-
4. Output Layer
|
31
|
-
* Actual output of CSS
|
32
|
-
* Defined by individual output systems
|
33
|
-
* Shared components are allowed and encouraged (width calculations are going to be more or less the same, for instance)
|
data/sass/susy/_api.scss
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
@mixin grid-span($span, $location, $context: false, $gutter: false, $output-style: $output) {
|
2
|
-
|
3
|
-
@if $output-style == 'float' {
|
4
|
-
@include output-float($span, $location, $context, $gutter);
|
5
|
-
}
|
6
|
-
@else if $output-style == 'isolation' {
|
7
|
-
@include output-isolation($span, $location, $context, $gutter);
|
8
|
-
}
|
9
|
-
}
|
10
|
-
|
11
|
-
@mixin push($span, $location, $context: false, $gutter: false, $output-style: $output) {
|
12
|
-
|
13
|
-
@if $output-style == 'float' {
|
14
|
-
@include push-float($span, $location, $context, $gutter);
|
15
|
-
}
|
16
|
-
@else if $output-style == 'isolation' {
|
17
|
-
@include push-isolation($span, $location, $context, $gutter);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
@mixin pull($span, $location, $context: false, $gutter: false, $output-style: $output) {
|
22
|
-
|
23
|
-
@if $output-style == 'float' {
|
24
|
-
@include pull-float($span, $location, $context, $gutter);
|
25
|
-
}
|
26
|
-
@else if $output-style == 'isolation' {
|
27
|
-
@include pull-isolation($span, $location, $context, $gutter);
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
@mixin isolate($span, $location, $context: false, $gutter: false, $output-style: $output) {
|
32
|
-
|
33
|
-
@if $output-style == 'float' {
|
34
|
-
@include isolate-float($span, $location, $context, $gutter);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
@import "api/float";
|
39
|
-
@import "api/isolation";
|
data/sass/susy/_grids.scss
DELETED
data/sass/susy/_gutters.scss
DELETED
data/sass/susy/_language.scss
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
@mixin output-isolation($span, $location, $columns, $gutter) {
|
2
|
-
@include output-float($span, $location, $columns, $gutter);
|
3
|
-
|
4
|
-
@if not end-row($span, $location, $columns) {
|
5
|
-
@include isolate-float($location - 1, 1, $columns, $gutter);
|
6
|
-
}
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
@mixin push-isolation($span, $location, $columns: false, $gutter: false) {
|
11
|
-
@include push-float($span, $location, $columns, $gutter);
|
12
|
-
}
|
13
|
-
|
14
|
-
@mixin pull-isolation($span, $location, $columns: false, $gutter: false) {
|
15
|
-
@include pull-float($span, $location, $columns, $gutter);
|
16
|
-
}
|
data/sass/susy/grids/_add.scss
DELETED
data/sass/susy/grids/_find.scss
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
//////////////////////////////
|
2
|
-
// Find Grid
|
3
|
-
//
|
4
|
-
// Finds the grid that you are on.
|
5
|
-
// From Singularity
|
6
|
-
// Must be using Breakpoint to work properly
|
7
|
-
//////////////////////////////
|
8
|
-
@function find-grid($user-columns: false) {
|
9
|
-
@return find-object($grids, $user-columns);
|
10
|
-
}
|
data/sass/susy/gutters/_add.scss
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
@function add-gutter($gutter-definition) {
|
2
|
-
$parsed: parse-add($gutter-definition);
|
3
|
-
|
4
|
-
@if nth($parsed, 2) == false and length($gutters) == 0 {
|
5
|
-
@return nth($parsed, 1);
|
6
|
-
}
|
7
|
-
@else {
|
8
|
-
@return append($gutters, (nth($parsed, 1) nth($parsed, 2)), 'comma');
|
9
|
-
}
|
10
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
//////////////////////////////
|
2
|
-
// Find gutter
|
3
|
-
//
|
4
|
-
// Finds the gutter that you are on.
|
5
|
-
// From Singularity
|
6
|
-
// Must be using Breakpoint to work properly
|
7
|
-
//////////////////////////////
|
8
|
-
@function find-gutter($user-gutter: false) {
|
9
|
-
@return find-object($gutters, $user-gutter);
|
10
|
-
}
|