Search
 
SCRIPT & CODE EXAMPLE
 

ASSEMBLY

windows detect system dark mode

RegGetValueA - gets a value from the registry (winreg.h)
use it to retrieve this key:
HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionThemesPersonalizeAppsUseLightTheme
res == ERROR_SUCCESS && data == 0 = dark mode
otherwise = light mode (1 is light and fallback should be light)
Comment

detect system dark mode

/* Light mode, Dark mode is below... 
Standard is registered on W3C in Media Queries Level 5:
https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme
*/

@media (prefers-color-scheme: light) {
    body {
        background-color: white;
        color: black;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: black;
        color: white;
    }
}
Comment

PREVIOUS NEXT
Code Example
Assembly :: resize pdf file 
Assembly :: set assembly highligh vim 
Assembly :: discord bot edit message 
Assembly :: that long word from mary poppins 
Assembly :: re optional 
Assembly :: sort in assembly pcspim 
Assembly :: how to custom style material ui 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: how to install react router dom version 5 
Javascript :: login to discord with token 
Javascript :: ts ignore in jsx 
Javascript :: shopify comment code 
Javascript :: jquery display none 
Javascript :: jquery accept only excel file 
Javascript :: get parameter from the actual url javascript 
Javascript :: jquery slim min js url 
Javascript :: react native textInput numbers only 
Javascript :: jquery prevent form submit 
Javascript :: javascript get url 
Javascript :: js split array in half 
Javascript :: js loop through array backwards 
Javascript :: remove commas from string javascript 
Javascript :: javascript capitalize string 
Javascript :: dino game 
Javascript :: bootstrap modal title center 
Javascript :: jquery submit form ajax 
Javascript :: regex password uppercase lowercase number special character 
Javascript :: node-fetch post request example 
Javascript :: javascript replace space by underscore 
Javascript :: how to hide header in react navigation 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =