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