mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Prevent layout shift in <overflow-menu>
items (#29831)
There is a small layout shift in when active tab changes. Notice how the actions SVG is unstable:  This is because the active item with bold text is wider then the inactive one. I have applied [this trick](https://stackoverflow.com/a/32570813/808699) to prevent this layout shift. It's only active inside `<overflow-menu>` because I wanted to avoid changing HTML and doing it in regular JS would cause a flicker. I don't expect us to introduce other similar menus without `<overflow-menu>`, so that place is likely fine.  I also changed the weight from 500 to 600, slightly reduced horizontal padding, merged some tab-bar related CSS rules and a added a small margin below repo-header so it does not look so crammed against the buttons on top. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -1778,15 +1778,6 @@ table th[data-sortt-desc] .svg {
|
||||
border-color: var(--color-secondary);
|
||||
}
|
||||
|
||||
.ui.tabular.menu .item {
|
||||
padding: 11px 12px;
|
||||
color: var(--color-text-light-2);
|
||||
}
|
||||
|
||||
.ui.tabular.menu .item:hover {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.ui.tabular.menu .active.item,
|
||||
.ui.tabular.menu .active.item:hover {
|
||||
background: var(--color-body);
|
||||
@@ -1803,17 +1794,36 @@ table th[data-sortt-desc] .svg {
|
||||
border-color: var(--color-secondary);
|
||||
}
|
||||
|
||||
.ui.tabular.menu .item,
|
||||
.ui.secondary.pointing.menu .item {
|
||||
padding: 11px 12px !important;
|
||||
color: var(--color-text-light-2);
|
||||
}
|
||||
|
||||
.ui.tabular.menu .item:hover,
|
||||
.ui.secondary.pointing.menu a.item:hover {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.ui.secondary.pointing.menu .active.item,
|
||||
.ui.secondary.pointing.menu .active.item:hover,
|
||||
.ui.secondary.pointing.menu .dropdown.item:hover,
|
||||
.ui.secondary.pointing.menu a.item:hover {
|
||||
.ui.secondary.pointing.menu .dropdown.item:hover {
|
||||
color: var(--color-text-dark);
|
||||
}
|
||||
|
||||
.ui.tabular.menu .active.item,
|
||||
.ui.secondary.pointing.menu .active.item,
|
||||
.resize-for-semibold::before {
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
.resize-for-semibold::before {
|
||||
content: attr(data-text);
|
||||
visibility: hidden;
|
||||
display: block;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.ui.header {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
Reference in New Issue
Block a user