I am in the process of developing a web application that users will use in the field, and they have requested the ability to manually switch between light and dark styles based on the ambient lighting conditions. I am utilizing jQuery for this project.
I assigned an id
to my stylesheet and created a button that triggers the toggle()
event. In the event, I change the href
attribute to the desired CSS file. The CSS file contains multiple @import
directives for better organization.
The issue I am facing is that only the main CSS file is being applied. I attempted to use absolute paths in the @import
directives, but it did not resolve the problem.
Is there a solution that I am overlooking, or do I need to consolidate all styles into a single CSS file?
Update:
Apparently, this problem occurs only in IE8, as it works perfectly in Chrome and Firefox. Unfortunately, my client specifically requires IE8 compatibility. It seems like this is a similar issue to this question.