removeColorScheme

The removeColorScheme function is used to remove the color scheme from the current page or a specified element. For more information on color schemes, refer to the Dynamic Color section.

Usage

Import the function:

import { removeColorScheme } from 'mdui/functions/removeColorScheme.js';

Example:

// Remove the color scheme from <html>
removeColorScheme();

// Remove the color scheme from an element with class="element"
removeColorScheme('.element');

// Remove the color scheme from a specified DOM element
const element = document.querySelector('.element');
removeColorScheme(element);

API

removeColorScheme(target?: string | HTMLElement | JQ<HTMLElement>): void

This function accepts an optional parameter, target, which specifies the element from which to remove the color scheme. The target can be a CSS selector, a DOM element, or a JQ object. If no parameter is provided, the function defaults to document.documentElement, the <html> element.

MDUIDocsEnglish简体中文LightDarkSystem
Preset Colors
Custom Color
Extract Color from Wallpaper
Select a Wallpaper
Getting Started
Introduction Installation Usage TypeScript Support IDE Support Localization Frequently Asked Questions
Styles
Dark Theme Dynamic Theme Typography Design Tokens
Frameworks
React Vue Angular
Components
Button ButtonIcon Fab SegmentedButton Chip Card Checkbox Radio Switch Slider RangeSlider List Collapse Tabs Dropdown Menu Select TextField LinearProgress CircularProgress Dialog Divider Avatar Badge Icon Tooltip Snackbar NavigationBar NavigationDrawer NavigationRail BottomAppBar TopAppBar Layout
Functions
JavaScript Library dialog alert confirm prompt snackbar getTheme setTheme getColorFromImage setColorScheme removeColorScheme loadLocale setLocale getLocale throttle observeResize breakpoint
Libraries
@mdui/icons