Permalink
Browse files

Merge pull request #1 from adamstac/master

Hopefully some welcomed changes
  • Loading branch information...
2 parents 32e10a3 + 70bbefb commit 22e00fd17090a25d0a3f3197d490522184ebdacb @bitmanic committed Aug 10, 2011
Showing with 98 additions and 45 deletions.
  1. +1 −0 .gitignore
  2. 0 README.markdown → README.mdown
  3. +9 −0 Rakefile
  4. +0 −45 rem.scss
  5. +32 −0 stylesheets/_rem.sass
  6. +25 −0 stylesheets/_rem.scss
  7. +7 −0 test/config.rb
  8. +14 −0 test/css/screen.css
  9. +10 −0 test/sass/screen.sass
View
@@ -0,0 +1 @@
+.sass-cache
File renamed without changes.
View
@@ -0,0 +1,9 @@
+namespace :sass do
+
+ desc "Converts the Sass to SCSS"
+ task :convert do
+ puts "*** Converting Sass to SCSS ***"
+ system "sass-convert stylesheets/*.sass stylesheets/*.scss"
+ end
+
+end
View
@@ -1,45 +0,0 @@
-// Baseline, measured in pixels
-// The value should be the same as the font-size value for the html element
-// If the html element's font-size is set to 62.5% (of the browser's default font-size of 16px),
-// then the variable below would be 10px.
-$baseline_px: 10px;
-
-@mixin rem($property, $px_values) {
-
- // Convert the baseline into rems
- $baseline_rem: ($baseline_px / 1rem);
-
- // Print the first line in pixel values
- #{$property}: $px_values;
-
- // If there is only one (numeric) value, return the property/value line for it.
- @if type-of($px_values) == 'number' {
- #{$property}: $px_values / $baseline_rem;
- }
-
- // If there is more than one value, create a list and perform equations on each value
- @else {
-
- // Create an empty list that we can dump values into
- $rem_values: ();
-
- @each $value in $px_values {
-
- // If the value is zero, return 0
- @if $value == 0 {
- $rem_values: append($rem_values, $value);
- }
-
- // If the value is not zero, convert it from px to rem
- @else {
- $rem_values: append($rem_values, ($value / $baseline_rem) );
- }
-
- }
-
- // Return the property and its list of converted values
- #{$property}: $rem_values;
-
- }
-
-}
View
@@ -0,0 +1,32 @@
+// Baseline, measured in pixels
+// The value should be the same as the font-size value for the html element
+// If the html element's font-size is set to 62.5% (of the browser's default font-size of 16px),
+// then the variable below would be 10px.
+$baseline-px: 10px
+
+=rem($property, $px-values)
+ // Convert the baseline into rems
+ $baseline-rem: $baseline-px / 1rem
+
+ // Print the first line in pixel values
+ #{$property}: $px-values
+
+ // If there is only one (numeric) value, return the property/value line for it.
+ @if type-of($px-values) == "number"
+ #{$property}: $px-values / $baseline-rem
+ @else
+
+ // Create an empty list that we can dump values into
+ $rem-values: unquote("")
+
+ @each $value in $px-values
+
+ // If the value is zero, return 0
+ @if $value == 0
+ $rem-values: append($rem-values, $value)
+
+ @else
+ $rem-values: append($rem-values, $value / $baseline-rem)
+
+ // Return the property and its list of converted values
+ #{$property}: $rem-values
View
@@ -0,0 +1,25 @@
+// Baseline, measured in pixels
+// The value should be the same as the font-size value for the html element
+// If the html element's font-size is set to 62.5% (of the browser's default font-size of 16px),
+// then the variable below would be 10px.
+$baseline-px: 10px;
+
+@mixin rem($property, $px-values) {
+ // Convert the baseline into rems
+ $baseline-rem: $baseline-px / 1rem;
+ // Print the first line in pixel values
+ #{$property}: $px-values;
+ // If there is only one (numeric) value, return the property/value line for it.
+ @if type-of($px-values) == "number" {
+ #{$property}: $px-values / $baseline-rem; }
+ @else {
+ // Create an empty list that we can dump values into
+ $rem-values: unquote("");
+ @each $value in $px-values {
+ // If the value is zero, return 0
+ @if $value == 0 {
+ $rem-values: append($rem-values, $value); }
+ @else {
+ $rem-values: append($rem-values, $value / $baseline-rem); } }
+ // Return the property and its list of converted values
+ #{$property}: $rem-values; } }
View
@@ -0,0 +1,7 @@
+# Compass config file
+# To install compass gem install compass (you may be required to use the 'sudo' command to install gems)
+
+http_path = "/"
+css_dir = "css"
+sass_dir = "sass"
+line_comments = false
View
@@ -0,0 +1,14 @@
+.foo {
+ font-size: 16px;
+ font-size: 1.6rem;
+}
+
+.bar {
+ margin: 15px 0 15px 0;
+ margin: 1.5rem 0 1.5rem 0;
+}
+
+.baz {
+ padding: 5px 15px 5px 15px;
+ padding: 0.5rem 1.5rem 0.5rem 1.5rem;
+}
View
@@ -0,0 +1,10 @@
+@import "../../stylesheets/rem"
+
+.foo
+ +rem(font-size, 16px)
+
+.bar
+ +rem(margin, 15px 0 15px 0)
+
+.baz
+ +rem(padding, 5px 15px 5px 15px)

0 comments on commit 22e00fd

Please sign in to comment.