12
26
Fork
You've already forked build-deploy-forgejo
25

css/codeberg.css: Short-term solution for menu #43

Closed
kreyren wants to merge 4 commits from short-term-fix into master
pull from: short-term-fix
merge into: Codeberg-Infrastructure:master
Codeberg-Infrastructure:codeberg-13
Codeberg-Infrastructure:codeberg-14
Codeberg-Infrastructure:codeberg-12
Codeberg-Infrastructure:codeberg-11
Codeberg-Infrastructure:pat-s-patch-1
Codeberg-Infrastructure:codeberg-10
Codeberg-Infrastructure:codeberg-9
Codeberg-Infrastructure:codeberg-8
Codeberg-Infrastructure:codeberg-7
Codeberg-Infrastructure:codeberg-1.21
Codeberg-Infrastructure:logo-cleanup
Codeberg-Infrastructure:codeberg-1.20
Codeberg-Infrastructure:codeberg-1.19
Codeberg-Infrastructure:codeberg-1.18
Codeberg-Infrastructure:codeberg-1.17
Codeberg-Infrastructure:configure-mcaptcha
Codeberg-Infrastructure:testing-1.17
Codeberg-Infrastructure:codeberg-1.16
Codeberg-Infrastructure:codeberg-1.15
Codeberg-Infrastructure:codeberg-1.14
Contributor
Copy link
Adressing: https://codeberg.org/Codeberg/Community/issues/235#issuecomment-75914 Fixes: https://codeberg.org/Codeberg/Community/issues/258 Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
Author
Contributor
Copy link

Noticed that my editor is automatically removing trailing spaces let me know if you want these changes removed.

Noticed that my editor is automatically removing trailing spaces let me know if you want these changes removed.
Author
Contributor
Copy link

attn maintainers: This has been tested only on my custom fork of firefox emulating the environment for upstream firefox and chromium.

attn maintainers: This has been tested only on my custom fork of firefox emulating the environment for upstream firefox and chromium.
Member
Copy link

no background color needed?

no background color needed?
Author
Contributor
Copy link

@hw The css style is already defined within Gitea as:

.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
 display: -webkit-box;
 display: -ms-flexbox;
 display: flex;
 margin-left: auto !important;
}

This just adds the elements to pin the menu to the right side and hides it for phone view.

@hw The css style is already defined within Gitea as: ```css .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { display: -webkit-box; display: -ms-flexbox; display: flex; margin-left: auto !important; } ``` This just adds the elements to pin the menu to the right side and hides it for phone view.
Member
Copy link

tried on https://codeberg-test.org/: there seems to be an issue with vertical alignment/centering, also the right menu is transparent on top of the buttons?

tried on https://codeberg-test.org/: there seems to be an issue with vertical alignment/centering, also the right menu is transparent on top of the buttons?
Author
Contributor
Copy link

@hw provide the useragent of your browser

@hw provide the useragent of your browser
kreyren changed title from (削除) css/codeberg.css: Short-term solution for menu (削除ここまで) to WIP: css/codeberg.css: Short-term solution for menu 2020年09月18日 19:19:43 +02:00
Member
Copy link

@hw provide the useragent of your browser

chromium, chrome, firefox, mozilla mobile browser

> @hw provide the useragent of your browser chromium, chrome, firefox, mozilla mobile browser
Author
Contributor
Copy link

This seems to work on my end:
image

Tried also to align the avatar, but the changes to that menu should be reverted and use the upstream specs.
image

This seems to work on my end: ![image](https://codeberg.org/attachments/2279fca1-f19b-44f0-8fff-a5ca4336548c) Tried also to align the avatar, but the changes to that menu should be reverted and use the upstream specs. ![image](/attachments/3cd8b1fd-d5e0-44cb-82ab-31cf19825d02)
Author
Contributor
Copy link

^Note that this is overwriting the elements in:

  • .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu
  • .ui.dropdown .menu > .item > .image:not(.icon), .ui.dropdown .menu > .item > img, .ui.dropdown > .text > .image:not(.icon), .ui.dropdown > .text > img

Which is probably what is causing the current issues as the provided CSS is overwriting the upstream -> The CSS file in question should be merged (meaning the changes in css are added to the upstream CSS locally) to avoid these issues in the future and this is still a very bad hotfix until Codeberg/Community#235 is resolved.

So ideally this should allow for implementation alike:

.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 4px;
}

