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

Dark mode styles makes our page unreadable #1330

Closed
jedie opened this issue Sep 29, 2021 · 5 comments
Closed

Dark mode styles makes our page unreadable #1330

jedie opened this issue Sep 29, 2021 · 5 comments
Labels

Comments

@jedie
Copy link

jedie commented Sep 29, 2021

The "dark mode styles" was added with: 7fc0662 for: #1318

Our page doesn't support dark mode yet. So these styles makes the diff unreadable.

A work-a-round, that we currently use is to add these styles in our css file:

@media (prefers-color-scheme: dark) {
  /*
  Work-a-round for https://github.com/django-import-export/django-import-export/pull/1323
  */
  html table.import-preview tr.skip {
    background-color: #d2d2d2;
  }

  html table.import-preview tr.new {
    background-color: #bdd8b2;
  }

  html table.import-preview tr.delete {
    background-color: #f9bebf;
  }

  html table.import-preview tr.update {
    background-color: #fdfdcf;
  }

  html .validation-error-container {
    background-color: #ffc1c1;
  }

  /*
  these declarations are necessary to forcibly override the
  formatting applied by the diff-match-patch python library
   */
  html table.import-preview td ins {
    background-color: #bdd8b2 !important;
  }

  html table.import-preview td del {
    background-color: #f9bebf !important;
  }
}

That will "reset" the dark colors to "normal" ones...

@jedie jedie added the bug label Sep 29, 2021
@matthewhegarty
Copy link
Contributor

Thanks for raising this. Can you give me some more information as to what the issue is... How do you reproduce it? Can you add some screenshots? What browser is this etc.

@jedie
Copy link
Author

jedie commented Sep 30, 2021

Sorry, i can't create a screenshot... (They will display internal information)

We still use Django 2.2... Don't know if the admin has "dark"-Styles ?!? I don't think so. So it can't work with 2.2?!?

EDIT: dark them was added in Django 3.2, see: https://docs.djangoproject.com/en/3.2/releases/3.2/#django-contrib-admin

@matthewhegarty
Copy link
Contributor

I tested using the example app on django 2.2. It renders ok for imports, but I notice that if you switch to dark mode in the browser then there is an issue where the text is not legible (below). Is this what you are seeing?. Can you confirm if you are browsing in "dark mode"? If, so, what happens if you switch to 'light mode'?

dm1

@jedie
Copy link
Author

jedie commented Sep 30, 2021

That is exactly how this "bug" looks like here:

grafik

matthewhegarty added a commit to matthewhegarty/django-import-export that referenced this issue Sep 30, 2021
matthewhegarty added a commit to matthewhegarty/django-import-export that referenced this issue Sep 30, 2021
matthewhegarty added a commit that referenced this issue Sep 30, 2021
Revert 'dark mode' css: causes issues in django2.2 (#1330)
@matthewhegarty
Copy link
Contributor

We have reverted this change and the updated css is now released in 2.6.1

striveforbest pushed a commit to striveforbest/django-import-export that referenced this issue Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants