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
Honored Contributor II

Hi @dbrixr 

 

Huh? This has nothing to do with my question.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now