From a577e8111b72c3405437dffb84781ec4f2735142 Mon Sep 17 00:00:00 2001 From: Mike Francis Date: Thu, 4 Jul 2013 22:31:54 +0100 Subject: [PATCH] Change to rems --- _/scss/_vars.scss | 1 + _/scss/generic/_mixins.scss | 10 ++++++ _/scss/generic/_normalise.scss | 12 +++++-- _/scss/objects/_forms.scss | 21 ++++++----- header.php | 4 +-- style.css | 42 +++++++++++----------- template-form.php | 65 ++++++++++++++++++++++++++++++++++ 7 files changed, 121 insertions(+), 34 deletions(-) create mode 100644 template-form.php diff --git a/_/scss/_vars.scss b/_/scss/_vars.scss index da0eb6b..ceadc65 100755 --- a/_/scss/_vars.scss +++ b/_/scss/_vars.scss @@ -34,4 +34,5 @@ $input-border: solid 1px #ccc; $input-background: #fff; $btn-border: solid 1px #ccc; $btn-background: #eee; +$btn-background-hover: #ddd; $btn-color: #333; \ No newline at end of file diff --git a/_/scss/generic/_mixins.scss b/_/scss/generic/_mixins.scss index 9575c19..01a6cfa 100755 --- a/_/scss/generic/_mixins.scss +++ b/_/scss/generic/_mixins.scss @@ -44,4 +44,14 @@ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to)); background-image: -moz-linear-gradient($from, $to); background-image: -o-linear-gradient($from, $to); +} + +@function calculate-rem($size) { + $remSize: $size / 10; + @return #{$remSize}rem; +} + +@mixin font-size($size) { + font-size: $size + px; //Fallback in px + font-size: calculate-rem($size); } \ No newline at end of file diff --git a/_/scss/generic/_normalise.scss b/_/scss/generic/_normalise.scss index 18490d1..c45c31a 100755 --- a/_/scss/generic/_normalise.scss +++ b/_/scss/generic/_normalise.scss @@ -1,7 +1,14 @@ html { background-color: $base-background-colour; color: $base-colour; - font: #{(($base-font-size / 16) * 1em)}/#{$base-line-height} $base-font-stack; + font-size: 62.5%; +} + +body { + //font: #{(($base-font-size / 16) * 1em)}/#{$base-line-height} $base-font-stack; + font-family: $base-font-stack; + @include font-size($base-font-size); + line-height: $base-line-height; } h1, h2, h3, h4, h5, h6, p, ul, ol, table, pre, fieldset { @@ -9,8 +16,7 @@ h1, h2, h3, h4, h5, h6, p, ul, ol, table, pre, fieldset { } h1 { - font-size: ($h1-font-size / $base-font-size) * 1em; - line-height: ($base-margin-bottom / $h1-font-size ) * 1em; + @include font-size($h1-font-size); } h2 { diff --git a/_/scss/objects/_forms.scss b/_/scss/objects/_forms.scss index 468fb15..8a3cd93 100755 --- a/_/scss/objects/_forms.scss +++ b/_/scss/objects/_forms.scss @@ -3,13 +3,11 @@ input, select, textarea, button { font-family: $base-font-stack; font-size: 1em; line-height: $base-margin-bottom + px; - padding: 2.5px 5px; + padding: 4px 8px; color: $base-colour; background: $input-background; border: $input-border; @include border-radius(3px); - margin-right: 5px; - margin-bottom: -1px; width: 208px; } @@ -31,16 +29,21 @@ textarea { @extend .clearfix; } + .checkbox input { + width: auto; + } + .btn { - cursor: pointer; - display: inline-block; background: $btn-background; - color: $btn-color; - line-height: $base-margin-bottom + px; border: $btn-border; @include border-radius(3px); - @include gradient(#fff, #eee); + color: $btn-color; + cursor: pointer; + display: inline-block; + line-height: $base-margin-bottom + px; + padding: 5px 20px; + width: auto; &:hover { - @include gradient(#eee, #fff); + background: $btn-background-hover; } } \ No newline at end of file diff --git a/header.php b/header.php index bfb68b9..f78d914 100755 --- a/header.php +++ b/header.php @@ -4,8 +4,9 @@ - <?php wp_title( ' – ', true, 'right' ); bloginfo( 'name' ); ?> + <?php wp_title( ' / ', true, 'right' ); bloginfo( 'name' ); ?> +