Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get os theme value in javascript

    function osTheme(){
        let primarytheme = "";
        if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
            primarytheme = "dark";
        }
        else{
            primarytheme = "light"
        }
        return primarytheme;
    }
Comment

PREVIOUS NEXT
Code Example
Javascript :: Could not resolve project :react-native-iap mergedebugassets 
Javascript :: Alpinejs notification 
Javascript :: change cwd node 
Javascript :: Como saber se existe um atributo em um objeto 
Javascript :: javascript array column 
Javascript :: select the items from selectors in .map reactjs 
Javascript :: angularjs 1.5.6 cdn 
Javascript :: counting duplicate values javascript 
Javascript :: numberformat react phone number 
Javascript :: find all in array javascript 
Javascript :: Capturing enter in javascript 
Javascript :: application pool angular 8 
Javascript :: axios in functional component 
Javascript :: hasownproperty javascript 
Javascript :: angular ng-click toggle class 
Javascript :: camelcase 
Javascript :: how to test if an element has a class in testing library 
Javascript :: js check if all array values are the same 
Javascript :: sum index of an array javascript 
Javascript :: useref in functional component 
Javascript :: jsjs trigger window error 
Javascript :: get local year in js 
Javascript :: react enzyme 
Javascript :: moment format heure 
Javascript :: cors blocking communication 
Javascript :: check browser 
Javascript :: curl send json as variable 
Javascript :: html get form elements 
Javascript :: how to convert utc time to local time angular 
Javascript :: redux state proxy 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =