Make WordPress Core


Ignore:
Timestamp:
05/31/2024 01:17:50 AM (2 years ago)
Author:
noisysocks
Message:

Block Themes: Add support for relative URLs in top-level theme.json styles

Allow using relative file: URLs in top-level theme.json properties such as
styles.background, and modify the REST API to provide clients with the
absolute URLs via a 'https://api.w.org/theme-file' attribute in the _links
array.

Props ramonopoly.
Fixes #61273.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-b.json

    r55231 r58262  
    1515                        }
    1616                }
     17        },
     18        "styles": {
     19                "background": {
     20                        "backgroundImage": {
     21                                "url": "file:./assets/sugarloaf-mountain.jpg"
     22                        }
     23                }
    1724        }
    1825}
Note: See TracChangeset for help on using the changeset viewer.