Skip to content
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

Fix use of inline CSS in public pages #13576

Merged
merged 1 commit into from May 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/helpers/home_helper.rb
Expand Up @@ -7,13 +7,13 @@ def default_props
}
end

def account_link_to(account, button = '', size: 36, path: nil)
def account_link_to(account, button = '', path: nil)
content_tag(:div, class: 'account') do
content_tag(:div, class: 'account__wrapper') do
section = if account.nil?
content_tag(:div, class: 'account__display-name') do
content_tag(:div, class: 'account__avatar-wrapper') do
content_tag(:div, '', class: 'account__avatar', style: "width: #{size}px; height: #{size}px; background-size: #{size}px #{size}px; background-image: url(#{full_asset_url('avatars/original/missing.png', skip_pipeline: true)})")
image_tag(full_asset_url('avatars/original/missing.png', skip_pipeline: true), class: 'account__avatar')
end +
content_tag(:span, class: 'display-name') do
content_tag(:strong, t('about.contact_missing')) +
Expand All @@ -23,7 +23,7 @@ def account_link_to(account, button = '', size: 36, path: nil)
else
link_to(path || ActivityPub::TagManager.instance.url_for(account), class: 'account__display-name') do
content_tag(:div, class: 'account__avatar-wrapper') do
content_tag(:div, '', class: 'account__avatar', style: "width: #{size}px; height: #{size}px; background-size: #{size}px #{size}px; background-image: url(#{full_asset_url(current_account&.user&.setting_auto_play_gif ? account.avatar_original_url : account.avatar_static_url)})")
image_tag(full_asset_url(current_account&.user&.setting_auto_play_gif ? account.avatar_original_url : account.avatar_static_url), class: 'account__avatar')
end +
content_tag(:span, class: 'display-name') do
content_tag(:bdi) do
Expand Down
12 changes: 0 additions & 12 deletions app/javascript/styles/mastodon/about.scss
Expand Up @@ -543,12 +543,6 @@ $small-breakpoint: 960px;
flex: 0 0 auto;
}

&__avatar {
width: 44px;
height: 44px;
background-size: 44px 44px;
}

.display-name {
font-size: 15px;

Expand Down Expand Up @@ -749,12 +743,6 @@ $small-breakpoint: 960px;
display: flex;
align-items: center;
}

.account__avatar {
width: 44px;
height: 44px;
background-size: 44px 44px;
}
}

&__counters__wrapper {
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/styles/mastodon/components.scss
Expand Up @@ -1318,8 +1318,13 @@

.account__avatar {
@include avatar-radius;
display: block;
position: relative;

width: 36px;
height: 36px;
background-size: 36px 36px;

&-inline {
display: inline-block;
vertical-align: middle;
Expand Down
6 changes: 0 additions & 6 deletions app/javascript/styles/mastodon/widgets.scss
Expand Up @@ -93,12 +93,6 @@
display: flex;
align-items: center;
}

.account__avatar {
width: 44px;
height: 44px;
background-size: 44px 44px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I can see anywhere else is 36px, does this mean a design change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there was no place where these classes were used without overriding all of this to 36px

}
}

.trends__item {
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/reports/index.html.haml
Expand Up @@ -25,7 +25,7 @@
- target_account = reports.first.target_account
.report-card
.report-card__profile
= account_link_to target_account, '', size: 36, path: admin_account_path(target_account.id)
= account_link_to target_account, '', path: admin_account_path(target_account.id)
.report-card__profile__stats
= link_to t('admin.reports.account.notes', count: target_account.targeted_moderation_notes.count), admin_account_path(target_account.id)
%br/
Expand Down