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

Repo homepage styling tweaks #33289

Merged
merged 8 commits into from
Jan 24, 2025
Merged

Conversation

silverwind
Copy link
Member

Reduce it to a value that results in .repo-home-sidebar-top and .repo-home-sidebar-bottom having 240px content width, the same as GitHub.

Before:
Screenshot 2025-01-15 at 18 28 34

After:
Screenshot 2025-01-15 at 18 28 27

Reduce it to a value that results in `.repo-home-sidebar-top` and
`.repo-home-sidebar-bottom` having 240px content width, the same as
GitHub.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 15, 2025
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 15, 2025
@silverwind silverwind added the type/enhancement An improvement of existing functionality label Jan 15, 2025
@techknowlogick techknowlogick added the topic/ui Change the appearance of the Gitea UI label Jan 15, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 15, 2025
@silverwind silverwind added the backport/v1.23 This PR should be backported to Gitea 1.23 label Jan 15, 2025
@silverwind
Copy link
Member Author

Adding backport as I would like to have this in 1.23, and it's a stylistic change only.

@lunny lunny requested a review from yp05327 January 15, 2025 19:10
@yp05327
Copy link
Contributor

yp05327 commented Jan 16, 2025

image

having 240px content width, the same as GitHub.

For my case, it is around 300px in GitHub.

@lunny
Copy link
Member

lunny commented Jan 16, 2025

image

having 240px content width, the same as GitHub.

For my case, it is around 300px in GitHub.

Same for me.

@wxiaoguang
Copy link
Contributor

For my case, it is around 300px in GitHub.

Same for me.

Same for me.

@silverwind
Copy link
Member Author

silverwind commented Jan 16, 2025

Huh, mine is definitely 240px, even if I zoom out. Same for issue sidebar btw (I will tackle that in Gitea in another PR).

image

@silverwind
Copy link
Member Author

silverwind commented Jan 16, 2025

Ah, I see the 240px comes from a userstyle of mine that sets --Layout-sidebar-width: 240px. Still I think 300px is too much and slightly smaller look better.

@yp05327
Copy link
Contributor

yp05327 commented Jan 16, 2025

It seems that it is related to the screen size:
image

I prefer this.

@silverwind
Copy link
Member Author

Yes, that makes sense. On a small screen like mine, 300px is too much. On big screen, it's ok. I will add a CSS variable, WIP until then.

@silverwind silverwind marked this pull request as draft January 16, 2025 11:09
@wxiaoguang wxiaoguang removed the backport/v1.23 This PR should be backported to Gitea 1.23 label Jan 22, 2025
@silverwind silverwind marked this pull request as ready for review January 22, 2025 23:54
@silverwind
Copy link
Member Author

silverwind commented Jan 22, 2025

I ended up just matching GitHub's 296px now, e.g. 4px smaller sidebar now.

Also I changed padding to gap, using the CSS variable, so spacing is now 2px larger.

Minor, but still worth a backport imho 😉

@silverwind silverwind added the backport/v1.23 This PR should be backported to Gitea 1.23 label Jan 22, 2025
@silverwind
Copy link
Member Author

Added a CSS variable for it and used it on issue sidebar as well which was also 300px.

@yp05327
Copy link
Contributor

yp05327 commented Jan 23, 2025

The width in GitHub does not include the padding space, but Gitea side does.
Actually, for my case, the current width is 286px, which is 10px smaller than GitHub.
image
image
image

So it is not reduce but increase (in title) for my case. 😂

@silverwind
Copy link
Member Author

How come it's 286px for you? The CSS variable is 296px for me and that matches the rendering:

image image

The width in GitHub does not include the padding space, but Gitea side does.

No, the width you see in the devtools is always without padding, so content width was 300 before, is now 296. In any case, this PR removes the padding in favor of gap.

@yp05327
Copy link
Contributor

yp05327 commented Jan 23, 2025

How come it's 286px for you?

It is the width in main branch, not from this PR.
In this PR, I also get 296px 😃

So it is not reduce but increase (in title) for my case. 😂

@silverwind
Copy link
Member Author

You're right. Main branch content width is 300px - 1rem, which is 286px.

@yp05327
Copy link
Contributor

yp05327 commented Jan 23, 2025

image
Maybe this screenshot can simply explain it.
The upper is this PR and the lower is Gitea.com

@silverwind
Copy link
Member Author

silverwind commented Jan 23, 2025

Let's just call the PR an adjustment then:

  • Sidebar content width in repo goes from 286px to 296px
  • Sidebar width in issue goes from 300px to 296px (still has padding)

Would have liked to go a bit lower, but the issue sidebar does not work well with lower values, so I guess best is to keep the width and keep them the same.

@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 23, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jan 23, 2025
@silverwind silverwind changed the title Adjust repo sidebar width Repo homepage CSS tweaks Jan 23, 2025
@silverwind
Copy link
Member Author

Added one more tiny change: Remove margin on top of these elements. Other tab contents also did not have this margin, so tab switching to issue list looks better now.

image

@silverwind silverwind changed the title Repo homepage CSS tweaks Repo homepage styling tweaks Jan 23, 2025
@pull-request-size pull-request-size bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 23, 2025
@silverwind
Copy link
Member Author

Ah I think it's actually not a good idea to couple these sidebars just yet because one has padding and the other not. So I ended up reverting and reducing the sidebar width very slightly from 286px to 280px.

@hiifong
Copy link
Member

hiifong commented Jan 23, 2025

image
When the window's width is less than 1000px or so, the width of GitHub's sidebar will be 240px.

I think we can add a media query to keep the same width as GitHub.

@silverwind
Copy link
Member Author

When the window's width is less than 1000px or so, the width of GitHub's sidebar will be 240px.

No, as you showed in #33289 (comment), they only downsize it starting at 768px width, but at that breakpoint, gitea switches to single-column layout, so there is no point at altering the size at 768px.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 24, 2025
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 24, 2025
@silverwind silverwind enabled auto-merge (squash) January 24, 2025 17:00
@silverwind silverwind merged commit 642e8c1 into go-gitea:main Jan 24, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Jan 24, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jan 24, 2025
Reduce it to a value that results in `.repo-home-sidebar-top` and
`.repo-home-sidebar-bottom` having 240px content width, the same as
GitHub.

Before:
<img width="1333" alt="Screenshot 2025-01-15 at 18 28 34"
src="https://github.com/user-attachments/assets/cf0fa21b-87be-40e3-a6cd-26d146bce9cc"
/>

After:
<img width="1330" alt="Screenshot 2025-01-15 at 18 28 27"
src="https://github.com/user-attachments/assets/28acd837-10f4-4176-b8a0-510cd28c8b8d"
/>
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 24, 2025
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jan 24, 2025
techknowlogick pushed a commit that referenced this pull request Jan 24, 2025
Backport #33289 by @silverwind

Reduce it to a value that results in `.repo-home-sidebar-top` and
`.repo-home-sidebar-bottom` having 240px content width, the same as
GitHub.

Co-authored-by: silverwind <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/templates This PR modifies the template files size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants