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

Remove React guard from worker sample #391

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Remove React guard from worker sample #391

merged 1 commit into from
Mar 11, 2024

Conversation

toji
Copy link
Contributor

@toji toji commented Mar 11, 2024

Removes some code from the worker sample that only existed to catch errors when the code was executed twice by React. Now that React has been removed it's no longer necessary.

Also removed the white background style for sample iframes, which looked strange and I assume to be a mistake? If this was intentional let me know and I'll revert this bit.

@toji toji requested a review from greggman March 11, 2024 19:53
@@ -13,7 +13,7 @@
height: 100%;
border: none;
display: block;
background-color: #fff;
/*background-color: #fff;*/
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be removed. iframes (this seems like a bug in the spec to me) get their background color from their parent which is bad. The page itself might do have the default black text in which case you'd get black on black text. This is especially true for external samples. They all expect the default is white.

I think rather, add

:root {
  color-scheme: light dark;
}

to all the sample/**/index.html files? Let the samples be responsible for what background color they want.

Also, I think we should look into making the menus be responsive to dark/light prefs in some future PR.

wdyt?

Copy link
Contributor Author

@toji toji Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I don't think the white backgrounds look great, but we can have the samples decide that for more consistency. I removed this change.

Removes some code from the worker sample that only existed to catch
errors when the code was executed twice by React. Now that React
has been removed it's no longer necessary.
@toji toji merged commit c7e7f34 into main Mar 11, 2024
1 check passed
@toji toji deleted the worker-update branch March 11, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants