Make WordPress Core

Opened 10 months ago

Last modified 5 weeks ago

#64109 assigned enhancement

Bundled themes: Stylesheets should be minified in classic themes

Reported by: westonruter Owned by: rutviksavsani
Priority: normal Milestone: Future Release
Component: Bundled Theme Version:
Severity: normal Keywords: has-patch
Cc: Focuses: css, performance

Description (last modified by westonruter)

This is a follow-up to #63012 which minified stylesheets in bundled block themes. The same remains to be done for bundled classic themes. This includes dedicated stylesheets for blocks, which would then allow them to be inlined per #58519. See also #63007 which enabled the stylesheets for bundled block themes to be inlined.

Blocking:

Change History (14)

#1 @westonruter
10 months ago

  • Description modified (diff)

#2 @westonruter
9 months ago

  • Milestone Future Release7.0

This ticket was mentioned in PR #10818 on WordPress/wordpress-develop by @rutviksavsani.


6 months ago
#3

  • Keywords has-patch added; needs-patch removed

## Summary
Implements automated CSS minification for 11 classic WordPress themes (Twenty Ten through Twenty Twenty-One) to improve frontend performance. Minified CSS files are conditionally loaded based on the SCRIPT_DEBUG constant.

Initial reference PR: https://github.com/WordPress/wordpress-develop/pull/10081

## Changes Made

### Build Infrastructure

  • Added cssmin:themes Grunt task for automated CSS minification
  • Updated .gitignore to exclude generated .min.css files from version control

### Per-Theme Changes
Each theme received:

  • package.json - npm build configuration with cssnano dependencies
  • package-lock.json - Locked dependency versions
  • contributing.txt - Developer documentation for CSS minification workflow
  • Updated functions.php - Conditional loading logic using SCRIPT_DEBUG
  • Updated CSS files - Added minification notice comments

Trac ticket: https://core.trac.wordpress.org/ticket/64109

#4 @westonruter
6 months ago

  • Owner set to rutviksavsani
  • Status newassigned

@westonruter commented on PR #10818:


6 months ago
#5

@rutviksavsani it might make sense to open a pull request first just for the Twenty Twenty-One theme to facilitate review and it iron our the kinks. Then once that is reviewed and committed, another PR can be opened to replicate the established pattern from TT1 to the prior classic themes.

That is to say, maybe cherry pick https://github.com/WordPress/wordpress-develop/pull/10818/commits/136b585659adaa0a1437b6599b18f16e80a785e8 into a separate PR.

This ticket was mentioned in PR #10860 on WordPress/wordpress-develop by @rutviksavsani.


6 months ago
#6

This PR implements the Minification for TwentyTwentyOne theme initially to test out before we convert all of them in https://github.com/WordPress/wordpress-develop/pull/10818

Trac ticket: https://core.trac.wordpress.org/ticket/64109

@rutviksavsani commented on PR #10860:


6 months ago
#7

@westonruter As suggested in the other PR for minification of stylesheets for themes, Here I have created a separate PR for TT1.

@westonruter commented on PR #10860:


6 months ago
#8

cc @sabernhardt

@westonruter commented on PR #10818:


6 months ago
#9

That is to say, maybe cherry pick 136b585 into a separate PR.

See https://github.com/WordPress/wordpress-develop/pull/10860

@westonruter commented on PR #10860:


6 months ago
#10

@rutviksavsani With r61628 (05e54af), IE support has been removed from the theme and this has introduced merge conflicts. Would you address?

This ticket was mentioned in Slack in #core-performance by westonruter. View the logs.


6 months ago

#12 @westonruter
6 months ago

  • Milestone 7.0Future Release

Punting based on feedback from @sabernhardt

#13 @westonruter
6 months ago

  • Milestone Future Release7.1

#14 @wildworks
5 weeks ago

  • Milestone 7.1Future Release

As this ticket has been inactive for a while, I will move the milestone to "Feature Release". Please feel free to move it back if it can be completed by 7.1 beta 1.

Note: See TracTickets for help on using tickets.