All of the running code is pure JavaScript! No extra plugins or libraries needed. If you are using Visual Studio, we recommend getting The CSS Variable Shim from NuGet. If you would like to avoid NuGet please download the source using the link above and add it into your project. With Visual Studio please add a reference to the _refernce.js file. This will make it easier to use the intellisense. All of the source code is documented and has tags for using intellisense. If a function is ment for public use, when coding you will see 'Public' as the first word in the description. In contrast you will see 'Private' for functions that are internal to the shim. Below is a list of the public functions.
Note: There are a couple of ways you can load your stylesheets to be read by the CSS Variable Shim parser. First is to just call the setStyleFiles method with no parameters. Doing this will cause the parser to read the references that javascript has for the stylesheets. The javascript references will be in order of download. The next way and the most cost effective way is to pass in an array of relative locations to the setStyleFiles method. Using this method you can specify an order and exclude any stylesheets that may not utilize the power of the CSS Variable Shim.
List Of Public Functions
setStyleFiles
refreshTheme
swapAProperty
swapMultipleProperties
Loading All Stylesheets In The Order They Were Downloaded
Loading Specific Stylesheets In An Order
setStyleFiles(new Array('/Content/tile.css', '/Content/login.css', '/Content/Site.css'));
Refresh Styles After A Change
Swap Out A Property Of A Variable
swapAProperty({selectorName:'@Accent', property:'rgb(120,120,120)'});
Swap Out A Property Of A Variable And Force A Refresh
swapAProperty({selectorName:'@Accent', property:'rgb(120,120,120)'},true);
Swap Out A Properties Of Variables
swapMultipleProperties({
selectorNames:[]{'@Accent','@Main','@StandardPx'},
properties:[]{'rgb(120,120,120)','rgb(120,0,54)','10px'}
});