Skip to content

Commit a15f0c6

Browse files
committed
CORE-986: Fix color contrast of signup heading
[CORE-986] New color contrast ratio is 5. Also moved the disabled-submit styling to CSS Also added some JS to control the disabled state of the Continue button on login.
1 parent 31bddde commit a15f0c6

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

app/assets/javascripts/newflow/newflow_ui.js.coffee

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ NewflowUi = do () ->
22
disableButton: (selector) ->
33
$(selector).attr('disabled', 'disabled')
44
$(selector).addClass('ui-state-disabled ui-button-disabled')
5-
$(selector).css({
6-
'background': '#ccc',
7-
'box-shadow': 'none',
8-
'color': '#666'
9-
})
105

116
enableButton: (selector) ->
127
$(selector).removeAttr('disabled')
138
$(selector).removeClass('ui-state-disabled ui-button-disabled')
149
$(selector).button()
15-
$(selector).css({ 'background': '', 'box-shadow': '', 'color': '' })
1610

1711
renderAndOpenDialog: (html_id, content, modal_options = {}) ->
1812
if $('#' + html_id).exists() then $('#' + html_id).remove()

app/assets/stylesheets/newflow.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ $very-narrow: 37rem * $scale-factor;
645645
padding-right: 0;
646646

647647
background-color: #f1f1f1;
648-
color: #c1c1c1;
648+
color: #666666;
649649

650650
@include title-font(2.4rem);
651651
text-align: center;
@@ -745,10 +745,12 @@ $very-narrow: 37rem * $scale-factor;
745745

746746
input[type=submit] {
747747
&:disabled {
748+
background-color: #ccc;
749+
box-shadow: none;
750+
color: #666;
748751
opacity: 0.85;
749752
}
750753

751-
-webkit-appearance: none;
752754
border-radius: 0;
753755
}
754756
}

app/views/newflow/login/login_form.html.erb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
<%= f.submit I18n.t(:"login_signup_form.continue_button"),
9393
disable_with: I18n.t(:"login_signup_form.continue_button"),
9494
class: 'primary',
95-
data: { ga_category: 'Login', ga_action: 'Click', ga_label: 'Email' }
95+
data: { ga_category: 'Login', ga_action: 'Click', ga_label: 'Email' },
96+
disabled: 'disabled'
9697
%>
9798
</div>
9899

@@ -117,5 +118,18 @@
117118

118119
<script type="text/javascript">
119120
NewflowUi.focusOnFirstErrorItem();
121+
const $requiredInputs = $('form input[aria-required="true"]');
122+
const handleDisable = () => {
123+
const disableSubmit = $requiredInputs.toArray().some((i) => i.value.length == 0);
124+
125+
if (disableSubmit) {
126+
NewflowUi.disableButton('form [type="submit"]');
127+
} else {
128+
NewflowUi.enableButton('form [type="submit"]');
129+
}
130+
}
131+
132+
$requiredInputs.on('input', handleDisable);
133+
handleDisable();
120134
</script>
121135

0 commit comments

Comments
 (0)