@@ -80,7 +80,7 @@ import { Toolbar } from './components/toolbar/Toolbar';
80
80
import Tour from './components/tour/Tour' ;
81
81
import { TourName } from './components/tour/Tours' ;
82
82
import { useMitoAPI } from './hooks/useMitoAPI' ;
83
- import { getCSSVariablesFromTheme } from './utils/colors' ;
83
+ import { getCSSStyleVariables } from './utils/colors' ;
84
84
import { handleKeyboardShortcuts } from './utils/keyboardShortcuts' ;
85
85
import { isInDashboard } from './utils/location' ;
86
86
import { shallowEqualToDepth } from './utils/objects' ;
@@ -104,6 +104,7 @@ export type MitoProps = {
104
104
textColor ?: string
105
105
}
106
106
onSelectionChange ?: ( selectedDataframeIndex : number , selections : MitoSelection [ ] ) => void ;
107
+ height ?: string | undefined ;
107
108
} ;
108
109
109
110
export const Mito = ( props : MitoProps ) : JSX . Element => {
@@ -379,20 +380,19 @@ export const Mito = (props: MitoProps): JSX.Element => {
379
380
} , [ uiState ] ) ;
380
381
381
382
/**
382
- * If the theme changes, we update the theme on the document.
383
+ * If the styling changes, we update the syling on the document.
383
384
* Note we don't just do this on the Mito component styles
384
- * because we want to be able to use the theme in dropdowns
385
+ * because we want to be able to use the styling in dropdowns
385
386
* that are rendered outside of the Mito component.
386
387
*/
387
388
useEffect ( ( ) => {
388
- const cssVariables = getCSSVariablesFromTheme ( props . theme ) ;
389
+ const cssVariables = getCSSStyleVariables ( props . height , props . theme ) ;
389
390
// For each key in the theme, set it on the document style
390
391
Object . keys ( cssVariables ) . forEach ( ( key ) => {
391
392
const value = ( cssVariables as Record < string , any > ) [ key ] ;
392
393
document . documentElement . style . setProperty ( key , value ) ;
393
394
} )
394
-
395
- } , [ props . theme ] )
395
+ } , [ props . theme , props . height ] )
396
396
397
397
398
398
// If the user passes an onSelectionChange, then, we fire off events any time the user selects
0 commit comments