Make WordPress Core

Opened 3 years ago

Closed 12 months ago

#54178 closed enhancement (duplicate)

Use theme.json for theme metadata instead of style.css

Reported by: jamesbonham's profile jamesbonham Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

Description

Most themes no longer rely use one big css file compiled to style.css. This means that the file is often only used for theme metadata (name, description, version etc.). From an outside perspective this makes no sense.

Seeing as the comment in style.css is structured data it would be most logical to allow theme developers to add it all to the theme.json file.

I know this would have some far reaching implications, as many places read the info in style.css, but it would be logical and would encourage developers to start using the theme.json file more.

Change History (2)

#1 @sabbirshouvo
3 years ago

I think the implementation approach should be checking for both style.css and theme.json if any theme contains one of these should be considered as a valid theme.

This approach will be backward compatible as all of the current themes in WordPress directly doesn't contain style.css and all previous version of WordPress uses that file to check theme metadata.

If any core contributor encourages then I will dig down this and add a patch!

#2 @poena
12 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #24152.

Hi
I understand this ticket is focused on the new theme.json format introduced with the site editing features. But there is an older trac ticket that was opened 10 years ago, so I will close this one as a duplicate. Please continue the discussion there:

https://core.trac.wordpress.org/ticket/24152

There were similar discussions on the Gutenberg GitHub repository, but I don't recall the exact links or issue numbers right now.

Note: See TracTickets for help on using tickets.