MDUIDocs
Copy llms.txt linkCopy llms-full.txt linkView this page in MarkdownDiscuss this page with ChatGPTDiscuss full project docs with ChatGPT
Preset Colors
Custom Color
Extract from Wallpaper
Please select a wallpaper
Getting Started
AI-Assisted Development
Styles
Integration with Frameworks
Components
Functions
jq Library dialog alert confirm prompt snackbar getTheme setTheme getColorFromImage setColorScheme removeColorScheme loadLocale setLocale getLocale throttle observeResize breakpoint
Libraries

removeColorScheme

The removeColorScheme function removes the color scheme from the current page or a specified element. For more details, see Dynamic Color.

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