Skip to content

Update pages to master with merged omega and nth-omega #53

Merged
merged 5 commits into from Jan 9, 2013
View
8 Rakefile
@@ -4,7 +4,7 @@ require "rake"
desc "Generate Jekyll site"
task :generate do
puts "Generating site with Jekyll..."
- system "sass --update _sass:css/ -f -r ./_sass/bourbon/lib/bourbon.rb"
+ system "sass --update _sass:css -f -r ./_sass/bourbon/lib/bourbon.rb"
system "jekyll --no-auto --pygments"
end # task :generate
@@ -13,10 +13,10 @@ task :default => [:watch]
desc "Watch the site and regenerate when it changes"
task :watch do
puts "Starting to watch source with Jekyll and Sass..."
-
- system "sass --update _sass:css/ -f -l -r ./_sass/bourbon/lib/bourbon.rb"
+
+ system "sass --update _sass:css -f -l -r ./_sass/bourbon/lib/bourbon.rb"
jekyllPid = Process.spawn("jekyll --auto --server --pygments")
- sassPid = Process.spawn("sass --watch _sass:css/ -l -r ./_sass/bourbon/lib/bourbon.rb")
+ sassPid = Process.spawn("sass --watch _sass:css -l -r ./_sass/bourbon/lib/bourbon.rb")
system "open -a 'Google\ Chrome' 'http://localhost:4000'"
trap("INT") {
View
2 _sass/desktop-example.scss
@@ -160,7 +160,7 @@ section {
height: 8em;
// margin-top: 2em;
@include span-columns(3);
- @include nth-omega(4n);
+ @include omega(4n);
}
}
}
View
3 _sass/neat/_neat.scss
@@ -1,4 +1,4 @@
-// Bourbon Neat 1.0.1
+// Bourbon Neat
// MIT Licensed
// Copyright (c) 2011 thoughtbot, inc.
@@ -8,4 +8,5 @@
// Grid
@import "grid/global-variables";
@import "grid/grid";
+@import "grid/omega";
@import "grid/visual-grid";
View
9 _sass/neat/functions/_private.scss
@@ -18,6 +18,15 @@
@return false;
}
+// Contains display value
+@function contains-display-value($query) {
+ @if belongs-to(table, $query) or belongs-to(block, $query) or belongs-to(inline-block, $query) or belongs-to(inline, $query) {
+ @return true;
+ }
+
+ @return false;
+}
+
// Parses the first argument of span-columns()
@function container-span($span: $span) {
@if length($span) == 3 {
View
32 _sass/neat/grid/_grid.scss
@@ -39,7 +39,7 @@ $fg-max-width: $max-width;
width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
&:last-child {
- padding-right: 0;
+ width: flex-grid($columns, $container-columns);
}
}
@@ -85,32 +85,12 @@ $fg-max-width: $max-width;
// Pad
@mixin pad($padding: flex-gutter()) {
- padding: $padding;
-}
-
-// Remove element gutter
-@mixin omega($display: block, $direction: right) {
- @if $display == table {
- padding-#{$direction}: 0;
- }
-
- @else {
- margin-#{$direction}: 0;
- }
-}
-
-@mixin nth-omega($nth, $display: block, $direction: right) {
- @if $display == table {
- &:nth-child(#{$nth}) {
- padding-#{$direction}: 0;
- }
- }
-
- @else {
- &:nth-child(#{$nth}) {
- margin-#{$direction}: 0;
- }
+ $padding-list: null;
+ @each $value in $padding {
+ $value: if($value == 'default', flex-gutter(), $value);
+ $padding-list: join($padding-list, $value);
}
+ padding: $padding-list;
}
// Fill 100% of parent
View
68 _sass/neat/grid/_omega.scss
@@ -0,0 +1,68 @@
+// Remove last element gutter
+@mixin omega($query: block, $direction: right) {
+ $table: if(belongs-to(table, $query), true, false);
+ $auto: if(belongs-to(auto, $query), true, false);
+
+ @if length($query) == 1 {
+ @if $auto {
+ &:last-child {
+ margin-#{$direction}: 0;
+ }
+ }
+
+ @else if contains-display-value($query) {
+ @if $table {
+ padding-#{$direction}: 0;
+ }
+
+ @else {
+ margin-#{$direction}: 0;
+ }
+ }
+
+ @else {
+ &:nth-child(#{$query}) {
+ margin-#{$direction}: 0;
+ }
+ }
+ }
+
+ @else if length($query) == 2 {
+ @if $table {
+ @if $auto {
+ &:last-child {
+ padding-#{$direction}: 0;
+ }
+ }
+
+ @else {
+ &:nth-child(#{nth($query, 1)}) {
+ padding-#{$direction}: 0;
+ }
+ }
+ }
+
+ @else {
+ @if $auto {
+ &:last-child {
+ margin-#{$direction}: 0;
+ }
+ }
+
+ @else {
+ &:nth-child(#{nth($query, 1)}) {
+ margin-#{$direction}: 0;
+ }
+ }
+ }
+ }
+
+ @else {
+ @warn "Too many arguments passed to the omega() mixin."
+ }
+}
+
+@mixin nth-omega($nth, $display: block, $direction: right) {
+ @warn "The nth-omega() mixin is deprecated. Please use omega() instead.";
+ @include omega($nth $display, $direction);
+}
View
4 css/desktop-example.css
@@ -185,15 +185,15 @@ section {
padding: 2.35765%;
border-right: 1px solid rgba(255, 255, 255, 0.5); }
section.third div#alpha aside:last-child {
- padding-right: 0; }
+ width: 31.76157%; }
section.third div#alpha article {
height: 20em;
display: table-cell;
padding-right: 2.35765%;
width: 68.23843%;
padding: 2.35765%; }
section.third div#alpha article:last-child {
- padding-right: 0; }
+ width: 65.88078%; }
section.fourth div.one-column {
display: block;
float: left;
View
4 css/ie-example.css
@@ -518,15 +518,15 @@ section {
padding: 2.35765%;
border-right: 1px solid rgba(255, 255, 255, 0.5); }
section.third div#alpha aside:last-child {
- padding-right: 0; }
+ width: 31.76157%; }
section.third div#alpha article {
height: 20em;
display: table-cell;
padding-right: 2.35765%;
width: 68.23843%;
padding: 2.35765%; }
section.third div#alpha article:last-child {
- padding-right: 0; }
+ width: 65.88078%; }
section.fourth div.one-column {
display: block;
float: left;
View
2 examples/index.html
@@ -127,7 +127,7 @@
<pre>
li.block {
@include span-columns(3);
- @include nth-omega(4n);
+ @include omega(4n);
}</pre>
</div>
<div class="box">
View
2 index.html
@@ -86,5 +86,5 @@
</section>
-<footer>© 2012 thoughtbot, inc.</footer>
+<footer>© 2012 – {{ site.time | date: '%Y' }} thoughtbot, inc.</footer>
Something went wrong with that request. Please try again.