Skip to content
Snippets Groups Projects
Closed JetBrains: Recognize dark vs light theme
  • View options
  • JetBrains: Recognize dark vs light theme

  • View options
  • Closed Issue created by Administrator

    Created by: vdavid

    Problem

    Our search box doesn't display right:

    CleanShot 2022-04-29 at 14 17 24@2x

    The problem is that it needs a top-level class of either dark-theme or light-theme to display right.

    Solution

    There is no dark/light theme setting in IntelliJ, just one can download themes and that's it. However, after doing some research in the theme marketplace, it shows that all themes use either use a light or a dark background for the editor. (They need to display legible text, after all.) So, a good solution seems to be to request the editor background color from the theme, and set the class dynamically based on that. For determining light vs dark, the HSP (Highly Sensitive Poo) equation from http://alienryderflex.com/hsp.html seems like a great solution.

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first