From 1a08e7ae49c03681d3ca5db97fbf2bab48a625d2 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 23 Jun 2016 14:06:36 -0400 Subject: [PATCH] Finalize styling for registration flow /cc @carljbowman One issue we ran into is that our `frameless` configuration is in `em` rather than `rem`, making it difficult to have an aboslute grid applied uniformly at all hierarchies. For now, we're using straight `rem` calculations instead of `$cols{1,8}` in the styling until we can refactor `frameless` to use `em`. --- src/components/deck/deck.scss | 22 +++-- src/components/forms/charcount.jsx | 2 +- src/components/forms/charcount.scss | 4 +- src/components/forms/checkbox-group.scss | 2 +- src/components/forms/checkbox.scss | 6 ++ src/components/forms/input.scss | 2 +- src/components/forms/phone-input.scss | 2 +- src/components/forms/radio-group.scss | 14 +-- src/components/forms/select.scss | 14 ++- src/components/forms/textarea.scss | 18 +--- src/components/registration/steps.jsx | 3 + .../stepnavigation/stepnavigation.scss | 10 +- src/components/tooltip/tooltip.jsx | 2 +- src/components/tooltip/tooltip.scss | 25 +++-- src/routes.json | 3 +- .../teacherregistration.jsx | 2 - .../teacherregistration.scss | 92 +++++++++++++++++-- static/svgs/forms/carot-hover.svg | 1 + static/svgs/forms/carot.svg | 1 + static/svgs/tooltip/info.svg | 1 + 20 files changed, 162 insertions(+), 64 deletions(-) create mode 100644 static/svgs/forms/carot-hover.svg create mode 100644 static/svgs/forms/carot.svg create mode 100644 static/svgs/tooltip/info.svg diff --git a/src/components/deck/deck.scss b/src/components/deck/deck.scss index abaf3407e..ac527f7b7 100644 --- a/src/components/deck/deck.scss +++ b/src/components/deck/deck.scss @@ -7,8 +7,9 @@ min-height: 100vh; img { - padding: 10px 0; - width: 125px; + margin-left: 2px; + padding: 12px 0; + width: 76px; } .step-navigation { @@ -50,7 +51,7 @@ padding: 3rem 4rem; .form-group { - margin-bottom: 2rem; + margin-bottom: 1.2rem; &.has-error { .input { @@ -118,12 +119,17 @@ } } -.radio { - width: 50%; - line-height: 3rem; +@media only screen and (max-width: $mobile - 1) { + .card { + width: 22.5rem; + } - input { - margin-right: 1rem; + .form { + text-align: left; + + .button { + width: 22.5rem; + } } } diff --git a/src/components/forms/charcount.jsx b/src/components/forms/charcount.jsx index ef65afe1c..af6192ebe 100644 --- a/src/components/forms/charcount.jsx +++ b/src/components/forms/charcount.jsx @@ -19,7 +19,7 @@ var CharCount = React.createClass({ ); return (

