Review main Merged

78335[TASK] Bind CodeMirror theme to prefers-color-scheme

Andreas Kienast CR +2 V +2 Normal +94 −14 updated 04/04/23, 07:38

Commit message

With the upgrade to CodeMirror 6, the dark theme is enforced, which may
have a negative impact on UX as this stresses the user's eyesight.

The implementation is adapted to 1) respect and 2) react on changing
`prefers-color-scheme` settings.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Jasmina Ließmann +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Chris Müller +1
    • Jasmina Ließmann +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2024

  1. Andreas Kienast uploaded patch set 1 03/31/23, 07:30

  2. core-ci voted on patch set 1 V +1 03/31/23, 07:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39893

  3. Andreas Kienast uploaded patch set 2 V +1 03/31/23, 08:17

  4. core-ci voted on patch set 2 V +1 03/31/23, 08:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39894

  5. Nikita Hovratov voted on patch set 2 V +1 03/31/23, 08:52

  6. Eric Harrer commented on patch set 2 03/31/23, 14:05

    Thank you very much for the patch. I have discussed the current solution with Wolfgang Wagner and members of his video training group. The following question came up: Would it be possible to make the dark/light mode explicitly configurable via TYPO3 (possibly via TSconfig or the backend user settings) in addition to the current solution? Most systems offer the options "Automatic" (inherited from the system settings -> current behavior), "Light" and "Dark" (each explicitly and independently from the system settings). If this request is beyond the scope of this patch, I would open a separate ticket on forge.
  7. Andreas Kienast commented on patch set 2 03/31/23, 14:47

    Reply

    Manually toggling light/dark mode is currently not possible. This will be possible once dark mode can be applied to the overall backend. Once this is done, a manual toggle is possible. This could be in the scope of v13 development.
  8. Eric Harrer commented on patch set 2 03/31/23, 15:12

    Reply

    Thank you for your feedback. This decision sounds reasonable. I think users would like to see the entire user interface in either dark or light mode. So it wouldn't actually make sense to make only the code editor manually configurable in its appearance.
  9. Chris Müller commented on patch set 2 V -1 04/03/23, 07:43

    In light mode a border around the textarea is missing, so for the user it is not really clear that there is a textarea. When clicking into the textarea only a slim dotted line gets visible.
  10. Andreas Kienast commented on patch set 2 CR -1 04/03/23, 08:01

    on it
  11. Andreas Kienast uploaded patch set 3 CR -1 V +1 04/03/23, 08:17

  12. core-ci voted on patch set 3 V +1 04/03/23, 08:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40004

  13. Chris Müller commented on patch set 3 04/03/23, 08:40

    Compared to an RTE element: The background of the textarea should be white (not light gray). Also the border is blue in an RTE when the element is focuced, here it is a dotted line. I suggest to synchronise it, so having the same look and feel. What do you think?
  14. Andreas Kienast commented on patch set 3 04/03/23, 08:51

    Reply

    Done

    Reply

    I'll adjust the border of CodeMirror, but wouldn't fiddle too much with the rest of the theme.
  15. Andreas Kienast uploaded patch set 4 V +1 04/03/23, 08:51

  16. Chris Müller commented on patch set 4 04/03/23, 09:16

    Ah, much better. The background colour of the textarea is still a light grey (transparent) in light mode, should be #fefefe like for the other fields.
  17. core-ci voted on patch set 4 V +1 04/03/23, 09:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40008

  18. Andreas Kienast commented on patch set 4 04/03/23, 09:32

    Reply

    To implement it the correct way™, we'd need a new CodeMirror theme which is not the scope of this patch.
  19. Chris Müller commented on patch set 4 04/03/23, 10:23

    Reply

    Okay, can live with that for now ;-) Thanks for the work. Missed the light theme.
  20. Chris Müller commented on patch set 4 V +1 04/03/23, 10:25

    Reply

    Ack
  21. Jasmina Ließmann voted on patch set 4 V +1 CR +1 04/03/23, 15:42

  22. Christian Kuhn voted on patch set 4 V +1 CR +1 04/04/23, 07:27

  23. Benni Mack voted on patch set 4 V +2 CR +2 04/04/23, 07:38

  24. Benni Mack merged patch set 5 04/04/23, 07:38