From be1afe01e99de4b88c24f4b82fee6f6e04cf10f1 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 6 Aug 2021 00:35:27 +0200 Subject: [PATCH] Fill horizontal space on medium-sized viewports This removes the horrible side margins on portrait tablets --- app/assets/stylesheets/components/_container.scss | 4 ++++ app/views/announcement/edit.haml | 2 +- app/views/announcement/index.haml | 2 +- app/views/announcement/new.haml | 2 +- app/views/answer/show.haml | 2 +- app/views/layouts/feed.haml | 2 +- app/views/layouts/inbox.haml | 2 +- app/views/layouts/moderation.haml | 2 +- app/views/layouts/notifications.haml | 2 +- app/views/layouts/user/settings.haml | 2 +- app/views/settings/security/recovery_keys.haml | 2 +- app/views/static/privacy_policy.haml | 2 +- app/views/static/terms.haml | 2 +- 13 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/components/_container.scss b/app/assets/stylesheets/components/_container.scss index 08d9bf08..789beb24 100644 --- a/app/assets/stylesheets/components/_container.scss +++ b/app/assets/stylesheets/components/_container.scss @@ -1,4 +1,8 @@ .container--main { padding-top: map-get($spacers, 3); padding-bottom: map-get($spacers, 3); + // Sass doesn't know about the safe-area-inset-* env vars and throws a syntax error + // We can get around this by using unquote() + padding-left: unquote('max(15px, env(safe-area-inset-left))'); + padding-right: unquote('max(15px, env(safe-area-inset-right))'); } \ No newline at end of file diff --git a/app/views/announcement/edit.haml b/app/views/announcement/edit.haml index e0a4c43b..840877ed 100644 --- a/app/views/announcement/edit.haml +++ b/app/views/announcement/edit.haml @@ -1,5 +1,5 @@ - provide(:title, generate_title('Edit announcement')) -.container.container--main +.container-lg.container--main .card .card-body = bootstrap_form_for(@announcement, url: { action: 'update' }, method: 'PATCH') do |f| diff --git a/app/views/announcement/index.haml b/app/views/announcement/index.haml index 1cf04dda..40aa7f8f 100644 --- a/app/views/announcement/index.haml +++ b/app/views/announcement/index.haml @@ -1,5 +1,5 @@ - provide(:title, generate_title('Announcements')) -.container.container--main +.container-lg.container--main - @announcements.each do |announcement| .card .card-body diff --git a/app/views/announcement/new.haml b/app/views/announcement/new.haml index a4495bc7..3363c72b 100644 --- a/app/views/announcement/new.haml +++ b/app/views/announcement/new.haml @@ -1,5 +1,5 @@ - provide(:title, generate_title('Add new announcement')) -.container.container--main +.container-lg.container--main .card .card-body = bootstrap_form_for(@announcement, url: { action: 'create' }) do |f| diff --git a/app/views/answer/show.haml b/app/views/answer/show.haml index 90888280..5f84d47d 100644 --- a/app/views/answer/show.haml +++ b/app/views/answer/show.haml @@ -1,4 +1,4 @@ - provide(:title, answer_title(@answer)) - provide(:og, answer_opengraph(@answer)) -.container.container--main +.container-lg.container--main = render 'answerbox', a: @answer, display_all: @display_all diff --git a/app/views/layouts/feed.haml b/app/views/layouts/feed.haml index a62654f7..94434e16 100644 --- a/app/views/layouts/feed.haml +++ b/app/views/layouts/feed.haml @@ -1,4 +1,4 @@ -.container.container--main +.container-lg.container--main .row .col-md-3.col-sm-4.d-none.d-sm-block = render 'shared/sidebar' diff --git a/app/views/layouts/inbox.haml b/app/views/layouts/inbox.haml index 8dcff72c..8b82f9d6 100644 --- a/app/views/layouts/inbox.haml +++ b/app/views/layouts/inbox.haml @@ -1,4 +1,4 @@ -.container.container--main +.container-lg.container--main .row .col-md-3.col-xs-12.col-sm-4.order-2.order-sm-1 = render 'inbox/sidebar', delete_id: @delete_id, disabled: @disabled, inbox_count: @inbox_count diff --git a/app/views/layouts/moderation.haml b/app/views/layouts/moderation.haml index 46954223..22a48339 100644 --- a/app/views/layouts/moderation.haml +++ b/app/views/layouts/moderation.haml @@ -1,5 +1,5 @@ = render 'navigation/moderation' -.container.container--main +.container-lg.container--main .row .col-md-3.col-sm-4.col-xs-12 = render 'tabs/moderation' diff --git a/app/views/layouts/notifications.haml b/app/views/layouts/notifications.haml index f495ae8e..37225c3e 100644 --- a/app/views/layouts/notifications.haml +++ b/app/views/layouts/notifications.haml @@ -1,5 +1,5 @@ = render 'navigation/notification' -.container.container--main +.container-lg.container--main .row .col-md-3.col-xs-12.col-sm-4 = render 'tabs/notifications' diff --git a/app/views/layouts/user/settings.haml b/app/views/layouts/user/settings.haml index 77e5a5f6..5f238bab 100644 --- a/app/views/layouts/user/settings.haml +++ b/app/views/layouts/user/settings.haml @@ -1,4 +1,4 @@ -.container.container--main +.container-lg.container--main .row .col-md-3.col-xs-12.col-sm-4 = render 'tabs/settings' diff --git a/app/views/settings/security/recovery_keys.haml b/app/views/settings/security/recovery_keys.haml index c09e9164..fe7174df 100644 --- a/app/views/settings/security/recovery_keys.haml +++ b/app/views/settings/security/recovery_keys.haml @@ -1,4 +1,4 @@ -.container.container--main +.container-lg.container--main .row.justify-content-center .col-md-5.totp-setup__recovery-container .card diff --git a/app/views/static/privacy_policy.haml b/app/views/static/privacy_policy.haml index 5e99850c..0f51121d 100644 --- a/app/views/static/privacy_policy.haml +++ b/app/views/static/privacy_policy.haml @@ -1,5 +1,5 @@ - provide(:title, generate_title('Privacy Policy')) -.container.container--main +.container-lg.container--main .card .card-body = raw_markdown_io 'service-docs/en/policy/privacy.md' diff --git a/app/views/static/terms.haml b/app/views/static/terms.haml index 6650c250..b72c1002 100644 --- a/app/views/static/terms.haml +++ b/app/views/static/terms.haml @@ -1,5 +1,5 @@ - provide(:title, generate_title('Terms of Service')) -.container.container--main +.container-lg.container--main .card .card-body = raw_markdown_io 'service-docs/en/policy/terms.md'