@@ -22,7 +22,6 @@ const ModelProperty = {
2222 ROW_COUNT : "row_count" ,
2323 SORT_CONTEXT : "sort_context" ,
2424 TABLE_HTML : "table_html" ,
25- CSS_STYLES : "css_styles" ,
2625} ;
2726
2827const Event = {
@@ -38,14 +37,6 @@ const Event = {
3837function render ( { model, el } ) {
3938 el . classList . add ( "bigframes-widget" ) ;
4039
41- // Inject CSS styles passed from the backend.
42- const cssStyles = model . get ( ModelProperty . CSS_STYLES ) ;
43- if ( cssStyles ) {
44- const style = document . createElement ( "style" ) ;
45- style . textContent = cssStyles ;
46- el . appendChild ( style ) ;
47- }
48-
4940 const errorContainer = document . createElement ( "div" ) ;
5041 errorContainer . classList . add ( "error-message" ) ;
5142
@@ -54,44 +45,6 @@ function render({ model, el }) {
5445 const footer = document . createElement ( "footer" ) ;
5546 footer . classList . add ( "footer" ) ;
5647
57- /**
58- * Adjusts container styles to prevent white frames in dark mode environments.
59- * @param {boolean } isDark - Whether dark mode is active.
60- */
61- function setContainerStyles ( isDark ) {
62- const body = document . body ;
63- if ( isDark ) {
64- // Clear background of ancestors to remove "white frame" from containers.
65- let parent = el . parentElement ;
66- while ( parent && parent !== document . body ) {
67- parent . style . setProperty (
68- "background-color" ,
69- "transparent" ,
70- "important" ,
71- ) ;
72- parent . style . setProperty ( "padding" , "0" , "important" ) ;
73- parent = parent . parentElement ;
74- }
75-
76- if ( body ) {
77- body . style . setProperty ( "background-color" , "#202124" , "important" ) ;
78- body . style . setProperty ( "margin" , "0" , "important" ) ;
79- document . documentElement . style . setProperty (
80- "background-color" ,
81- "#202124" ,
82- "important" ,
83- ) ;
84- }
85- } else {
86- // Cleanup styles when switching back to light mode
87- if ( body ) {
88- body . style . removeProperty ( "background-color" ) ;
89- body . style . removeProperty ( "margin" ) ;
90- document . documentElement . style . removeProperty ( "background-color" ) ;
91- }
92- }
93- }
94-
9548 /** Detects theme and applies necessary style overrides. */
9649 function updateTheme ( ) {
9750 const body = document . body ;
@@ -103,12 +56,8 @@ function render({ model, el }) {
10356
10457 if ( isDark ) {
10558 el . classList . add ( "bigframes-dark-mode" ) ;
106- el . style . colorScheme = "dark" ;
107- setContainerStyles ( true ) ;
10859 } else {
10960 el . classList . remove ( "bigframes-dark-mode" ) ;
110- el . style . colorScheme = "light" ;
111- setContainerStyles ( false ) ;
11261 }
11362 }
11463
0 commit comments