Skip to content
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

Adjust line-height on dashboard sidebar #25600

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion templates/user/dashboard/issues.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</a>
<div class="divider"></div>
<a class="{{if not $.RepoIDs}}active{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}">
<span class="text truncate">All</span>
<span class="text truncate">{{.locale.Tr "all"}}</span>
<span>{{CountFmt .TotalIssueCount}}</span>
</a>
{{range .Repos}}
Expand Down
3 changes: 3 additions & 0 deletions web_src/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
display: flex;
align-items: center;
justify-content: space-between;
line-height: 1.3; /* avoid cut-off letters because of too little line-height from fomantic */
silverwind marked this conversation as resolved.
Show resolved Hide resolved
padding-top: 8.9px; /* adjust for increased line-height */
padding-bottom: 8.9px; /* adjust for increased line-height */
Comment on lines +25 to +26
Copy link
Contributor

@wxiaoguang wxiaoguang Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen similar code before (and removed some of them)

IMO it's better to avoid such "fine-tuning", it seems pretty hacky.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this .1px really have a visible impact? I'd say 9px or even 8px should be okay

Copy link
Member Author

@silverwind silverwind Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The impact is quite big actually: padding difference is n * 2, e.g. for list of 10 items, 0.1px padding difference will be off by 2 pixels. This is caused by fomantic using some weird calculated padding like 0.912561em. We could theoretically alter the fomantic base styles so the padding is only integer pixels.

}

.dashboard.feeds .filter.menu .item .text.truncate,
Expand Down