← All releases

wp-content/plugins/foundry/foundry.php

Foundry

Create block style variations in the admin, then read the CSS it wrote.

== Description ==

Block style variations are the right way to give editors options, and defining one means writing CSS by hand and a registration call in PHP. Foundry gives you a visual editor for the CSS and writes both, into your theme, in a form that survives the plugin being removed.

Variations preview live against real content from your site rather than a lorem-ipsum sample, which is the only way to find out that your new quote style breaks on a two-line quote.

It refuses to generate a variation that fails contrast against the block’s background, and says which pair failed and by how much.

== Screenshots ==

Numbered the way they ship in /assets/. Click any one to see it full width.

== Installation ==

  • Install and activate the plugin.
  • Open Appearance → Block Styles and pick a block.
  • Design the variation, then export it into your theme.

Exported variations are ordinary CSS and one PHP call. Nothing references Foundry.

== Frequently asked questions ==

Does it work with any theme?

Any theme with a stylesheet it can write to. Block themes and classic themes both.

What about theme.json?

Variations that map cleanly onto theme.json styles are offered as theme.json output instead, which is the better home for them.

== Changelog ==

= 1.5.0 =

  • Contrast check before export, with the failing pair and its ratio.
  • Export to theme.json where the variation maps onto it.

= 1.2.0 =

  • Live preview uses real posts rather than sample content.