From 8811f379498a94f3e3f732ed6bb8c4238ea97b48 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 1 Oct 2019 04:54:29 +0200 Subject: [PATCH] Fix long domain block descriptions breaking table layout (#12029) --- app/javascript/styles/mastodon/about.scss | 21 ++++++++++++++++----- app/views/about/_domain_blocks.html.haml | 6 ++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/javascript/styles/mastodon/about.scss b/app/javascript/styles/mastodon/about.scss index 1dd8b79541..cf16b54ac1 100644 --- a/app/javascript/styles/mastodon/about.scss +++ b/app/javascript/styles/mastodon/about.scss @@ -145,8 +145,6 @@ $small-breakpoint: 960px; thead tr, tbody tr { - break-after: auto; - break-inside: avoid; border-bottom: 1px solid lighten($ui-base-color, 4%); font-size: 1em; line-height: 1.625; @@ -167,12 +165,25 @@ $small-breakpoint: 960px; padding: 8px; align-self: start; align-items: start; + word-break: break-all; &.nowrap { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; width: 25%; + position: relative; + + &::before { + content: ' '; + visibility: hidden; + } + + span { + position: absolute; + left: 8px; + right: 8px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } } } diff --git a/app/views/about/_domain_blocks.html.haml b/app/views/about/_domain_blocks.html.haml index 940bcb9344..e0c5df41d6 100644 --- a/app/views/about/_domain_blocks.html.haml +++ b/app/views/about/_domain_blocks.html.haml @@ -6,5 +6,7 @@ %tbody - domain_blocks.each do |domain_block| %tr - %td.nowrap= domain_block.domain - %td= domain_block.public_comment if display_blocks_rationale? + %td.nowrap + %span{ title: domain_block.domain }= domain_block.domain + %td + = domain_block.public_comment if display_blocks_rationale?