Skip to content

Parse padding presets for use in sizes values #1240

@joemcgill

Description

@joemcgill

As described in this comment. In order to make an image's sizes value more accurately reflect the constraints of its alignment container, we need to incorporate the way padding settings affect the width of the container. For example, in the Twenty Twenty-four theme, the default settings.layout.contentSize setting is 620px, which is the max size that the container will be on larger viewport widths, but that width gets constrained by the padding styles for the site.

image

However, in many cases, theme.json padding styles reference the global padding settings, using CSS variables like var(--wp--preset--spacing--50), which cannot be calculated by the browser when the sizes attribute is parsed, so we will need a way to parse these settings into valid media query values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Plugin] Enhanced Responsive ImagesIssues for the Enhanced Responsive Images plugin (formerly Auto Sizes)

    Type

    No type

    Projects

    Status

    Not Started/Backlog 📆

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions