cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reverse colors in dark mode

dbrixr
New Contributor II

It seems that Databricks implements its dark mode by applying the invert filter so that all colors are reversed. This is problematic if one wants to create some sort of html widget or rich output since this filter is passed down to the result of displayHTML.  Then your output can look good in either light mode or dark mode but not both.

Is there a way to circumvent this or detect whether the editor is in light or dark mode with javascript from within the output cell? Since the output of displayHTML is sandboxed inside an iframe I see no direct way to access parent classes or to negate them.

Example: 

 

 

 

displayHTML('<div style="color: red;">Hello</div>')

 

 

 

This looks red in light mode but teal in dark mode. I've tried !important, filter: none,  color-scheme: light; etc but nothing seems to work.

2 REPLIES 2

Anushree_Tatode
Moderator
Moderator

Hi @dbrixr 

 

Huh? This has nothing to do with my question.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group