Skip to content

Evenly spread space between tabs#12944

Merged
Gargron merged 1 commit intomastodon:masterfrom
brawaru:fix/tabs-even-spread
Jan 24, 2020
Merged

Evenly spread space between tabs#12944
Gargron merged 1 commit intomastodon:masterfrom
brawaru:fix/tabs-even-spread

Conversation

@brawaru
Copy link
Copy Markdown
Contributor

@brawaru brawaru commented Jan 24, 2020

This PR 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.

GIF of comparison between changed display and current

Centered according to images below = with fix

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.
@Gargron Gargron merged commit 14ca559 into mastodon:master Jan 24, 2020
@brawaru brawaru mentioned this pull request Jan 26, 2020
@brawaru brawaru deleted the fix/tabs-even-spread branch April 2, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants