In WinJS Windows 8 app, how to change highlight color of selected item in list?
I want to change the CSS style when a WinJS Listivew element is selected, for example in the picture.
Basically, I want the purple part to be grayed out, and this has to be done via CSS, I think because we are in WinJS.
win-selectionborder win-selectionbackground win-selectionhint win-selectioncheckmark win-selectioncheckmarkbackground
I've tried all of them, but they all produce strange results, changing everything except this one.
source to share
Here are images from chapter 5 of my free book, Programming Windows Store Apps with HTML, CSS, and JavaScript, Issue 2 , where I show you how all the styles are associated with a checkbox. It's specifically in the Style Gallery: WinJS Controls section. In these images, I am showing the default style versus the custom style. You will see that the trick does indeed have the correct selectors for the style hierarchy, as it is often not just one class that you should be referring to. Also note that using .win-selectionstylefilled distinguishes between this and the outline style.
Also note that the styles I'm showing here are not tied to a specific list or page; Gbellman's answer gives some of these.
source to share
WinJS is a complex maze of CSS. Here's what I recommend. Open the project in the Item inspector (Internet Explorer 10 or 11) through the project. You can then hover your cursor over the element and trace the CSS chain fallback to figure out where the color changes.
This is the only easy way to do it in our project. I ended up having to write a lot of custom CSS to override some of the design elements, but that only worked when I really figured out which properties are inherited, where through CSS ...
source to share