That results in:

.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	margin-left: auto !important;
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 4px;
}
^Note that this is overwriting the elements in: - `.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu` - `.ui.dropdown .menu > .item > .image:not(.icon), .ui.dropdown .menu > .item > img, .ui.dropdown > .text > .image:not(.icon), .ui.dropdown > .text > img` Which is probably what is causing the current issues as the provided CSS is overwriting the upstream -> The CSS file in question should be merged (meaning the changes in css are added to the upstream CSS locally) to avoid these issues in the future and this is still a very bad hotfix until https://codeberg.org/Codeberg/Community/issues/235 is resolved. So ideally this should allow for implementation alike: ```css .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { right: 0; position: absolute; margin-right: 0.5%; margin-top: 4px; } ``` That results in: ```css .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { display: -webkit-box; display: -ms-flexbox; display: flex; margin-left: auto !important; right: 0; position: absolute; margin-right: 0.5%; margin-top: 4px; } ```
kreyren changed title from (削除) WIP: css/codeberg.css: Short-term solution for menu (削除ここまで) to css/codeberg.css: Short-term solution for menu 2020年09月18日 21:18:20 +02:00
Member
Copy link

Is the PR updated to meet these changes?

Is the PR updated to meet these changes?
Author
Contributor
Copy link

@hw The short-term fix is adressed in Codeberg/build-deploy-gitea@151cb2cd34

Should work unless my test environment is insufficient to the deployed.


In terms of the proposed in Codeberg/build-deploy-gitea#43 (comment) that seems like gitea issue to me as the files in public/ are overwriting which seems to be a bad implementation in our usecase, because gitea might update their menu again and we would be by design stuck with the outdated implementation that would require contrib each time gitea does that or reimplement the whole panel to only change the color through new independant HTML element which would be also pita to manage.

EDIT: Doing research on the implementation atm

@hw The short-term fix is adressed in https://codeberg.org/Codeberg/build-deploy-gitea/commit/151cb2cd343fec5cc90c3e2cc6cf5fd3cf8cf7c2 Should work unless my test environment is insufficient to the deployed. --- In terms of the proposed in https://codeberg.org/Codeberg/build-deploy-gitea/issues/43#issuecomment-81542 that seems like gitea issue to me as the files in `public/` are overwriting which seems to be a bad implementation in our usecase, because gitea might update their menu again and we would be by design stuck with the outdated implementation that would require contrib each time gitea does that or reimplement the whole panel to only change the color through new independant HTML element which would be also pita to manage. EDIT: Doing research on the implementation atm
Author
Contributor
Copy link

So from my research we want to provide a codeberg.css file with elements:

.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 4px;
}

and expect gitea to append the changes to it's styling as:

.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	margin-left: auto !important;
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 4px;
}

but we are getting:

.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 4px;
}

@hw How are you deploying this? As using file alike:

/* Current gitea styling */
.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	margin-left: auto !important;
}
/* Added from codeberg.css */
.ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 4px;
}

Should get us the result..

So from my research we want to provide a `codeberg.css` file with elements: ```css .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { right: 0; position: absolute; margin-right: 0.5%; margin-top: 4px; } ``` and expect gitea to append the changes to it's styling as: ```css .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { display: -webkit-box; display: -ms-flexbox; display: flex; margin-left: auto !important; right: 0; position: absolute; margin-right: 0.5%; margin-top: 4px; } ``` but we are getting: ```css .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { right: 0; position: absolute; margin-right: 0.5%; margin-top: 4px; } ``` @hw How are you deploying this? As using file alike: ```css /* Current gitea styling */ .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { display: -webkit-box; display: -ms-flexbox; display: flex; margin-left: auto !important; } /* Added from codeberg.css */ .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { right: 0; position: absolute; margin-right: 0.5%; margin-top: 4px; } ``` Should get us the result..
Author
Contributor
Copy link

