MDUIDocsEnglish简体中文LightDarkSystem
Preset Colors
Custom Color
Extract Color from Wallpaper
Select a Wallpaper
Getting Started
Styles
Frameworks
Components
Functions
JavaScript Library dialog alert confirm prompt snackbar getTheme setTheme getColorFromImage setColorScheme removeColorScheme loadLocale setLocale getLocale throttle observeResize breakpoint
Libraries

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.

On this page