From 97516b1e1d1775cc9e56a261ed99101d03401121 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Fri, 24 Jun 2016 11:19:41 -0400 Subject: [PATCH] styling cleanup for teacher registration some scoping, as well as class labeling --- src/components/deck/deck.scss | 197 +++++++++++------------ src/components/forms/charcount.scss | 14 +- src/components/forms/checkbox-group.scss | 10 +- src/components/forms/checkbox.scss | 54 +++---- src/components/forms/radio-group.scss | 56 +++---- src/components/forms/select.scss | 52 +++--- src/components/registration/steps.jsx | 8 +- 7 files changed, 194 insertions(+), 197 deletions(-) diff --git a/src/components/deck/deck.scss b/src/components/deck/deck.scss index ac527f7b7..c8ff26caf 100644 --- a/src/components/deck/deck.scss +++ b/src/components/deck/deck.scss @@ -14,141 +14,138 @@ .step-navigation { margin-top: 2rem; - } -} - -.slide { - max-width: 28.75rem; - - h2, - p { - text-align: center; - color: $type-white; + text-align: center; } - .description { - margin-top: 0; - margin-bottom: 2rem; + .slide { + max-width: 28.75rem; + + h2, + .description { + text-align: center; + color: $type-white; + } + + .description { + margin-top: 0; + margin-bottom: 2rem; + } } -} -.card { - margin: 0 auto; - width: 23.75rem; - - &, - h2, - p { - color: $type-gray; + .card { + margin: 0 auto; + width: 23.75rem; } -} -.step-navigation { - text-align: center; -} + .form { + padding: 3rem 4rem; -.form { - padding: 3rem 4rem; + .form-group { + margin-bottom: 1.2rem; - .form-group { - margin-bottom: 1.2rem; + &.has-error { + .input { + border: 1px solid $ui-orange; + } + } + } - &.has-error { - .input { - border: 1px solid $ui-orange; + .button { + margin: 0 0 -3rem -4rem; + border-radius: .5rem; + box-shadow: none; + width: 23.75rem; + height: 4rem; + + &.card-button { + display: block; + border-top-left-radius: 0; + border-top-right-radius: 0; + background-color: $ui-aqua; + } + + &:hover { + box-shadow: none; } } } - .button { - margin: 0 0 -3rem -4rem; - border-radius: .5rem; - box-shadow: none; - width: 23.75rem; - height: 4rem; - - &.card-button { - display: block; - border-top-left-radius: 0; - border-top-right-radius: 0; - background-color: $ui-aqua; - } - - &:hover { - box-shadow: none; - } + .input { + width: $cols5; } -} -.input { - width: $cols5; -} - -.help-block { - $arrow-border-width: 1rem; - display: block; - position: absolute; - margin-left: $arrow-border-width; - border: 1px solid $active-gray; - border-radius: 5px; - background-color: $ui-orange; - padding: 1rem; - max-width: 18.75rem; - min-height: 1rem; - max-height: 3rem; - overflow: visible; - color: $type-white; - - &:before { + .help-block { + $arrow-border-width: 1rem; display: block; position: absolute; - top: 1rem; - left: -$arrow-border-width / 2; - - transform: rotate(45deg); - - border-bottom: 1px solid $active-gray; - border-left: 1px solid $active-gray; + margin-left: $arrow-border-width; + border: 1px solid $active-gray; border-radius: 5px; - background-color: $ui-orange; - width: $arrow-border-width; - height: $arrow-border-width; + padding: 1rem; + max-width: 18.75rem; + min-height: 1rem; + max-height: 3rem; + overflow: visible; + color: $type-white; - content: ""; + &:before { + display: block; + position: absolute; + top: 1rem; + left: -$arrow-border-width / 2; + + transform: rotate(45deg); + + border-bottom: 1px solid $active-gray; + border-left: 1px solid $active-gray; + border-radius: 5px; + + background-color: $ui-orange; + width: $arrow-border-width; + height: $arrow-border-width; + + content: ""; + } } } @media only screen and (max-width: $mobile - 1) { - .card { - width: 22.5rem; - } - - .form { - text-align: left; - - .button { + .deck { + .card { width: 22.5rem; } + + .form { + text-align: left; + + .button { + width: 22.5rem; + } + } } } @media only screen and (max-width: $tablet - 1) { - .input { - width: 90%; + .deck { + .input { + width: 90%; + } } } @media only screen and (max-width: $desktop - 1) { - .help-block { - position: relative; - transform: none; - margin: inherit; - width: 100%; - height: inherit; + .deck { + .help-block { + position: relative; + transform: none; + margin: inherit; + width: 100%; + height: inherit; - &:before { - display: none; + &:before { + display: none; + } } } } diff --git a/src/components/forms/charcount.scss b/src/components/forms/charcount.scss index 57f968a8d..ff5d85e94 100644 --- a/src/components/forms/charcount.scss +++ b/src/components/forms/charcount.scss @@ -1,13 +1,11 @@ @import "../../colors"; -p { - &.char-count { - letter-spacing: 1px; - color: lighten($type-gray, 30%); - font-weight: 500; +.char-count { + letter-spacing: 1px; + color: lighten($type-gray, 30%); + font-weight: 500; - &.overmax { - color: $ui-orange; - } + &.overmax { + color: $ui-orange; } } diff --git a/src/components/forms/checkbox-group.scss b/src/components/forms/checkbox-group.scss index 9ce20f29f..29613c177 100644 --- a/src/components/forms/checkbox-group.scss +++ b/src/components/forms/checkbox-group.scss @@ -1,9 +1,11 @@ .checkbox-group { - .col-sm-9 { - flex-flow: column wrap; + .row { + .col-sm-9 { + flex-flow: column wrap; - .checkbox { - margin: .5rem 0; + .checkbox { + margin: .5rem 0; + } } } } diff --git a/src/components/forms/checkbox.scss b/src/components/forms/checkbox.scss index be3e0a97b..9d031d157 100644 --- a/src/components/forms/checkbox.scss +++ b/src/components/forms/checkbox.scss @@ -6,37 +6,37 @@ label { font-weight: 300; } - } -} -input { - &[type=checkbox] { - display: block; - float: left; - margin-right: 1rem; - border: 1px solid $active-gray; - border-radius: 3px; - width: 1.25rem; - height: 1.25rem; - appearance: none; + input { + &[type=checkbox] { + display: block; + float: left; + margin-right: 1rem; + border: 1px solid $active-gray; + border-radius: 3px; + width: 1.25rem; + height: 1.25rem; + appearance: none; - &:checked, - &:focus { - outline: none; - } + &:checked, + &:focus { + outline: none; + } - &: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; + &: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; - content: "\2714"; + &:after { + color: $type-white; + content: "\2714"; + } + } } } } diff --git a/src/components/forms/radio-group.scss b/src/components/forms/radio-group.scss index 7594003ae..dbb4626e2 100644 --- a/src/components/forms/radio-group.scss +++ b/src/components/forms/radio-group.scss @@ -6,39 +6,39 @@ font-weight: 300; } } -} -.col-sm-9 { - display: flex; - flex-flow: row wrap; + .col-sm-9 { + display: flex; + flex-flow: row wrap; - input { - &[type="radio"] { - margin-top: 1px; - border: 1px solid $active-gray; - border-radius: 50%; - width: .875rem; - height: .875rem; - appearance: none; + input { + &[type="radio"] { + margin-top: 1px; + border: 1px solid $active-gray; + border-radius: 50%; + width: .875rem; + height: .875rem; + appearance: none; - &:checked, - &:focus { - outline: none; - } + &:checked, + &:focus { + outline: none; + } - &:checked { - transition: all .25s ease; - box-shadow: 0 0 0 .25rem $active-gray; - background-color: $ui-blue; + &: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: 50%; - background-color: $ui-white; - width: .25rem; - height: .25rem; - content: ""; + &:after { + display: block; + transform: translate(.25rem, .25rem); + border-radius: 50%; + background-color: $ui-white; + width: .25rem; + height: .25rem; + content: ""; + } } } } diff --git a/src/components/forms/select.scss b/src/components/forms/select.scss index a070404fa..d001cab27 100644 --- a/src/components/forms/select.scss +++ b/src/components/forms/select.scss @@ -5,34 +5,34 @@ label { font-weight: 500; } -} -select { - transition: all .5s ease; - margin: .75rem 0; - border: 1px solid $active-gray; - border-radius: 5px; - background: $ui-light-gray url("../../../static/svgs/forms/carot.svg") no-repeat right center; - padding-right: 4rem; - width: 100%; - height: 3rem; - text-indent: 1rem; - font-size: .875rem; - appearance: none; - - &:focus { + select { 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 { - background-color: $ui-white; + margin: .75rem 0; + border: 1px solid $active-gray; + border-radius: 5px; + background: $ui-light-gray url("../../../static/svgs/forms/carot.svg") no-repeat right center; + padding-right: 4rem; width: 100%; + height: 3rem; + text-indent: 1rem; + font-size: .875rem; + 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 { + background-color: $ui-white; + width: 100%; + } } } diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index 5d0ca6d9e..b9db7716e 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -291,7 +291,7 @@ module.exports = {

-

+

@@ -359,7 +359,7 @@ module.exports = {

-

+

@@ -448,7 +448,7 @@ module.exports = { return this.props.onNextStep(formData); } else { return invalidate({ - 'all': + 'all': }); } }.bind(this)); @@ -693,7 +693,7 @@ module.exports = {

Something went wrong

-

There was an error while processing your registration

+

There was an error while processing your registration

{this.props.registrationError}