Skip to content

Set default iframe background color to white #1852

@catarak

Description

@catarak
Member

Nature of issue?

  • Found a bug

Details about the bug:

Hi @catarak I have run into this as well, here is a screenshot of how text looks in the Preview window in Dark mode, but in High Contrast mode it is similar, defaulting to black text on a very dark background:
image
Here's an example of a sketch that displays this issue: https://editor.p5js.org/ml5/sketches/XCFPKqIKrt

Originally posted by @leemark in #1400 (comment)

@catarak: I think the issue here is that the iframe should have a default background color of white, as is the norm for websites.

Activity

added
Good First IssueA beginner-friendly issue, great for first-time contributors
Help WantedWould love additional input or contributions!
Priority:HighShould be addressed soon but not critical
on May 5, 2021
nsmarino

nsmarino commented on May 8, 2021

@nsmarino

Hello,

I am currently working on a pull request to fix this issue, but I would like some advice. I added a default background color of white to the iframe in the PreviewFrame component by adding background-color: white to the .preview-frame class in client/styles/components/_preview-frame.scss. However, this has the possibly undesired effect of making the entire preview pane white even when no sketch is running, resulting in a confusing user experience. An alternative solution I would like to propose is to simply make the default style.css file for a new sketch contain the following:

body {
  background-color: white;
}

In this way, the iframe would only turn white when the sketch was running, making for a better user experience. The user would receive visual feedback on whether or not the sketch is running, and could easily change the color of the document from the default stylesheet.

This change could easily be done by editing defaultCSS in client/modules/IDE/reducers/files.js.

I am welcome to any and all feedback!

shubhamkapoor01

shubhamkapoor01 commented on Aug 25, 2021

@shubhamkapoor01

Hi, I'm new to open source contributions i'll give this a shot as my first issue!

added 2 commits that reference this issue on Aug 25, 2021
2669192
17b1d39
akshatnema

akshatnema commented on Dec 18, 2021

@akshatnema
Contributor

Hey @catarak, I tested this bug on the editor and it's still there. I want to work on this issue and will give a PR soon for this.
Here is a preview of the changes I will make:
image

Kindly confirm if you want exactly this or something else?

chaudhary-99

chaudhary-99 commented on Feb 1, 2023

@chaudhary-99

Is anyone working on this issue? i would like to work on this issue.

Ankush263

Ankush263 commented on Sep 8, 2023

@Ankush263
Contributor

The best way to tackle this issue is, by adding this line inside index.html <head></head> section

<link rel="stylesheet" href="style.css">

then apply the CSS in styles.css file

body {
  background-color: white;
}

OR

body {
  color: white;
}

5 remaining items

unnati110302

unnati110302 commented on Oct 13, 2023

@unnati110302

Hello p5.js developers. I'm new to open source and would love to fix this issue.

Madhav17777777

Madhav17777777 commented on Oct 18, 2023

@Madhav17777777

this is my first issue ,i will try my best....

faizan-20

faizan-20 commented on Dec 23, 2023

@faizan-20

hey @catarak if no one is working on this issue may i take it up?

added a commit that references this issue on Dec 29, 2023
shamvrueth

shamvrueth commented on Jan 22, 2024

@shamvrueth

If the issue is still open, can I work on this?

added
BugError or unexpected behaviors
and removed on Mar 19, 2024
Noorain464

Noorain464 commented on Aug 1, 2024

@Noorain464

I am new to open source and I would like to work on this issue .
Please reply

removed
Good First IssueA beginner-friendly issue, great for first-time contributors
on Nov 6, 2024
Harshit-7373

Harshit-7373 commented on Mar 1, 2025

@Harshit-7373
Contributor

@raclim I think this issue is solved now.

Image

I tried running the sketch provided in the description of this issue. But the background and everything is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Set default iframe background color to white · Issue #1852 · processing/p5.js-web-editor