^Note behavior observed from Codeberg/build-deploy-gitea#43 (comment)

^Note behavior observed from https://codeberg.org/Codeberg/build-deploy-gitea/issues/43#issuecomment-81503
Author
Contributor
Copy link

Proof-of-concept in case it's not obvious:

/* css file stored in css/kreyren.css */
.reyclass {
 color: #f00;
}
.reyclass {
 font-size: 50px;
}
<!DOCTYPE html>
<html lang="en">
 <head>
 <link href="css/kreyren.css" rel="stylesheet">
 </head>
 <body>
 <div class=reyclass>
 <p>TEST</p>
 </div>
 </body>
</html>

image

Proof-of-concept in case it's not obvious: ```css /* css file stored in css/kreyren.css */ .reyclass { color: #f00; } .reyclass { font-size: 50px; } ``` ```html <!DOCTYPE html> <html lang="en"> <head> <link href="css/kreyren.css" rel="stylesheet"> </head> <body> <div class=reyclass> <p>TEST</p> </div> </body> </html> ``` ![image](/attachments/9e6f6fd6-cd27-4a6f-8bb0-01706a8b9814)
Author
Contributor
Copy link

FWIW You can use:

// ==UserScript==
// @name Codeberg live preview of CSS changes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Environment that can be used to test CSS on the deployed page
// @author Kreyren
// @match https://codeberg.org/*
// @run-at document-start
// @grant GM_addStyle
// ==/UserScript==

GM_addStyle ( `
 .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu {
	right: 0;
	position: absolute;
	margin-right: 0.5%;
	margin-top: 2px;
 }
 .ui.dropdown .menu > .item > .image:not(.icon), .ui.dropdown .menu > .item > img, .ui.dropdown > .text > .image:not(.icon), .ui.dropdown > .text > img {
 margin-top: -2px;
 }
` );

To see the proposed solution in Codeberg/build-deploy-gitea#43 (comment) on currently deployed website (requires greesemonkey)

FWIW You can use: ```js // ==UserScript== // @name Codeberg live preview of CSS changes // @namespace http://tampermonkey.net/ // @version 0.1 // @description Environment that can be used to test CSS on the deployed page // @author Kreyren // @match https://codeberg.org/* // @run-at document-start // @grant GM_addStyle // ==/UserScript== GM_addStyle ( ` .ui.menu:not(.vertical) .right.item, .ui.menu:not(.vertical) .right.menu { right: 0; position: absolute; margin-right: 0.5%; margin-top: 2px; } .ui.dropdown .menu > .item > .image:not(.icon), .ui.dropdown .menu > .item > img, .ui.dropdown > .text > .image:not(.icon), .ui.dropdown > .text > img { margin-top: -2px; } ` ); ``` To see the proposed solution in https://codeberg.org/Codeberg/build-deploy-gitea/issues/43#issuecomment-82212 on currently deployed website (requires greesemonkey)
Author
Contributor
Copy link
Deprecated by: https://codeberg.org/Codeberg/build-deploy-gitea/pulls/46#issuecomment-82250
kreyren closed this pull request 2020年09月22日 01:45:12 +02:00
kreyren stopped working 2020年09月22日 01:45:12 +02:00
88h 18min 10s
hw deleted branch short-term-fix 2020年09月22日 09:49:58 +02:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Total time spent: 3 days 16 hours
kreyren
3 days 16 hours
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg-Infrastructure/build-deploy-forgejo!43
Reference in a new issue
Codeberg-Infrastructure/build-deploy-forgejo
No description provided.
Delete branch "short-term-fix"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?