JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/npm/darkreader@4.9.27/darkreader.js"></script>
<button onclick=enableDark() style="color: white;
top: 10px;
position: relative;
border-radius: 4px;
background: linear-gradient(to left bottom, rgb(72, 204, 254), rgb(89, 20, 182));
border: none;">Темный</button>
<button onclick=disableDark() style="color: white;
top: 10px;
position: relative;
border-radius: 4px;
background: linear-gradient(to left bottom, rgb(72, 204, 254), rgb(89, 20, 182));
border: none;">Светлый</button>
JavaScript
function disableDark() {
DarkReader.disable();
}
function enableDark() {
DarkReader.enable({
brightness: 100,
contrast: 90,
sepia: 10
});
}