Commit 9d85d2b
committed
fix gasp between backgrounds of body and sidebar divs
The issue is the linear-gradient in the body background seems to not working
really correctly with pixel dimensions (in Firefox at least): if you
zoom in / out the page you'll see the body background to not always
correctly update the rendering (and so you'll see a growing gasp for
example).
Due to this issue, there was a gap between the backgrounds of the body and the
sidebar elements. PR linuxfrorg#354 tried to solve this by adjusting the
linear-gradient pixel dimensions, but due to the bug of linear-gradient
implementation, it was not working when window was resized or page zoomed.
As the linear-gradient usage in the body background was clearly already a
workaround to create two vertical color stripes, we replace it with
another workaround using the CSS feature which allows to define multiple
background images with different size and position.
First background image is defined with the sidebar color (using
linear-gradient with only one color) and the width which resolve the
pixel gasp reported in linuxfrorg#354 (which means the width should be the
branding width + body border width). To be able to define a color as an
image, we use again linear-gradient, but, this time it fills all the
stripe with the same color, so we won't have error due to
linear-gradient implementation.
Second image is defined from the first image position for the rest of the body
block with the container color.
This new workaround idea comes from this StackOverflow answer which
explain how to create pixel perfect horizontal stripes:
https://stackoverflow.com/a/248293441 parent c7ef92a commit 9d85d2b
File tree
5 files changed
+15
-23
lines changed- app/assets/stylesheets
- contrib
- parts
5 files changed
+15
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
| |||
360 | 357 | | |
361 | 358 | | |
362 | 359 | | |
363 | | - | |
364 | 360 | | |
365 | 361 | | |
366 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | | - | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
33 | 29 | | |
34 | 30 | | |
35 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
0 commit comments