pattern-directory icon indicating copy to clipboard operation
pattern-directory copied to clipboard

Support viewport width

Open richtabor opened this issue 2 years ago • 3 comments

I'd expect to be able to assign a viewport width for patterns to display better for themes that register patterns via theme.json, like Twenty Twenty-Four. Even a text control with a number attribute would do fine.

viewportWidth (optional): An integer specifying the intended width of the pattern to allow for a scaled preview of the pattern in the inserter.

richtabor avatar Nov 08 '23 12:11 richtabor

What would it take to add viewport width support to patterns? I'm finding this more and more important, as I explore updating the curated patterns on within the patterns directory.

viewportWidth (optional): An integer specifying the intended width of the pattern to allow for a scaled preview of the pattern in the inserter.

CleanShot 2024-04-23 at 10 34 09

You can see the variances between the preview scale (modified with viewport width) and the inserted pattern. It feels unexpected having a different visual representation of the pattern between the preview and the actual inserted pattern:

CleanShot 2024-04-23 at 10 38 19

richtabor avatar Apr 23 '24 14:04 richtabor

@ryelle what do we need to do to have this here, and https://github.com/WordPress/pattern-directory/issues/683?

richtabor avatar Aug 15 '24 16:08 richtabor

I can set this manually from my sandbox for any patterns that exist right now, if you can give me URLs or IDs. To create a UI for this isn't hard, it's all just a matter of priority. PRs are welcome though, I'd be happy to review 🙂

ryelle avatar Aug 26 '24 16:08 ryelle