Skip to content

Improve dropdown button alignment and fix hover bug #27632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions templates/devtest/gitea-ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
</div>

<div>
<hr>
<div class="ui tiny button">Button align with ...</div>
<div class="ui dropdown tiny button">
<span class="text">... Dropdown Button</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</div>
</div>
</div>

<div>
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ table th[data-sortt-desc] .svg {
height: 15px;
}

.ui.dropdown {
.ui.dropdown:not(.button) {
line-height: var(--line-height-default); /* the dropdown doesn't have default line-height, use this to make the dropdown icon align with plain dropdown */
}

Expand Down
2 changes: 2 additions & 0 deletions web_src/css/modules/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ It needs some tricks to tweak the left/right borders with active state */
.ui.primary.button:focus,
.ui.primary.buttons .button:focus {
background: var(--color-primary);
color: var(--color-primary-contrast);
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover {
background: var(--color-primary-hover);
color: var(--color-primary-contrast);
}

.ui.primary.button:active,
Expand Down