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 #317 -- Margin discrepancy light dark mode #318

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -568,23 +568,16 @@ input[type=number] {
outline: none;
}

div.darkmode-background{
div.darkmode-background {
background: #fef0e3;
background-image:
radial-gradient(#fff 20%, transparent 0),
radial-gradient(#fff 20%, transparent 0);
position: inherit;
position: static;
}

body.darkmode--activated{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: 'Varela Round', sans-serif;
width: 100%;
margin: 0 0 0 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems as though simply changing the margin value to include the 8px that exists in the light mode fixes the shift, without introducing the weird oval artifact mentioned in my earlier comment.

margin: 8px 0 0 0;

Copy link
Collaborator

@theRTC204 theRTC204 May 1, 2020

Choose a reason for hiding this comment

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

Hmm, nope I was wrong. That causes an 8px white edge at the top, and doesn't correct the shift when scrolled to the bottom of the page.

However... leaving the margin at 0, and instead adding a bit of padding does work.

body.darkmode--activated {
  display: flex;
  ...
  margin: 0 0 0 0;
  padding: 8px 0;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite, adding padding to the top + bottoms doesn't stop the gutters from disappearing at the sides of the page when darkmode is activated.
image

I think this problem is caused switch to position: absolute; ignoring the existing gutters. I'm just updating the branch now, if you do a pull and take a look, that background should be back now (so THAT'S what the position: inherit; was for)

position: absolute;
.darkmode--activated .darkmode-background {
position: fixed;
}

body.darkmode--activated div[class^="dialog-box"],
Expand Down