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

Add guardrails against transparent background color #919

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taheralfayad
Copy link
Contributor

Fixes #908
Note: These changes solve this issue independent of the corresponding changes made to phpally in this pull request.

Issue:

As of recent, UCF instructional designers have been complaining about a bug that flags HTML elements with the background-color: transparent style as having insufficient contrast with their background. A pull request was recently made to address this particular issue in phpally, making any elements with the transparent style inherit the background color of their parent element. The changes in the phpally pull request successfully got rid of the false positives, however, they could not address the scenario where there might actually be some color contrast issues. This is where this pull request comes in.

Solution:

To address this issue, the changes made in this pull request will at first scan the HTML of any canvas page to look for any elements with the background-color: transparent style. If such elements are found, then UDOIT will change the HTML elements to inherit the background color of their parent element, which allows the user to change the true background color of the elements, and resolve any contrast issues resulting from them.

@taheralfayad taheralfayad added bug php Pull requests that update Php code labels Jul 31, 2023
Copy link
Contributor

@dmols dmols left a comment

Choose a reason for hiding this comment

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

Works as intended: the HTML is appropriately updated to not have a transparent background anymore and the issue no longer pops up in the UDOIT dashboard, since the HTML is updated as the course scan occurs. Great work! Good to push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transparent background-color styling throwing "Insufficient Text Color Contrast" error
2 participants