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

File Block: Missing backward compatible styles for classic themes #45399

Closed
t-hamano opened this issue Oct 29, 2022 · 4 comments · Fixed by #47686
Closed

File Block: Missing backward compatible styles for classic themes #45399

t-hamano opened this issue Oct 29, 2022 · 4 comments · Fixed by #47686
Assignees
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Block] File Affects the File Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Oct 29, 2022

Description

In #41822, the button element styles were moved from each block to theme.json. And the style for representing the download button in the file block has also been removed from the block's stylesheet. Since there are no backward-compatible styles for the file block, classic themes without theme.json will apply unnatural styles:

  • The button-like style of the download button is lost.
  • When the focus is on the download button, the text color is white, making it invisible.

Just as the button block provides backward-compatible styles for the classic theme, I believe that this should be done for the file block as well.

Step-by-step reproduction instructions

Classic themes such as Twenty Twenty One and Twenty Twenty cannot be reproduced because they have styles for file blocks. Therefore, create a plain theme with the following files:

style.css

/*
Theme Name: Empty Classic
*/

index.php

<?php
wp_head();

if ( have_posts() ) {
	while ( have_posts() ) {
		the_post();
		the_content();
	}
}

wp_footer();
  • Insert a file block.
  • Confirm that the style of the download button is lost in both the editor and the front end.
  • Confirm that the text disappears (turns white) when the download link is focused on, for example, by mouse-over.

Screenshots, screen recording, code snippet

WordPress 6.0

Has the button-like style.

wp6 0

WordPress 6.1

The style of the download button is lost.

wp6 1

The text disappears (turns white) when the download link is focused.

wp6 1_hover

Environment info

No response

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

Yes

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

Yes

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended Backwards Compatibility Issues or PRs that impact backwards compatability [Block] File Affects the File Block labels Oct 29, 2022
@t-hamano t-hamano added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Nov 3, 2022
@mpkelly
Copy link
Contributor

mpkelly commented Nov 9, 2022

I am going to take this on now

@t-hamano
Copy link
Contributor Author

Thank you for addressing this issue, @mpkelly !

@t-hamano
Copy link
Contributor Author

t-hamano commented Feb 2, 2023

Hi @mpkelly,

Just wanted to know if you were addressing this issue. If it is too difficult for you to tackle, I will be happy to help 👍

@mpkelly
Copy link
Contributor

mpkelly commented Feb 2, 2023

Hi @t-hamano, I'm unlikely to work on it in the near future, so please go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Block] File Affects the File Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants