-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Re-add editor styles for classic themes #47686
Conversation
Size Change: +34 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in f66b974. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4074615373
|
Note: There's the core ticket for inline these styles for classic themes - https://core.trac.wordpress.org/ticket/56990. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for taking care of it.
Thanks for the review! I was reading the core ticket associated with this PR: https://core.trac.wordpress.org/ticket/56990 |
@t-hamano, sure. Let's merge this 👍 |
Cherry-picked this PR to the wp/6.2 branch. |
I have submitted a ticket to WordPress core to apply a similar style to the front end. |
Adds styles into `wp-includes/css/classic-themes.css` to restore file block button element styling for classic themes. Why? In [54257] and [54118], button element styles were moved from each block to `theme.json`. For the file block, the download button styles were removed from the block's stylesheet. These changes impacted themes without a `theme.json` file (i.e. classic themes). This changeset restores the styles for backwards-compatibility. References: * [WordPress/gutenberg#47686 Gutenberg PR 47686] Follow-up to [54257], [54118]. Props wildworks, scruffian, mamaduka, ntsekouras. Fixes #57688. git-svn-id: https://develop.svn.wordpress.org/trunk@55323 602fd350-edb4-49c9-b593-d223f7449a82
Adds styles into `wp-includes/css/classic-themes.css` to restore file block button element styling for classic themes. Why? In [54257] and [54118], button element styles were moved from each block to `theme.json`. For the file block, the download button styles were removed from the block's stylesheet. These changes impacted themes without a `theme.json` file (i.e. classic themes). This changeset restores the styles for backwards-compatibility. References: * [WordPress/gutenberg#47686 Gutenberg PR 47686] Follow-up to [54257], [54118]. Props wildworks, scruffian, mamaduka, ntsekouras. Fixes #57688. Built from https://develop.svn.wordpress.org/trunk@55323 git-svn-id: http://core.svn.wordpress.org/trunk@54856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds styles into `wp-includes/css/classic-themes.css` to restore file block button element styling for classic themes. Why? In [54257] and [54118], button element styles were moved from each block to `theme.json`. For the file block, the download button styles were removed from the block's stylesheet. These changes impacted themes without a `theme.json` file (i.e. classic themes). This changeset restores the styles for backwards-compatibility. References: * [WordPress/gutenberg#47686 Gutenberg PR 47686] Follow-up to [54257], [54118]. Props wildworks, scruffian, mamaduka, ntsekouras. Fixes #57688. Built from https://develop.svn.wordpress.org/trunk@55323 git-svn-id: https://core.svn.wordpress.org/trunk@54856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds styles into `wp-includes/css/classic-themes.css` to restore file block button element styling for classic themes. Why? In [54257] and [54118], button element styles were moved from each block to `theme.json`. For the file block, the download button styles were removed from the block's stylesheet. These changes impacted themes without a `theme.json` file (i.e. classic themes). This changeset restores the styles for backwards-compatibility. References: * [WordPress/gutenberg#47686 Gutenberg PR 47686] Follow-up to [54257], [54118]. Props wildworks, scruffian, mamaduka, ntsekouras. Fixes #57688. Built from https://develop.svn.wordpress.org/trunk@55323 git-svn-id: http://core.svn.wordpress.org/trunk@54856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes: #45399
What?
This PR adds text color and background color to the file block, which is lost in the Classic theme.
Why?
If the classic theme didn't apply any styles to the file block, WordPres 6.0 would apply the following styles.
Editor:
Frontend:
WordPress 6.1, on the other hand, does not apply font size, background color, or text color, regardless of whether the Gutenberg plugin is enabled.
Editor:
Frontend:
As far as I can tell, these styles were removed in #41822. However, just as backward-compatible styles for the classic theme were added to the button block in #44334, I believe similar action is needed for the file block.
How?
Among the missing styles, text color and background color were added;
font-size: 0.8em;
was excluded because it is already defined as the default style.However, this style applies only to the editor. As for the front end styles, I think they need to be added directly to the core, just as the button block is.
Testing 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:
empty-classic/style.css
empty-classic/index.php
Insert the file block and confirm that the text color and background color are applied correctly: