Linux 软件免费装
Banner图

Spacery - Responsive Spacing and Spacer Block

开发者 nikosmoustakas
更新时间 2026年9月25日 20:20
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

responsive gutenberg spacing spacer breakpoints

下载

1.0.3 1.0.0 1.0.1 1.0.2

详情介绍:

Your design has four breakpoints. WordPress gives you two. Spacery closes that gap. Padding and margin per breakpoint on any block that supports spacing, a spacer block whose height changes at each one, and up to twelve tiers instead of two — read from your theme where it declares them, so the editor offers the same breakpoints your CSS already uses. Why you would use it Is Spacery for you? Yes, if you build with the block editor, your design system has more than two breakpoints, and you would rather set spacing in the inspector than in a stylesheet. Probably not, if any of these is true: One more thing worth knowing before you install: breakpoints are one set for the whole site, not a per-page choice. That is deliberate — a design system is one set of tiers — but if you wanted different breakpoints on different pages, this is not that plugin. You choose where breakpoints come from Spacery uses one set at a time, and you pick which: The sets are never blended: values from two different intentions sitting side by side produce a set nobody designed. Developers can override the result entirely with the spacery_breakpoints filter. How it fits with WordPress WordPress 7.1 added responsive block styles with two theme-set breakpoints, mobile and tablet. Spacery extends that rather than competing with it: the same desktop-first model, the same disjoint media-query shapes, and the same values where your breakpoints and core's agree — so the two never disagree at a boundary, and turning Spacery off leaves core's own responsive styles working exactly as before. No strings

安装:

  1. Upload the plugin to /wp-content/plugins/spacery, or install it through the Plugins screen.
  2. Activate it through the Plugins screen.
  3. Open Spacery in the admin menu and choose where your breakpoints come from.
  4. Responsive controls appear in the block inspector under Spacery.

屏幕截图:

  • A spacer whose height changes at every breakpoint — which the core Spacer block still cannot do.
  • Name your own breakpoints and set where each one stops, on Spacery's settings screen.

升级注意事项:

1.0.3 Spacery now runs on PHP 8.1 as well as 8.2 and newer. Nothing changes on a site that already runs it. 1.0.2 Fixes a defect where hand-written block markup could raise a fatal error on the page holding it. Worth taking on any site where more than one person can edit posts.

常见问题:

Does this replace the WordPress 7.1 responsive styles?

No. It extends them. If your theme defines settings.viewport, Spacery uses those same breakpoints so the two systems agree.

What happens if I deactivate the plugin?

Your posts stay valid. Spacery's values are stored as block attributes rather than written into your content's markup, so nothing is left behind to break, and reactivating brings them back. One caveat, which is inherent rather than a bug: with Spacery switched off its attribute is not registered, so opening a post in that state and saving it rewrites the block without Spacery's values. Reading is safe; re-saving is not. If you are deactivating to test something, avoid saving posts until it is back on.

Does it work with blocks from other plugins?

Yes, as long as the block declares support for spacing. Spacery has no list of block names: it offers its controls wherever WordPress says spacing applies.

Can I make block spacing (gap) responsive?

WordPress does that itself, at its own two breakpoints, using its own controls - you do not need Spacery for it. Spacery deliberately does not duplicate it, because gap is generated by WordPress's layout system rather than applied to the block wrapper, and a second implementation would drift from the first.

Is it translated?

Every string in the plugin is translatable, in the editor as well as on the settings screen, and translations arrive from translate.wordpress.org through WordPress's normal translation updates — nothing is bundled, so any locale the community translates it into is available without an update to the plugin. There is one exception: the tagline under the plugin's name is part of the brand, like the name itself, and stays as it is in every language — the same line the banner carries, where it is artwork.

Where are my settings stored?

In two options, spacery_breakpoint_source and spacery_custom_breakpoints, both registered with WordPress so they are available through the REST API and WP-CLI with the same validation the settings screen uses.

What happens to my settings if I delete the plugin?

They are kept, unless you ask for them to be removed. There is a checkbox at the bottom of the Spacery screen, off by default. Keeping them is the safe default, and not just tidiness. Your breakpoints are what the values on your blocks are measured against: a value saved at "tablet" means whatever your tablet breakpoint says it means. Remove the breakpoints and a later reinstall starts from Spacery's own set, so that value would apply at a different width - or, if you had renamed your breakpoints, stop applying at all. Nothing would warn you, because nothing is broken; the values would just be different. So the choice is yours and it is off until you make it. Either way Spacery never writes anything into your posts, and never removes anything from them.

更新日志:

1.0.3 1.0.2 1.0.1 1.0.0