From da47b5d058869c826191b29f977e7fa5759857f0 Mon Sep 17 00:00:00 2001 From: Nat Date: Thu, 7 Sep 2023 10:49:17 +0800 Subject: [PATCH] Unset width for sorting methods on mobile --- assets/stylesheets/common/post-voting.scss | 3 --- assets/stylesheets/desktop/post-voting.scss | 5 +++++ assets/stylesheets/mobile/post-voting.scss | 1 + plugin.rb | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 assets/stylesheets/desktop/post-voting.scss diff --git a/assets/stylesheets/common/post-voting.scss b/assets/stylesheets/common/post-voting.scss index 1552bf7a..4f137190 100644 --- a/assets/stylesheets/common/post-voting.scss +++ b/assets/stylesheets/common/post-voting.scss @@ -22,9 +22,6 @@ } .post-voting-answers-header { - width: calc( - var(--topic-body-width) + var(--topic-body-width-padding) * 2 + 45px - ); box-sizing: border-box; display: flex; flex-direction: row; diff --git a/assets/stylesheets/desktop/post-voting.scss b/assets/stylesheets/desktop/post-voting.scss new file mode 100644 index 00000000..a2c4c487 --- /dev/null +++ b/assets/stylesheets/desktop/post-voting.scss @@ -0,0 +1,5 @@ +.post-voting-answers-header { + width: calc( + var(--topic-body-width) + var(--topic-body-width-padding) * 2 + 45px + ); +} diff --git a/assets/stylesheets/mobile/post-voting.scss b/assets/stylesheets/mobile/post-voting.scss index aab40fbc..2b86024a 100644 --- a/assets/stylesheets/mobile/post-voting.scss +++ b/assets/stylesheets/mobile/post-voting.scss @@ -1,6 +1,7 @@ .post-voting-topic, .post-voting-topic-sort-by-activity { .post-voting-answers-header { + width: unset; padding: 0; padding-bottom: 1em; border-top: none; diff --git a/plugin.rb b/plugin.rb index 3168728c..e0f00d91 100644 --- a/plugin.rb +++ b/plugin.rb @@ -7,7 +7,9 @@ # url: https://github.com/discourse/discourse-post-voting # transpile_js: true -%i[common mobile].each { |type| register_asset "stylesheets/#{type}/post-voting.scss", type } +%i[common mobile desktop].each do |type| + register_asset "stylesheets/#{type}/post-voting.scss", type +end register_asset "stylesheets/common/post-voting-crawler.scss" enabled_site_setting :post_voting_enabled