The discussion revolves around the issue of overlays being misplaced when wrapping the entire Discourse forum to add differently colored sides. p0fi shared an example of the user card being horizontally misplaced by the width of the added sides.
p0fi is looking for a solution to avoid these misplacements while still achieving the side bars. merefield shared a similar experience and suggested overriding a function to adjust the positioning of overlays, such as the user card.
However, p0fi mentioned that overriding every positioning method for all overlays is not a feasible solution, as almost all overlays are misplaced.
Instead, awesomerobot suggested adding a background color to #main-outlet and the background color for the sides on body, which merefield agreed with, providing an example of the CSS code:
body {
background-color: red;
}
#main-outlet {
background-color: white;
}
This solution could potentially resolve the issue without requiring extensive overrides.
When I try to wrap the complete discourse to enable differently colored sides I get a misplacement problem with overlays like the user card for example.
The user card is supposed to be opened right next to the user which got clicked. But in fact its horizontally misplaced by exactly the width of my sides. Thus the question how is the positioning of this overlays realized and how could I avoid such misplacements while still achieving the side bars?
Yeah, I’ve hit this when adding an extra large banner whilst developing a big plugin for a client. In my case the offset was completely ridiculous (it was off screen!)
There may be a simpler solution, but it turns out this is a little involved and requires you to override a function, e.g. for user card:
I used jquery to determine whether or not to apply the modification depending on the visibility of the banner: on some pages I had the big ‘banner’, on others I did not. You could use a similar strategy.
tbh, your example doesn’t look that bad - I’d consider letting it be?
The problem is that basically all overlays are misplaced. I don’t really want to override every positioning method of all overlays that may exist.
It looks passable on the example image since the browser window was not full sized. The sides are usually bigger and therefore the misplacement is worse. Some overlays are almost off screen.
Yeah, it’s annoying. Perhaps restrict customisations to Topic List and try and leave the Topic view alone as much as possible and don’t have too many ‘variants’ to make your life simple.