Objective: I am seeking a way to confine the impact of a specific style sheet to a modal without altering the underlying page with minimal adjustments, ideally none. For instance:
<html>
<head>
<link rel="stylesheet" href="/css/theme1.css"/>
<head>
<body>
<div class="bodycontent">
Some content
</div>
<div class="modal">
<link rel="stylesheet" href="/css/theme2.css"/>
Modal Content
</div>
</body>
</html>
Obviously, the above approach does not achieve the desired result as it applies theme2.css to the entire page instead of just the modal. Is there a method to selectively apply styles only to the modal without manually specifying .modal before each rule in theme2.css?
Edit for clarification: I am essentially creating a theme changer feature with the preview displayed in a modal while avoiding any alterations to the main page layout. Additionally, if the themes used are extensive, I aim to prevent using separate large CSS files for the modal preview and actual application on a page.