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

[93] Ensure undefined or invalid colours fall back to an empty string #100

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

g-elwell
Copy link
Member

@g-elwell g-elwell commented Aug 23, 2024

Description

This change fixes #93 by preventing undefined being set as the colour value when the "Clear" button is pressed in the UI.

It also allows for overwriting of inherited/existing colour values within theme.json, as it forcibly sets the value to an empty string when cleared. In order to get the original value back, you can choose the 'clear all customisations' option from the more menu.

Steps to test

  • Install themer and twentytwentyfour theme
  • Navigate to 'Appearance > Styles Editor'
  • Notice that the site should have colours set by default for background and text
  • Clear the colours
  • Notice they update to empty strings and the colour is no longer applied on the frontend

Screenshots/Videos

Screen.Capture.on.2024-08-23.at.17-06-48.mp4

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@g-elwell g-elwell changed the base branch from main to release/1.0.0 August 23, 2024 16:08
@g-elwell g-elwell marked this pull request as ready for review August 23, 2024 16:09
@g-elwell g-elwell self-assigned this Aug 23, 2024
@g-elwell g-elwell added the bug Something isn't working label Aug 23, 2024
Copy link
Contributor

@squarewave17 squarewave17 left a comment

Choose a reason for hiding this comment

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

Happy with this 👍🏻

@g-elwell g-elwell merged commit 901571f into release/1.0.0 Aug 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Clearing' colours breaks the ability to add colour
2 participants