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

Clean up diff header css and reduce global textarea min-height #29232

Merged
merged 9 commits into from
Feb 18, 2024

Conversation

silverwind
Copy link
Member

  1. Tweak diff header and remove a numbe of unneeded CSS for it:

Before:
Screenshot 2024-02-18 at 01 08 09

After:
Screenshot 2024-02-18 at 01 07 56

  1. Reduce height of review textarea and also reduce fomantic's CSS from 12em to 8em. Now fits better on my screen:
image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 18, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 18, 2024
@silverwind silverwind changed the title Clean up diff header css and reduce review textarea size Clean up diff header css and reduce review textarea height Feb 18, 2024
@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Feb 18, 2024
@@ -37,13 +37,13 @@
.combo-markdown-editor textarea.markdown-text-editor {
display: block;
width: 100%;
min-height: 200px;
max-height: calc(100vh - 200px);
min-height: 140px;
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like a magic number, maybe a css-var is easier to maintain and with the name of the var everybody knowns what the number means

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a per-element variable in 59230d2. Normally I do not recommend such variables because they complicate the themeing and I think all theme-related vars should be on :root, but it does make a certain sense to have "private" variables on elements like in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I think a global variable makes sense here, added in ec7e053. The current 132px fits exactly 6 lines on my screen:

image

@silverwind silverwind changed the title Clean up diff header css and reduce review textarea height Clean up diff header css and reduce global textarea min-height Feb 18, 2024
@@ -21,6 +21,7 @@
--border-radius-circle: 50%;
--opacity-disabled: 0.55;
--height-loading: 16rem;
--min-height-textarea: 132px;
Copy link
Member Author

Choose a reason for hiding this comment

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

calc(1.57142em + 6lh + 2px) might be an alternative (padding + 6 lines + border), but lh unit is not so well supported: https://caniuse.com/?search=lh%20unit.

web_src/css/base.css Outdated Show resolved Hide resolved
@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 Feb 18, 2024
Co-authored-by: delvh <dev.lh@web.de>
web_src/css/base.css Outdated Show resolved Hide resolved
@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 Feb 18, 2024
@denyskon denyskon added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 18, 2024
@lunny lunny enabled auto-merge (squash) February 18, 2024 14:25
@lunny lunny merged commit 39f8ab5 into go-gitea:main Feb 18, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Feb 18, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 18, 2024
@silverwind silverwind deleted the diffbtn branch February 19, 2024 18:26
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
…tea#29232)

1. Tweak diff header and remove a numbe of unneeded CSS for it:

Before:
<img width="433" alt="Screenshot 2024-02-18 at 01 08 09"
src="https://github.com/go-gitea/gitea/assets/115237/d8b377c0-57bc-44d5-bb57-a582c7d4b3b4">

After:
<img width="463" alt="Screenshot 2024-02-18 at 01 07 56"
src="https://github.com/go-gitea/gitea/assets/115237/d08c17e7-5b86-4d07-81da-6371f4754325">

3. Reduce height of review textarea and also reduce fomantic's CSS from
12em to 8em. Now fits better on my screen:

<img width="1352" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5c658d13-295e-4929-94da-13ade888020d">

---------

Co-authored-by: delvh <dev.lh@web.de>
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
…tea#29232)

1. Tweak diff header and remove a numbe of unneeded CSS for it:

Before:
<img width="433" alt="Screenshot 2024-02-18 at 01 08 09"
src="https://github.com/go-gitea/gitea/assets/115237/d8b377c0-57bc-44d5-bb57-a582c7d4b3b4">

After:
<img width="463" alt="Screenshot 2024-02-18 at 01 07 56"
src="https://github.com/go-gitea/gitea/assets/115237/d08c17e7-5b86-4d07-81da-6371f4754325">

3. Reduce height of review textarea and also reduce fomantic's CSS from
12em to 8em. Now fits better on my screen:

<img width="1352" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5c658d13-295e-4929-94da-13ade888020d">

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 39f8ab5)
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants