Manage UI Theming and Panel Resizing
masterThe Oxdraw Editor provides interactive controls for visual customization:
Theme Toggling
Use the toggleTheme function to switch between light and dark modes. This updates the theme state and sets the data-theme attribute on document.body, triggering corresponding CSS rules.
Panel Resizing
Users can resize the CodePanel and adjacent panels by dragging. This is handled by:
- Initiating a resize via
startLeftPanelResizingorstartRightPanelResizing. - Activating global mouse listeners (
handleMouseMove,handleMouseUp). - Updating
leftPanelWidthorrightPanelWidthstates to dynamically adjust layout widths.