susy 2.0.0.beta.2 → 2.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/docs/changelog.rst +9 -0
- data/sass/_susyone.scss +4 -0
- data/sass/susy/language/_susyone.scss +15 -0
- data/sass/susy/language/susy/_background.scss +1 -1
- data/sass/susy/language/susyone/_background.scss +18 -0
- data/sass/susy/language/susyone/_functions.scss +372 -0
- data/sass/susy/language/susyone/_grid.scss +305 -0
- data/sass/susy/language/susyone/_isolation.scss +51 -0
- data/sass/susy/language/susyone/_margin.scss +93 -0
- data/sass/susy/language/susyone/_media.scss +105 -0
- data/sass/susy/language/susyone/_padding.scss +92 -0
- data/sass/susy/language/susyone/_settings.scss +56 -0
- data/sass/susy/language/susyone/_units.scss +159 -0
- metadata +14 -2
@@ -0,0 +1,105 @@
|
|
1
|
+
// ---------------------------------------------------------------------------
|
2
|
+
// Media Mixins
|
3
|
+
|
4
|
+
// Create a new layout context for (@content) descendants.
|
5
|
+
//
|
6
|
+
// $layout-cols : a (unitless) number of columns to use for this layout.
|
7
|
+
@mixin layout(
|
8
|
+
$layout-cols
|
9
|
+
) {
|
10
|
+
// store default $total-columns setting for later, then change it.
|
11
|
+
$default-layout : $total-columns;
|
12
|
+
$total-columns : $layout-cols !global;
|
13
|
+
|
14
|
+
// apply children in this new layout context.
|
15
|
+
@content;
|
16
|
+
|
17
|
+
// return to default $total-columns setting.
|
18
|
+
$total-columns : $default-layout !global;
|
19
|
+
}
|
20
|
+
|
21
|
+
// Nest a block of code inside a new media-query and layout context.
|
22
|
+
//
|
23
|
+
// $media-layout : a list of values [$min $layout $max $ie] including...
|
24
|
+
// : - one unitless number (columns in a layout)
|
25
|
+
// : - two optional lengths (min and max-width media-query breakpoints).
|
26
|
+
// : - one optional boolean or string to trigger fallback support for IE.
|
27
|
+
// $font-size : [optional] The base font-size of your layout, if you are using ems.
|
28
|
+
// : - defaults to $base-font-size
|
29
|
+
@mixin at-breakpoint(
|
30
|
+
$media-layout,
|
31
|
+
$font-size: $base-font-size
|
32
|
+
) {
|
33
|
+
$media-layout : medialayout($media-layout,$font-size);
|
34
|
+
$min : nth($media-layout,1);
|
35
|
+
$layout : nth($media-layout,2);
|
36
|
+
$max : nth($media-layout,3);
|
37
|
+
$ie : nth($media-layout,4);
|
38
|
+
|
39
|
+
@if (not $breakpoint-media-output) and (not $breakpoint-ie-output) and (not $breakpoint-raw-output) {
|
40
|
+
@warn "Either $breakpoint-media-output, $breakpoint-ie-output, or $breakpoint-raw-output must be true for at-breakpoint to work.";
|
41
|
+
}
|
42
|
+
|
43
|
+
// We need to have either a min-width breakpoint or a layout in order to proceed.
|
44
|
+
@if $min or $layout or $max {
|
45
|
+
|
46
|
+
// If we don't have a layout, we create one based on the min-width.
|
47
|
+
@if not $layout {
|
48
|
+
$layout: get-layout($min);
|
49
|
+
}
|
50
|
+
|
51
|
+
// If we still don't have a layout, we have a problem.
|
52
|
+
@if $layout {
|
53
|
+
// Set our new layout context.
|
54
|
+
@include layout($layout) {
|
55
|
+
@if $breakpoint-media-output {
|
56
|
+
@include with-browser-ranges(css-mediaqueries) {
|
57
|
+
@if $min and $max {
|
58
|
+
// Both $min and $max
|
59
|
+
@media (min-width: $min) and (max-width: $max) {
|
60
|
+
@content;
|
61
|
+
}
|
62
|
+
} @else {
|
63
|
+
@if (not $min) and (not $max) {
|
64
|
+
// Neither $min nor $max:
|
65
|
+
// We can create a breakpoint based on the number of columns in the layout.
|
66
|
+
$min: fix-ems(container-outer-width($width: false));
|
67
|
+
}
|
68
|
+
@if $min {
|
69
|
+
// Min only:
|
70
|
+
@media (min-width: $min) {
|
71
|
+
@content;
|
72
|
+
}
|
73
|
+
} @else {
|
74
|
+
// Max only:
|
75
|
+
@media (max-width: $max) {
|
76
|
+
@content;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
// Set an IE fallback
|
83
|
+
@if $ie and $breakpoint-ie-output {
|
84
|
+
@if (type-of($ie) == 'bool') {
|
85
|
+
$ie: 'lt-ie9';
|
86
|
+
}
|
87
|
+
.#{$ie} & {
|
88
|
+
@content;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
@if $breakpoint-raw-output {
|
93
|
+
@content;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
} @else {
|
97
|
+
@warn "We were unable to determine a layout for your breakpoint.";
|
98
|
+
}
|
99
|
+
|
100
|
+
} @else {
|
101
|
+
@warn "You need to provide either a valid layout (number of columns)
|
102
|
+
or a valid media-query min-width breakpoint (length).";
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
// ---------------------------------------------------------------------------
|
2
|
+
// Padding Mixins
|
3
|
+
|
4
|
+
// add empty colums as padding before an element.
|
5
|
+
// $columns : The number of columns to prefix.
|
6
|
+
// $context : [optional] The context (columns spanned by parent).
|
7
|
+
// : Context is required on any nested elements.
|
8
|
+
// : Context MUST NOT be declared on a root element.
|
9
|
+
// $from : The start direction of your layout (e.g. 'left' for ltr languages)
|
10
|
+
// $style : The container style to use.
|
11
|
+
@mixin prefix(
|
12
|
+
$columns,
|
13
|
+
$context : $total-columns,
|
14
|
+
$from : $from-direction,
|
15
|
+
$style : fix-static-misalignment()
|
16
|
+
) {
|
17
|
+
$from : unquote($from);
|
18
|
+
padding-#{$from}: space($columns, $context, $style);
|
19
|
+
}
|
20
|
+
|
21
|
+
// add empty colums as padding after an element.
|
22
|
+
// $columns : The number of columns to suffix.
|
23
|
+
// $context : [optional] The context (columns spanned by parent).
|
24
|
+
// : Context is required on any nested elements.
|
25
|
+
// : Context MUST NOT be declared on a root element.
|
26
|
+
// $from : The start direction of your layout (e.g. 'left' for ltr languages)
|
27
|
+
// $style : The container style to use.
|
28
|
+
@mixin suffix(
|
29
|
+
$columns,
|
30
|
+
$context : $total-columns,
|
31
|
+
$from : $from-direction,
|
32
|
+
$style : fix-static-misalignment()
|
33
|
+
) {
|
34
|
+
$from : unquote($from);
|
35
|
+
$to : opposite-position($from);
|
36
|
+
padding-#{$to}: space($columns, $context, $style);
|
37
|
+
}
|
38
|
+
|
39
|
+
// add empty colums as padding before and after an element.
|
40
|
+
// $columns : The number of columns to pad.
|
41
|
+
// $context : [optional] The context (columns spanned by parent).
|
42
|
+
// : Context is required on any nested elements.
|
43
|
+
// : Context MUST NOT be declared on a root element.
|
44
|
+
// $from : The start direction of your layout (e.g. 'left' for ltr languages)
|
45
|
+
// $style : The container style to use.
|
46
|
+
@mixin pad(
|
47
|
+
$prefix : false,
|
48
|
+
$suffix : false,
|
49
|
+
$context : $total-columns,
|
50
|
+
$from : $from-direction,
|
51
|
+
$style : fix-static-misalignment()
|
52
|
+
) {
|
53
|
+
$from : unquote($from);
|
54
|
+
@if $prefix {
|
55
|
+
@include prefix($prefix, $context, $from, $style);
|
56
|
+
}
|
57
|
+
@if $suffix {
|
58
|
+
@include suffix($suffix, $context, $from, $style);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
// Bleed into colums with margin/padding on any side of an element.
|
63
|
+
// $width : The side of the bleed.
|
64
|
+
// : Any unit-length will be used directly.
|
65
|
+
// : Any unitless number will be used as a column-count.
|
66
|
+
// : Use "2 of 6" format to represent 2 cals in a 6-col nested context.
|
67
|
+
// $sides : One or more sides to bleed [ top | right | bottom | left | all ].
|
68
|
+
// $style : The container style to use.
|
69
|
+
@mixin bleed(
|
70
|
+
$width: $grid-padding,
|
71
|
+
$sides: left right,
|
72
|
+
$style: fix-static-misalignment()
|
73
|
+
) {
|
74
|
+
@if $border-box-sizing { @include box-sizing(content-box) }
|
75
|
+
|
76
|
+
@if type-of($width) == 'list' {
|
77
|
+
$width: filter($width, of);
|
78
|
+
$width: space(nth($width,1), nth($width,2), $style);
|
79
|
+
} @else if unitless($width) {
|
80
|
+
$width: space($width, $style: $style);
|
81
|
+
}
|
82
|
+
|
83
|
+
@if $sides == 'all' {
|
84
|
+
margin: - $width;
|
85
|
+
padding: $width;
|
86
|
+
} @else {
|
87
|
+
@each $side in $sides {
|
88
|
+
margin-#{$side}: - $width;
|
89
|
+
padding-#{$side}: $width;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
// ---------------------------------------------------------------------------
|
2
|
+
// Susy Settings
|
3
|
+
|
4
|
+
// The total number of columns in the grid
|
5
|
+
$total-columns : 12 !default;
|
6
|
+
|
7
|
+
// The width of columns and gutters.
|
8
|
+
// These must all be set with the comparable units.
|
9
|
+
$column-width : 4em !default;
|
10
|
+
$gutter-width : 1em !default;
|
11
|
+
|
12
|
+
// Padding on the left and right of a Grid Container.
|
13
|
+
$grid-padding : $gutter-width !default;
|
14
|
+
|
15
|
+
// ---------------------------------------------------------------------------
|
16
|
+
// Advanced Settings
|
17
|
+
|
18
|
+
// From Direction:
|
19
|
+
// Controls for right-to-left or bi-directional sites.
|
20
|
+
$from-direction : left !default;
|
21
|
+
|
22
|
+
// Omega Float Direction:
|
23
|
+
// The direction that +omega elements are floated by deafult.
|
24
|
+
$omega-float : opposite-position($from-direction) !default;
|
25
|
+
|
26
|
+
// Container Width:
|
27
|
+
// Override the total width of your grid, using any length (50em, 75%, etc.)
|
28
|
+
$container-width : false !default;
|
29
|
+
|
30
|
+
// Container Style:
|
31
|
+
// 'magic' - Static (fixed or elastic) when there's enough space,
|
32
|
+
// fluid when there isn't. This is the SUSY MAGIC SAUCE(TM).
|
33
|
+
// 'static' - Forces the grid container to remain static at all times.
|
34
|
+
// 'fluid' - Forces the grid to remain fluid at all times.
|
35
|
+
// (this will overrule any static $container-width settings)
|
36
|
+
$container-style : magic !default;
|
37
|
+
|
38
|
+
// Border-Box Sizing
|
39
|
+
// Adjust the grid math appropriately for box-sizing: border-box;
|
40
|
+
// Warning: This does not actually apply the new box model!
|
41
|
+
// In most cases you can ignore this setting,
|
42
|
+
// and simply apply the border-box-sizing mixin.
|
43
|
+
$border-box-sizing : false !default;
|
44
|
+
|
45
|
+
// ---------------------------------------------------------------------------
|
46
|
+
// IE Settings
|
47
|
+
|
48
|
+
// When you are using a seperate IE stylesheet,
|
49
|
+
// you can use these settings to control the output of at-breakpoint.
|
50
|
+
// By default, at-breakpoint will output media-queries as well as
|
51
|
+
// any defined ie-fallback classes.
|
52
|
+
$breakpoint-media-output : true !default;
|
53
|
+
$breakpoint-ie-output : true !default;
|
54
|
+
|
55
|
+
// Danger Zone! Only set as 'true' in IE-specific style sheets.
|
56
|
+
$breakpoint-raw-output : false !default;
|
@@ -0,0 +1,159 @@
|
|
1
|
+
// @private Default font-size for all browsers
|
2
|
+
$browser-default-font-size: 16px;
|
3
|
+
|
4
|
+
// Base font size in pixels, if not already defined.
|
5
|
+
// Should be the same as the font-size of the html element.
|
6
|
+
$base-font-size: 16px !default;
|
7
|
+
|
8
|
+
// Whether to output fallback values in px when outputting rems.
|
9
|
+
$rem-with-px-fallback: true !default;
|
10
|
+
|
11
|
+
// Convert any CSS <length> or <percentage> value to any another.
|
12
|
+
//
|
13
|
+
// @param $length
|
14
|
+
// A css <length> or <percentage> value
|
15
|
+
//
|
16
|
+
// @param $to-unit
|
17
|
+
// String matching a css unit keyword, e.g. 'em', '%', etc.
|
18
|
+
//
|
19
|
+
// @param $from-context
|
20
|
+
// When converting from relative units, the absolute length (in px) to
|
21
|
+
// which $length refers (e.g. for $lengths in em units, would normally be the
|
22
|
+
// font-size of the current element).
|
23
|
+
//
|
24
|
+
// @param $to-context
|
25
|
+
// For converting to relative units, the absolute length in px to which the
|
26
|
+
// output value will refer. Defaults to the same as $from-context, since it is
|
27
|
+
// rarely needed.
|
28
|
+
@function convert-length(
|
29
|
+
$length,
|
30
|
+
$to-unit,
|
31
|
+
$from-context: $base-font-size,
|
32
|
+
$to-context: $from-context
|
33
|
+
) {
|
34
|
+
|
35
|
+
$from-unit: unit($length);
|
36
|
+
|
37
|
+
// Optimize for cases where `from` and `to` units are accidentally the same.
|
38
|
+
@if $from-unit == $to-unit { @return $length; }
|
39
|
+
|
40
|
+
// Context values must be in px so we can determine a conversion ratio for
|
41
|
+
// relative units.
|
42
|
+
@if unit($from-context) != 'px' { @warn "Paremeter $from-context must resolve to a value in pixel units."; }
|
43
|
+
@if unit($to-context) != 'px' { @warn "Parameter $to-context must resolve to a value in pixel units."; }
|
44
|
+
|
45
|
+
// Convert input length to pixels
|
46
|
+
$px-length: $length;
|
47
|
+
|
48
|
+
@if $from-unit != 'px' {
|
49
|
+
// Convert relative units using the from-context parameter.
|
50
|
+
@if $from-unit == 'em' { $px-length: $length * $from-context / 1em }
|
51
|
+
@else if $from-unit == 'rem' { $px-length: $length * $base-font-size / 1rem }
|
52
|
+
@else if $from-unit == '%' { $px-length: $length * $from-context / 100% }
|
53
|
+
@else if $from-unit == 'ex' { $px-length: $length * $from-context / 2ex }
|
54
|
+
// Convert absolute units using Sass' conversion table.
|
55
|
+
@else if $from-unit == 'in' or
|
56
|
+
$from-unit == 'mm' or
|
57
|
+
$from-unit == 'cm' or
|
58
|
+
$from-unit == 'pt' or
|
59
|
+
$from-unit == 'pc' { $px-length: 0px + $length }
|
60
|
+
// Certain units can't be converted.
|
61
|
+
@else if $from-unit == 'ch' or
|
62
|
+
$from-unit == 'vw' or
|
63
|
+
$from-unit == 'vh' or
|
64
|
+
$from-unit == 'vmin' {
|
65
|
+
@warn "#{$from-unit} units can't be reliably converted; Returning original value.";
|
66
|
+
@return $length;
|
67
|
+
}
|
68
|
+
@else {
|
69
|
+
@warn "#{$from-unit} is an unknown length unit. Returning original value.";
|
70
|
+
@return $length;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
// Convert length in pixels to the output unit
|
75
|
+
$output-length: $px-length;
|
76
|
+
@if $to-unit != 'px' {
|
77
|
+
// Relative units
|
78
|
+
@if $to-unit == 'em' { $output-length: $px-length * 1em / $to-context }
|
79
|
+
@else if $to-unit == 'rem' { $output-length: $px-length * 1rem / $base-font-size }
|
80
|
+
@else if $to-unit == '%' { $output-length: $px-length * 100% / $to-context }
|
81
|
+
@else if $to-unit == 'ex' { $output-length: $px-length * 2ex / $to-context }
|
82
|
+
// Absolute units
|
83
|
+
@else if $to-unit == 'in' { $output-length: 0in + $px-length }
|
84
|
+
@else if $to-unit == 'mm' { $output-length: 0mm + $px-length }
|
85
|
+
@else if $to-unit == 'cm' { $output-length: 0cm + $px-length }
|
86
|
+
@else if $to-unit == 'pt' { $output-length: 0pt + $px-length }
|
87
|
+
@else if $to-unit == 'pc' { $output-length: 0pc + $px-length }
|
88
|
+
// Non-convertible units
|
89
|
+
@else if $to-unit == 'ch' or
|
90
|
+
$to-unit == 'vw' or
|
91
|
+
$to-unit == 'vh' or
|
92
|
+
$to-unit == 'vmin' {
|
93
|
+
@warn "#{$to-unit} units can't be reliably converted; Returning original value.";
|
94
|
+
@return $length;
|
95
|
+
}
|
96
|
+
@else {
|
97
|
+
@warn "#{$to-unit} is an unknown length unit. Returning original value.";
|
98
|
+
@return $length;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
@return $output-length;
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
// Output a given style rule containing rem values along with an (optional)
|
107
|
+
// fallback rule for older browsers (with rem values converted to px).
|
108
|
+
//
|
109
|
+
// @param $property
|
110
|
+
// The css property name.
|
111
|
+
//
|
112
|
+
// @param $values
|
113
|
+
// The value (or space-separated list of values) for the property.
|
114
|
+
//
|
115
|
+
// @param $use-px-fallback
|
116
|
+
// [ true | false ]
|
117
|
+
//
|
118
|
+
@mixin rem($property, $values, $use-px-fallback: $rem-with-px-fallback) {
|
119
|
+
// Create a couple of empty lists as output buffers.
|
120
|
+
$px-values: ();
|
121
|
+
$rem-values: ();
|
122
|
+
|
123
|
+
// Loop through the $values list
|
124
|
+
@each $value in $values {
|
125
|
+
// For each property value, if it's in rem or px, derive both rem and
|
126
|
+
// px values for it and add those to the end of the appropriate buffer.
|
127
|
+
// Ensure all pixel values are rounded to the nearest pixel.
|
128
|
+
@if type-of($value) == number and not unitless($value) and (unit($value) == px or unit($value) == rem) {
|
129
|
+
@if unit($value) == px {
|
130
|
+
$px-values: join($px-values, round($value));
|
131
|
+
$rem-values: join($rem-values, convert-length($value, rem));
|
132
|
+
}
|
133
|
+
@else {
|
134
|
+
$px-values: join($px-values, round(convert-length($value, px)));
|
135
|
+
$rem-values: join($rem-values, $value);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
@else {
|
139
|
+
$px-values: join($px-values, $value);
|
140
|
+
$rem-values: join($rem-values, $value);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
// Use pixel fallback for browsers that don't understand rem units.
|
145
|
+
@if $use-px-fallback {
|
146
|
+
#{$property}: $px-values;
|
147
|
+
}
|
148
|
+
|
149
|
+
// Use rem values for everyone else (overrides pixel values).
|
150
|
+
#{$property}: $rem-values;
|
151
|
+
}
|
152
|
+
|
153
|
+
@mixin if-rem($property, $values, $use-px-fallback: $rem-with-px-fallback) {
|
154
|
+
$has-rem: false;
|
155
|
+
@each $value in $values { $has-rem: if(unit($value) == 'rem', true, $has-rem); }
|
156
|
+
@if $has-rem { @include rem($property, $values, $use-px-fallback); }
|
157
|
+
@else { #{$property}: $values; }
|
158
|
+
}
|
159
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: susy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.beta.
|
4
|
+
version: 2.0.0.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Meyer
|
@@ -53,9 +53,11 @@ files:
|
|
53
53
|
- lib/compass-susy.rb
|
54
54
|
- lib/susy.rb
|
55
55
|
- sass/_susy.scss
|
56
|
+
- sass/_susyone.scss
|
56
57
|
- sass/susy/_math.scss
|
57
58
|
- sass/susy/language/_shared.scss
|
58
59
|
- sass/susy/language/_susy.scss
|
60
|
+
- sass/susy/language/_susyone.scss
|
59
61
|
- sass/susy/language/shared/_maps.scss
|
60
62
|
- sass/susy/language/susy/_background.scss
|
61
63
|
- sass/susy/language/susy/_bleed.scss
|
@@ -72,6 +74,15 @@ files:
|
|
72
74
|
- sass/susy/language/susy/_rows.scss
|
73
75
|
- sass/susy/language/susy/_settings.scss
|
74
76
|
- sass/susy/language/susy/_span.scss
|
77
|
+
- sass/susy/language/susyone/_background.scss
|
78
|
+
- sass/susy/language/susyone/_functions.scss
|
79
|
+
- sass/susy/language/susyone/_grid.scss
|
80
|
+
- sass/susy/language/susyone/_isolation.scss
|
81
|
+
- sass/susy/language/susyone/_margin.scss
|
82
|
+
- sass/susy/language/susyone/_media.scss
|
83
|
+
- sass/susy/language/susyone/_padding.scss
|
84
|
+
- sass/susy/language/susyone/_settings.scss
|
85
|
+
- sass/susy/language/susyone/_units.scss
|
75
86
|
- sass/susy/math/_columns.scss
|
76
87
|
- sass/susy/math/_settings.scss
|
77
88
|
- sass/susy/math/_validation.scss
|
@@ -96,7 +107,8 @@ files:
|
|
96
107
|
- README.md
|
97
108
|
- VERSION
|
98
109
|
homepage: http://susy.oddbird.net/
|
99
|
-
licenses:
|
110
|
+
licenses:
|
111
|
+
- BSD-3-Clause
|
100
112
|
metadata: {}
|
101
113
|
post_install_message:
|
102
114
|
rdoc_options:
|