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

fix media query edge case #13546

Merged
merged 13 commits into from
Nov 17, 2020
Merged

fix media query edge case #13546

merged 13 commits into from
Nov 17, 2020

Conversation

noerw
Copy link
Member

@noerw noerw commented Nov 13, 2020

Some layouts were failing for 768px width. Now breakpoints strictly separate between 767 and 768 pixels

was failing for 768px width before
@silverwind
Copy link
Member

Theres also one oddball in _repository.less which probably benefits from the same:

2998:@media only screen and (max-width: 767.98px) {

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 13, 2020
@gary-kim
Copy link
Member

Actually, could we look into putting these values into less variables?

@zeripath
Copy link
Contributor

Theres also one oddball in _repository.less which probably benefits from the same:

2998:@media only screen and (max-width: 767.98px) {

I suspect this is to protect browsers out there that will do something stupid at 767px and/or if they have subpixels do something stupid between 767px and 768px. Are we certain that setting everything to 767.98px would not be better?

@noerw
Copy link
Member Author

noerw commented Nov 13, 2020

@zeripath I'm pretty sure these .98 values originally come from formantic css lib. I have to say that I have never seen such decimal values in other responsive grid systems like bootstrap etc, so I'm not convinced they are necessary. A quick test in firefox shows, that values are rounded to the next integer, so it should be fine.

@noerw
Copy link
Member Author

noerw commented Nov 13, 2020

Actually, could we look into putting these values into less variables?

@gary-kim done. I'm not very experienced with LESS, so if you see a more elegant way let me know

@silverwind
Copy link
Member

Not a fan of Less variables in general personally as they can not be changed at runtime and lock us into that specific precompiler. Would suggest to convert to CSS variables.

@silverwind
Copy link
Member

Fomantic breakpoints are from here I think:

https://github.com/fomantic/Fomantic-UI/blob/05955c046cd0be135c57c7ba80dffe36e0c49276/src/themes/default/globals/site.variables#L216-L224

We could remap them to the same CSS vars but I guess that's material for another PR.

@noerw
Copy link
Member Author

noerw commented Nov 13, 2020

Not a fan of Less variables in general personally as they can not be changed at runtime and lock us into that specific precompiler. Would suggest to convert to CSS variables.

Sadly, css variables can't be used in media query selectors :(

@gary-kim
Copy link
Member

The variables seem fine to me.

@silverwind
Copy link
Member

Sadly, css variables can't be used in media query selectors :(

Oh you're right, one of the stupid limitations of them that they can't appear in selectors.

@noerw
Copy link
Member Author

noerw commented Nov 14, 2020

Enough bikeshedding, this one's ready ;)

@lafriks lafriks added the topic/ui Change the appearance of the Gitea UI label Nov 15, 2020
@lafriks lafriks added this to the 1.14.0 milestone Nov 15, 2020
@lafriks lafriks added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Nov 15, 2020
@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 Nov 15, 2020
web_src/less/_base.less Outdated Show resolved Hide resolved
noerw and others added 2 commits November 15, 2020 23:27
Co-authored-by: silverwind <me@silverwind.io>
web_src/less/index.less Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Nov 15, 2020

Codecov Report

Merging #13546 (2083643) into master (949e3f5) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13546      +/-   ##
==========================================
+ Coverage   42.19%   42.21%   +0.01%     
==========================================
  Files         696      696              
  Lines       76540    76540              
==========================================
+ Hits        32297    32308      +11     
+ Misses      38951    38932      -19     
- Partials     5292     5300       +8     
Impacted Files Coverage Δ
modules/charset/charset.go 68.53% <0.00%> (-4.50%) ⬇️
modules/log/event.go 59.90% <0.00%> (-1.89%) ⬇️
modules/queue/unique_queue_disk_channel.go 53.84% <0.00%> (-1.54%) ⬇️
modules/queue/workerpool.go 58.77% <0.00%> (-1.23%) ⬇️
models/gpg_key.go 53.33% <0.00%> (-0.58%) ⬇️
services/pull/pull.go 40.78% <0.00%> (ø)
models/pull.go 55.17% <0.00%> (+0.62%) ⬆️
modules/log/file.go 75.20% <0.00%> (+1.60%) ⬆️
modules/process/manager.go 75.00% <0.00%> (+2.50%) ⬆️
services/pull/check.go 48.90% <0.00%> (+15.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 949e3f5...2083643. Read the comment docs.

altough it doesnt matter, LESS lazy evals variables
@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 Nov 16, 2020
@lafriks
Copy link
Member

lafriks commented Nov 17, 2020

🚀

@techknowlogick techknowlogick merged commit 75ebf7c into go-gitea:master Nov 17, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
@noerw noerw deleted the fix-mediaquery branch March 12, 2021 07:32
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. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants