We'regoingtobecoveringCSSvariablesandhowthatcouldbeusedtocreate a lightanddarkthemeforyourwebsite.
What's getstartednowtogetstarted?
I have a basicHTMLfileonthelefthere, whichimportsarestilesdotCSS, fileourscriptfileforourJavaScriptandcontainstwodibsnamedoneandtwo, withsomechildelementsinsideofthemnamed 11121321 and 22 Andthen, finally a coupleofbuttonsatthebottomwithuniqueideas, whichwe'regoingtousetoswaparoundourthemeshehasstarted.
Atfirst, CIAsaysvariablesmayseemlike a complicatedtopic, butreallytheyworkjustlikeanyothersayshasproperty, exceptforyougettodefinethispropertyyourselfas a custompropertymostofthetimewhereyouwantedtoclear.
Andlet's saywewantedtobewhiteandwesaythat a niceseethatourtextcoloriswhiteinsideofthewonder, butnotinsideofthetodosincewehaven't actuallyspecifiedanythinginsideabouttodipyet, anditjustusesthisbasevaluethat's inheritedfromtheroot.
Anothernicethingaboutvariables, whichisreallythebiggestusecaseforthem, isthatyoucanusetheminmultipleplaces, yourapplicationandchangetheminonespot, and I'llchangeiteverywhere.
So, forexample, let's saythatwewantedtoselectthis 1.1 elementandwewantedtogiveit a littlebitofmarginsowecouldsetthemarginheretobeequaltothatvariablethatwecreated, whichisdidmarginandwecoulddothesamething.
So I hopeyouguysenjoyedthisvideoonstatesetsvariablesandlearnhowyoucanusethemandnotonlyyourCSS, butalsoyourJavaScriptandhowitcouldmakeyourcodecleanerandeasiertouse.