Skip to content

CORE-986: Fix color contrast of signup heading #1645

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

Open
wants to merge 1 commit into
base: main
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
6 changes: 0 additions & 6 deletions app/assets/javascripts/newflow/newflow_ui.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ NewflowUi = do () ->
disableButton: (selector) ->
$(selector).attr('disabled', 'disabled')
$(selector).addClass('ui-state-disabled ui-button-disabled')
$(selector).css({
'background': '#ccc',
'box-shadow': 'none',
'color': '#666'
})

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

renderAndOpenDialog: (html_id, content, modal_options = {}) ->
if $('#' + html_id).exists() then $('#' + html_id).remove()
Expand Down
6 changes: 4 additions & 2 deletions app/assets/stylesheets/newflow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ $very-narrow: 37rem * $scale-factor;
padding-right: 0;

background-color: #f1f1f1;
color: #c1c1c1;
color: #666666;

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

input[type=submit] {
&:disabled {
background-color: #ccc;
box-shadow: none;
color: #666;
opacity: 0.85;
}

-webkit-appearance: none;
border-radius: 0;
}
}
Expand Down
16 changes: 15 additions & 1 deletion app/views/newflow/login/login_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
<%= f.submit I18n.t(:"login_signup_form.continue_button"),
disable_with: I18n.t(:"login_signup_form.continue_button"),
class: 'primary',
data: { ga_category: 'Login', ga_action: 'Click', ga_label: 'Email' }
data: { ga_category: 'Login', ga_action: 'Click', ga_label: 'Email' },
disabled: 'disabled'
%>
</div>

Expand All @@ -117,5 +118,18 @@

<script type="text/javascript">
NewflowUi.focusOnFirstErrorItem();
const $requiredInputs = $('form input[aria-required="true"]');
const handleDisable = () => {
const disableSubmit = $requiredInputs.toArray().some((i) => i.value.length == 0);

if (disableSubmit) {
NewflowUi.disableButton('form [type="submit"]');
} else {
NewflowUi.enableButton('form [type="submit"]');
}
}

$requiredInputs.on('input', handleDisable);
handleDisable();
</script>

Loading