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

Calendar: Consider removing the hardcoded colors #40989

Closed
carolinan opened this issue May 11, 2022 · 3 comments · Fixed by #42029
Closed

Calendar: Consider removing the hardcoded colors #40989

carolinan opened this issue May 11, 2022 · 3 comments · Fixed by #42029
Assignees
Labels
[Block] Calendar Affects the Calendar Block [Type] Enhancement A suggestion for improvement.

Comments

@carolinan
Copy link
Contributor

carolinan commented May 11, 2022

Description

The hard coded colors in the calendar block does not work well on some colored backgrounds or when the theme sets the link color to a light color.
The color contrast can be too low, making the texts difficult to read.

Related: #39053

Step-by-step reproduction instructions

  1. In the editor, add a few default calendar blocks with default settings.
  2. Place the blocks inside groups with different colored backgrounds to see potential contrast issues with the hard coded colors.

Screenshots, screen recording, code snippet

Here are two calendar blocks in Twenty Twenty-Two using the blue style variation:
The first is placed inside a group block with a white background, to mock light colored theme backgrounds:

the text color and table head background colors has a low contrast, making the text difficult to read

Custom theme with dark grey background:
the default text color is barely readable over the dark background

Environment info

WordPress 6.0 rc2, beta tester plugin
Current Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

@carolinan carolinan added the [Block] Calendar Affects the Calendar Block label May 11, 2022
@t-hamano
Copy link
Contributor

Hi @carolinan,

I'm interested in improving the style of the calendar block too.
I've made the following changes in try/block-calendar branch based on a table block (using the same table tag):

  • Removed hard-coded colors
  • Border color inherit text color
  • Make thead bottom border thicker
  • Add text and link color with block support

I would love to hear your opinions.

f2f1c83f9c7b6f1ba7bebd19ed0e25fe.mp4

@carolinan
Copy link
Contributor Author

@t-hamano I have tried the branch. I like that it matches the table block better and that the table head background color was removed. Will you submit a PR?

@carolinan carolinan added the [Type] Enhancement A suggestion for improvement. label Jun 29, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 29, 2022
@t-hamano
Copy link
Contributor

Thanks for checking it out!
I created a PR #42029 based on this branch.
If you have any other suggestions, please comment on the PR.

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Calendar Affects the Calendar Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants