Skip to content

Commit

Permalink
Fix contrast between background and form elements on some pages (mast…
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Aug 2, 2024
1 parent cc453f2 commit 2ec1181
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 37 deletions.
5 changes: 0 additions & 5 deletions app/controllers/auth/confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController

layout 'auth'

before_action :set_body_classes
before_action :set_confirmation_user!, only: [:show, :confirm_captcha]
before_action :redirect_confirmed_user, if: :signed_in_confirmed_user?

Expand Down Expand Up @@ -73,10 +72,6 @@ def signed_in_confirmed_user?
user_signed_in? && current_user.confirmed? && current_user.unconfirmed_email.blank?
end

def set_body_classes
@body_classes = 'lighter'
end

def after_resending_confirmation_instructions_path_for(_resource_name)
if user_signed_in?
if current_user.confirmed? && current_user.approved?
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/auth/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class Auth::PasswordsController < Devise::PasswordsController
skip_before_action :check_self_destruct!
before_action :redirect_invalid_reset_token, only: :edit, unless: :reset_password_token_is_valid?
before_action :set_body_classes

layout 'auth'

Expand All @@ -24,10 +23,6 @@ def redirect_invalid_reset_token
redirect_to new_password_path(resource_name)
end

def set_body_classes
@body_classes = 'lighter'
end

def reset_password_token_is_valid?
resource_class.with_reset_password_token(params[:reset_password_token]).present?
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/auth/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def invite_code
private

def set_body_classes
@body_classes = %w(edit update).include?(action_name) ? 'admin' : 'lighter'
@body_classes = 'admin' if %w(edit update).include?(action_name)
end

def set_invite
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/auth/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class Auth::SessionsController < Devise::SessionsController

include Auth::TwoFactorAuthenticationConcern

before_action :set_body_classes

content_security_policy only: :new do |p|
p.form_action(false)
end
Expand Down Expand Up @@ -103,10 +101,6 @@ def require_no_authentication

private

def set_body_classes
@body_classes = 'lighter'
end

def home_paths(resource)
paths = [about_path, '/explore']

Expand Down
5 changes: 0 additions & 5 deletions app/controllers/auth/setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class Auth::SetupController < ApplicationController

before_action :authenticate_user!
before_action :require_unconfirmed_or_pending!
before_action :set_body_classes
before_action :set_user

skip_before_action :require_functional!
Expand Down Expand Up @@ -35,10 +34,6 @@ def set_user
@user = current_user
end

def set_body_classes
@body_classes = 'lighter'
end

def user_params
params.require(:user).permit(:email)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def authenticate_with_two_factor_via_otp(user)
def prompt_for_two_factor(user)
register_attempt_in_session(user)

@body_classes = 'lighter'
@webauthn_enabled = user.webauthn_enabled?
@scheme_type = if user.webauthn_enabled? && user_params[:otp_attempt].blank?
'webauthn'
Expand Down
1 change: 0 additions & 1 deletion app/controllers/concerns/challengable_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def require_challenge!
end

def render_challenge
@body_classes = 'lighter'
render 'auth/challenges/new', layout: 'auth'
end

Expand Down
5 changes: 0 additions & 5 deletions app/controllers/mail_subscriptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class MailSubscriptionsController < ApplicationController

skip_before_action :require_functional!

before_action :set_body_classes
before_action :set_user
before_action :set_type

Expand All @@ -25,10 +24,6 @@ def set_user
not_found unless @user
end

def set_body_classes
@body_classes = 'lighter'
end

def set_type
@type = email_type_from_param
end
Expand Down
8 changes: 0 additions & 8 deletions app/javascript/styles/mastodon/basics.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ body {
}
}

&.lighter {
background: $ui-base-color;
}

&.with-modals {
overflow-x: hidden;
overflow-y: scroll;
Expand Down Expand Up @@ -109,7 +105,6 @@ body {
}

&.embed {
background: lighten($ui-base-color, 4%);
margin: 0;
padding-bottom: 0;

Expand All @@ -122,15 +117,12 @@ body {
}

&.admin {
background: var(--background-color);
padding: 0;
}

&.error {
position: absolute;
text-align: center;
color: $darker-text-color;
background: $ui-base-color;
width: 100%;
height: 100%;
padding: 0;
Expand Down

0 comments on commit 2ec1181

Please sign in to comment.