Make WordPress Core

Opened 7 years ago

Closed 8 weeks ago

#45741 closed enhancement (wontfix)

Theme block style dependencies while enqueuing

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

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


22 months ago

#3 @sabernhardt
8 weeks ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

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.