Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in pixel to rem, fix some minor requirements issues #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compass/stylesheets/_toolkit-no-css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@
//////////////////////////////
// Import Equal Height Columns
//////////////////////////////
@import "toolkit/equal-height-columns";
@import "toolkit/equal-height-columns";

//////////////////////////////
// Import Pixel to Rem
//////////////////////////////
@import "toolkit/pixel-to-rem";
7 changes: 6 additions & 1 deletion compass/stylesheets/_toolkit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@
//////////////////////////////
// Import Equal Height Columns
//////////////////////////////
@import "toolkit/equal-height-columns";
@import "toolkit/equal-height-columns";

//////////////////////////////
// Import Pixel to Rem
//////////////////////////////
@import "toolkit/pixel-to-rem";
2 changes: 1 addition & 1 deletion compass/stylesheets/toolkit/_border-box.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//////////////////////////////
// Box Sizing anda wesome Border Box!
// Box Sizing and awesome Border Box!
//////////////////////////////
@import "box-sizing";

Expand Down
46 changes: 46 additions & 0 deletions compass/stylesheets/toolkit/_pixel-to-rem.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//////////////////////////////
// Pixel to rem functions.
//////////////////////////////

$legacy-support-for-ie8 : true !default;
$base-font-size : 16px !default;


@mixin pixel-to-rem($item: 'font-size', $value: 16px, $base-size: $base-font-size) {
@if $legacy-support-for-ie8 {
#{$item}: $value;
}

@if (type-of($value) == 'number') {
#{$item}: pixel-to-rem-calc($value, $base-size);
}
@else if (type-of($value) == 'list') {
$values: null;

@each $num in $value {
$new: pixel-to-rem-calc($num, $base-size);
@if $values == null {
$values: $new;
}
@else {
$values: append($values, $new);
}
}
#{$item}: $values;
}
}

@function pixel-to-rem-calc($value, $base-size: $base-font-size) {
@if $value == 0 {
@return 0;
}

$rem-value: ($value / $base-size);

@if unit($rem-value) == "px" {
@return ($rem-value / (1px)) + rem;
}
@else {
@return $rem-value + rem;
}
}
7 changes: 4 additions & 3 deletions config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'susy'
require 'breakpoint'
require 'respond-to'
require 'compass'
require 'singularitygs'
require 'sassy-strings'
require 'color-schemer'
# Require any additional compass plugins here.


Expand Down
7 changes: 6 additions & 1 deletion sass/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,9 @@
$colors: red, white, blue;

@include equal-height-columns($widths, $colors);
}
}

#pixel-to-rem {
@include pixel-to-rem(font-size, 18px);
}

11 changes: 8 additions & 3 deletions stylesheets/screen.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
*,
*:after,
*:before {
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
*behavior: url('/stylesheets/../behaviors/box-sizing/boxsizing.php');
}

img, video {
Expand Down Expand Up @@ -47,5 +46,11 @@ img, video {
background-image: -webkit-linear-gradient(left, #ff0000, #ff0000 25%, #ffffff 25%, #ffffff 75%, #0000ff 75%, #0000ff 100%);
background-image: -moz-linear-gradient(left, #ff0000, #ff0000 25%, #ffffff 25%, #ffffff 75%, #0000ff 75%, #0000ff 100%);
background-image: -o-linear-gradient(left, #ff0000, #ff0000 25%, #ffffff 25%, #ffffff 75%, #0000ff 75%, #0000ff 100%);
background-image: -ms-linear-gradient(left, #ff0000, #ff0000 25%, #ffffff 25%, #ffffff 75%, #0000ff 75%, #0000ff 100%);
background-image: linear-gradient(left, #ff0000, #ff0000 25%, #ffffff 25%, #ffffff 75%, #0000ff 75%, #0000ff 100%);
}

#pixel-to-rem {
font-size: 18px;
font-size: 1.125rem;
}