locked
Issue with changing themes (light nad dark) in WinJS

    Question

  • Hi All...

    I am setting background color for all pages using body tag.When I change the theme from dark to light in a page, it applies properly and when I navigate back , it displays the light theme. Now here if I set to dark theme, all the changes applies except for

    background color. It remains light itself. When I click again to light and then dark, it works properly.

    any idea why this strange behavior occurs?


    Nazia

    Friday, November 8, 2013 7:23 AM

Answers

  • I was trying to apply the style for body tag in all css pages...

    may be it could be the issue... since the same body tag appears in all pages, it failed to apply the background color whereas all other containers within the body have different styles. so I placed a parent div next to body tag and assigned background color for this parent div instead of body tag,which solved my solved.


    Nazia

    • Marked as answer by Nazia Firdouse Wednesday, November 13, 2013 1:51 PM
    Wednesday, November 13, 2013 1:51 PM

All replies

  • Bit hard to follow what you mean, but best thing to do is open you app, and use the dom explorer to see what css class is affecting your page.

    Is best to figure out what is going on, but if you end up not figuring it out you can always set !important at the end of the css rule. But is best to figure out what is going on.

    Friday, November 8, 2013 1:08 PM
  • I would also use Blend in Interactive mode to see what your CSS hierarchy is and when the different theme gets "called". I suspect that you are loading page fragments and are only setting the "theme" for one page or if only for one of your many pages programmatically.

    Good luck!

    Christine

    Saturday, November 9, 2013 2:53 PM
  • I was trying to apply the style for body tag in all css pages...

    may be it could be the issue... since the same body tag appears in all pages, it failed to apply the background color whereas all other containers within the body have different styles. so I placed a parent div next to body tag and assigned background color for this parent div instead of body tag,which solved my solved.


    Nazia

    • Marked as answer by Nazia Firdouse Wednesday, November 13, 2013 1:51 PM
    Wednesday, November 13, 2013 1:51 PM