Make WordPress Core

Opened 6 months ago

Last modified 2 months ago

#64109 assigned enhancement

Bundled themes: Stylesheets should be minified in classic themes

Reported by: westonruter's profile westonruter Owned by: rutviksavsani's profile rutviksavsani
Milestone: 7.1 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: css, performance Cc:

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 (13)

#1 @westonruter
6 months ago

  • Description modified (diff)

#2 @westonruter
5 months ago

  • Milestone changed from Future Release to 7.0

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


3 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
3 months ago

  • Owner set to rutviksavsani
  • Status changed from new to assigned

@westonruter commented on PR #10818:


3 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.


3 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:


3 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:


2 months ago
#8

cc @sabernhardt

@westonruter commented on PR #10818:


2 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:


2 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.


2 months ago

#12 @westonruter
2 months ago

  • Milestone changed from 7.0 to Future Release

Punting based on feedback from @sabernhardt

#13 @westonruter
2 months ago

  • Milestone changed from Future Release to 7.1
Note: See TracTickets for help on using tickets.