]> cat aescling's git repositories - mastodon.git/commitdiff
Evenly spread space between tabs (#12944)
authorSasha Sorokin <dafri.nochiterov8@gmail.com>
Fri, 24 Jan 2020 19:50:49 +0000 (14:50 -0500)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 24 Jan 2020 19:50:49 +0000 (20:50 +0100)
This commit fixes uneven spread of space between the tabs in profiles
or notifications (filters). The problem was that links and buttons
shown as blocks had their width determined according to the content
inside of them, so if one tab has more text content than another, it
is going to take over others space, which is uneven and results in
incorrectly aligned (?) tabs display.

By specifying the size of 100% for each tab, parent container will be
forced to divide available space by the number of elements and evenly
give each child fixed space, "text-align: center" then doing its best
job to keep tabs text centered in that space. This relatively fixes
the problem, but will introduce another one - when the block has more
content that its width allows to have, in this scenario the text should
be wrapped or will be displayed over the other elements, but I see this
more as translators' problem. Still, for this case "overflow: hidden"
is added and any unfitting text will be cut out.

app/javascript/styles/mastodon/components.scss

index 922d48ad747b5af648adad4e5b0d67b1e2b23cc0..8147ef28d5ff733b5a22bf1481e872f090a35156 100644 (file)
@@ -5731,6 +5731,8 @@ a.status-card.compact:hover {
     text-align: center;
     text-decoration: none;
     position: relative;
+    overflow: hidden;
+    width: 100%;
 
     &.active {
       color: $secondary-text-color;