Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the iframe background color #478

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions public/css/SampleLayout.css
Original file line number Diff line number Diff line change
@@ -13,9 +13,26 @@
height: 100%;
border: none;
display: block;
/* should should remain white because samples in iframes expect a white background */
color-scheme: light;
/*
* iframe content inherits the background color of the iframe element
* in the parent but, the content might expect the default white background
* so we set the iframe element's background to white
*/
background-color: #fff;
/*
* further, the browser will ignore the color scheme in the iframe content
* if it matches the one in the parent iframe element. In other words
*
* * iframe element says 'color-scheme: light dark'.
* * iframe content says 'color-scheme: light dark'.
*
* result: iframe content color-scheme setting is ignored and it gets
* the background color from the iframe element in the parent.
*
* Solution: set the iframe element color-scheme to initial. Now the
* iframe content's setting will be respected.
*/
color-scheme: initial;
}

.sampleCategory {