Files
chrnx-dev-wp/blocks/related-posts/block.json
T
chrnxandClaude Opus 5 6dc4de6b8e fix: stop the text palette slug from hijacking every custom colour
theme.json shipped a palette entry with the slug "text", so WordPress
generated `.has-text-color { color: var(--wp--preset--color--text)
!important }`. The block editor puts that same class on any block given a
custom text colour, so the rule overrode every one of them site-wide with
the dark-theme foreground, unreadable in either theme. An !important
declaration beats an inline style, which is why the colour set on the
block never had a chance.

Rename the slug to "foreground". No published content used the class, for
the obvious reason that it never worked, so nothing has to be migrated.
A smoke test now rejects any palette slug that shadows an editor utility
class.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 10:21:23 -05:00

22 lines
842 B
JSON

{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/related-posts",
"version": "0.4.3",
"title": "Related Posts",
"category": "theme",
"description": "Related stories selected by topic, tags, and recency.",
"textdomain": "chrnx",
"usesContext": ["postId", "postType"],
"attributes": {
"limit": { "type": "integer", "default": 3, "enum": [3, 5] },
"layout": { "type": "string", "default": "adaptive", "enum": ["adaptive", "grid", "carousel"] },
"headingLevel": { "type": "integer", "default": 2, "enum": [2, 3, 4, 5, 6] }
},
"supports": { "html": false, "align": ["wide", "full"] },
"editorScript": "file:../../assets/js/editor-related-posts.js",
"viewScript": "file:../../assets/js/related-posts.js",
"style": "file:./style.css",
"render": "file:./render.php"
}