- ({this.props.currentCharacters}/{this.props.maxCharacters}) + {this.props.currentCharacters}/{this.props.maxCharacters}

); } diff --git a/src/components/forms/charcount.scss b/src/components/forms/charcount.scss index 39875bb76..57f968a8d 100644 --- a/src/components/forms/charcount.scss +++ b/src/components/forms/charcount.scss @@ -2,7 +2,9 @@ p { &.char-count { - color: $active-dark-gray; + letter-spacing: 1px; + color: lighten($type-gray, 30%); + font-weight: 500; &.overmax { color: $ui-orange; diff --git a/src/components/forms/checkbox-group.scss b/src/components/forms/checkbox-group.scss index 436e2a88b..9ce20f29f 100644 --- a/src/components/forms/checkbox-group.scss +++ b/src/components/forms/checkbox-group.scss @@ -3,7 +3,7 @@ flex-flow: column wrap; .checkbox { - margin: 16px 0; + margin: .5rem 0; } } } diff --git a/src/components/forms/checkbox.scss b/src/components/forms/checkbox.scss index 136d77f98..e91bd587b 100644 --- a/src/components/forms/checkbox.scss +++ b/src/components/forms/checkbox.scss @@ -18,7 +18,13 @@ input { } &:checked { + transition: all .5s ease; + box-shadow: 0 0 0 .25rem $active-gray; background-color: $ui-blue; + text-align: center; + text-indent: .125rem; + line-height: 1.25rem; + font-size: .75rem; &:after { color: $type-white; diff --git a/src/components/forms/input.scss b/src/components/forms/input.scss index fce707a75..3849a6e99 100644 --- a/src/components/forms/input.scss +++ b/src/components/forms/input.scss @@ -6,7 +6,7 @@ $pass-bg: lighten($ui-aqua, 35%); .input { transition: all .5s ease; - margin: .8rem 0; + margin: .75rem 0; border: 1px solid $active-gray; border-radius: 5px; background-color: $base-bg; diff --git a/src/components/forms/phone-input.scss b/src/components/forms/phone-input.scss index ca3009275..b2a0ff733 100644 --- a/src/components/forms/phone-input.scss +++ b/src/components/forms/phone-input.scss @@ -1,7 +1,7 @@ @import "../../colors"; .input-group { - margin: .8rem 0; + margin: .75rem 0; width: 100%; } diff --git a/src/components/forms/radio-group.scss b/src/components/forms/radio-group.scss index 7fc85cfe4..3b0720a44 100644 --- a/src/components/forms/radio-group.scss +++ b/src/components/forms/radio-group.scss @@ -8,9 +8,9 @@ &[type="radio"] { margin-top: 1px; border: 1px solid $active-gray; - border-radius: .8rem; - width: .8rem; - height: .8rem; + border-radius: 50%; + width: .875rem; + height: .875rem; appearance: none; &:checked, @@ -19,15 +19,17 @@ } &:checked { + transition: all .25s ease; + box-shadow: 0 0 0 .25rem $active-gray; background-color: $ui-blue; &:after { display: block; transform: translate(.25rem, .25rem); - border-radius: .2rem; + border-radius: 50%; background-color: $ui-white; - width: .2rem; - height: .2rem; + width: .25rem; + height: .25rem; content: ""; } } diff --git a/src/components/forms/select.scss b/src/components/forms/select.scss index 1e16b7321..a070404fa 100644 --- a/src/components/forms/select.scss +++ b/src/components/forms/select.scss @@ -8,11 +8,12 @@ } select { - margin: .8rem 0; + transition: all .5s ease; + margin: .75rem 0; border: 1px solid $active-gray; border-radius: 5px; - background: $ui-light-gray url("../../../static/images/dropdown.png") no-repeat right center; - background-size: 1rem 1rem; + background: $ui-light-gray url("../../../static/svgs/forms/carot.svg") no-repeat right center; + padding-right: 4rem; width: 100%; height: 3rem; text-indent: 1rem; @@ -20,7 +21,14 @@ select { appearance: none; &:focus { + transition: all .5s ease; outline: none; + border: 1px solid $ui-blue; + } + + &:focus, + &:hover { + background: $ui-light-gray url("../../../static/svgs/forms/carot-hover.svg") no-repeat right center; } > option { diff --git a/src/components/forms/textarea.scss b/src/components/forms/textarea.scss index d7dd0e32d..fa8503cca 100644 --- a/src/components/forms/textarea.scss +++ b/src/components/forms/textarea.scss @@ -1,16 +1,11 @@ @import "../../colors"; -$base-bg: $ui-light-gray; -$focus-bg: lighten($ui-light-gray, 35%); -$fail-bg: lighten($ui-orange, 35%); -$pass-bg: lighten($ui-aqua, 35%); - .textarea { transition: all 1s ease; margin: .75rem 0; border: 1px solid $active-gray; border-radius: 5px; - background-color: $base-bg; + background-color: $ui-light-gray; padding: .75rem 1rem; width: 100%; min-height: 15rem; @@ -21,17 +16,10 @@ $pass-bg: lighten($ui-aqua, 35%); &:focus { transition: all 1s ease; outline: none; - border: 1px solid $active-dark-gray; - background-color: $focus-bg; + border: 1px solid $ui-blue; } &.fail { - border: 1px solid $active-dark-gray; - background-color: $fail-bg; - } - - &.pass { - border: 1px solid $active-dark-gray; - background-color: $pass-bg; + border: 1px solid $ui-orange; } } diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index 8c5a86bfd..b3af8de1e 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -537,6 +537,8 @@ module.exports = { }, render: function () { var formatMessage = this.props.intl.formatMessage; + var textAreaClass = (this.state.characterCount > this.props.maxCharacters) ? 'fail' : ''; + return (

@@ -551,6 +553,7 @@ module.exports = {