Make WordPress Core

Opened 8 years ago

Closed 6 months ago

#45741 closed enhancement (wontfix)

Theme block style dependencies while enqueuing

Reported by: superpoincare Owned by:
Priority: normal Milestone:
Component: Bundled Theme Version: 5.0.2
Severity: trivial Keywords:
Cc: Focuses: css

Description

Bundled themes enqueue a block style, such as /css/blocks.css in twentytwelve.

These css rules sometimes overwrite the rules in the files with handles wp-block-library and wp-block-library-theme

While the dependencies seem to be maintained, for the sake for completeness, shouldn't dependencies be made explicit in bundled themes' functions.php files?

For example, dependencies in this enqueue?

wp_enqueue_style( 'twentytwelve-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentytwelve-style' ), '20181018' );

Change History (3)

#1 @sabernhardt
5 years ago

  • Focuses css added
  • Keywords needs-patch added

Thanks for the report!

The 'wp-block-library-theme' styles can be added inline, so that could be tricky (if listing that one is necessary).

After finding an issue with the stylesheet sequence on #54076, adding 'wp-block-library' should be worth exploring with Twenty Twelve to Twenty Seventeen.

wp_enqueue_style( 'twentytwelve-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'wp-block-library', 'twentytwelve-style' ), '20190406' );

This ticket was mentioned in Slack in #core-themes by karmatosed. View the logs.


2 years ago

#3 @sabernhardt
6 months ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

Since WordPress 6.9, all of the block library styles are printed inline, separately, by default. It probably is not a good idea to try adding a wp-block-library dependency now.

Note: See TracTickets for help on using tickets.