Windows Phone Themes
Windows Phone has since the start had the concept of themes, the theme is built up from either a dark or light background and a accent colour.
Sometimes it's a nice touch to have your app use the the theme the user has chosen. It can make for a less "jarring" experience and it can make your app fit in with the rest of the overall feeling of the phone.
So I went looking around a bit further and figured I'd share my findings :)
Dark or light theme
In default.html, you find this line:
<link href="/css/ui-themed.css" rel="stylesheet" />
With the comment
<!-- At runtime, ui-themed.css resolves to ui-themed.light.css or ui-themed.dark.css based on the user’s theme setting. This is part of the MRT resource loading functionality. -->
In the css folder of the project, one can find both the files
ui-themed.dark.css however looking in them, they just contain references to the "system files" containing the actual css code e.g.
To find the actual files, we have to look in the project references folder.
After some testing on the app, I found that for example buttons, got the accent color of the theme when being pressed and armed with this and the information about the theme css files, I went digging.
And then magic happens
Eventually I found the following in the
Here we can see that the backgound colour of an active button is "Highlight", which isn't any colour I know of (and I've been doing web development for quite a few many years), but with the help of the ever helpful Visual Studio editor, we can see that the preview of the colour, is actually the elusive accent colour!
And with the magic of Intellisense (Visual Studio autocomplete), we can also see that there's also a accompanying text colour called "HighlightText" to go with it.
P.S If you're looking for how to do this in XAML and C# or VB look here: How to apply theme resources for Windows Phone