wp-thirdparty-markup-styling
БесплатноБез исполняемых скриптовНе проверенStyle WordPress/WooCommerce markup you don't control — plugin blocks, body-level portals, and render callbacks that drop your classes — from a block theme…
от lightspeedwp★ 20 звёзд на GitHubОб этом скилле
WP Third-Party Markup Styling
Overview
Styling your own blocks is easy; styling markup a plugin emits is where a theme fights the DOM. Four problems recur: the plugin renders its UI as a body-level portal (outside your block, so block-scoped CSS never matches); its render callback drops the is-style-* class you added; it ships !important-heavy stylesheets that out-gun yours; and its styles bleed into nested core blocks (or your styles leak into its). This skill is the set of techniques for each — inspect the real rendered DOM first, then scope, re-inject, and override deliberately rather than by escalating !important.
When to use
- A plugin's slide-out / dropdown / modal (mini-cart drawer, search results, popup) ignores CSS scoped to its block.
- Your
is-style-*class disappears from a plugin block's front-end markup. - A plugin's
!importantrules override your theme styles no matter the load order. - A nested
core/navigation(or similar) inside a plugin dropdown comes out looking like your main nav, or a plugin's button inherits your theme.json button styles.
Inputs required
- The live rendered DOM of the plugin UI (headless browser or devtools) — not the editor markup, and not an assumption. Portals and dropped classes are only visible at render.
- The plugin's enqueued stylesheet handle and priority (to order/depend your sheet correctly).
- Whether other plugins also filter
render_blockon the same blocks (e.g. a visibility plugin) — this changes how you must inject classes.
Procedure
- Inspect the real DOM first. Open the plugin UI in a browser and read where its markup actually lives. If the panel is a direct child of
<body>, it's a portal — see step 2. Note the plugin's own class hooks. - Scope portal UI to the portal root, not the block. A body-level portal is not a descendant of the block wrapper, so
.<block> .<x>never matches. Scope to the portal's own root class. Seereferences/body-portals.md. - If your
is-style-*class is missing, re-inject it safely. Plugin render callbacks that skipget_block_wrapper_attributes()drop the class. Re-attach it with arender_blockfilter usingWP_HTML_Tag_Processor::add_class()— notstr_replace(which silently fails when another plugin also rewrote the class attr). Seereferences/class-injection.md. - Override
!importantsurgically. Depend your sheet on the plugin's handle so it loads after, then use matched specificity /!importantonly on the exact declarations the plugin forces — and put each rule on the element the plugin actually targets. Seereferences/override-and-bleed.md. - Contain style bleed both ways. Set nested core blocks to opt out (e.g.
overlayMenu:"never"), and write your block-style selectors as direct-child combinators so they can't descend into nested plugin/core blocks. Seereferences/override-and-bleed.md.
Verification
- Verify in the live rendered DOM, driving the actual interaction (open the drawer, focus the search field to spawn the results portal, add a product). Editor markup and CLI renders won't show portals.
- Test the conflict cases: a block that also has a visibility rule (does your class survive?), and the plugin's
!importantrules (does your override actually win, or just tie?). - Re-check after plugin updates — class names and markup are the plugin's, not yours, and can change.
Failure modes
- CSS scoped to the block does nothing → the UI is a body-level portal; scope to the portal root. →
references/body-portals.md is-style-*class silently absent → render callback dropped it; re-inject viarender_block+WP_HTML_Tag_Processor. →references/class-injection.md- Class injection works on most blocks but fails on one → another
render_blockfilter (e.g. a visibility plugin) rewrote the attr and yourstr_replaceno longer matches; useadd_class. →references/class-injection.md - Your styles load after the plugin's but still lose →
!important-heavy plugin CSS; override with matched specificity/!importanton the right element. A* { … }plugin rule hits children, not the parent — put parent "shape" on the parent. →references/override-and-bleed.md - Nested nav/button looks like your theme's → style bleed; opt the nested block out and scope your selectors to direct children. →
references/override-and-bleed.md
Escalation
- If a plugin UI can only be repositioned by moving a DOM node across a boundary CSS can't cross (e.g. a widget injected inside a form), that needs JS — flag it rather than forcing fragile CSS.
- If overriding a plugin requires
!importantsprawl, stop and reconsider whether a targeted enqueue-order/dependency or a single high-specificity scope is cleaner. - Prefer not to fork/patch the plugin; keep all styling in the theme's own enqueued assets +
render_blockfilters so plugin update
Установить wp-thirdparty-markup-styling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл wp-thirdparty-markup-styling?
Style WordPress/WooCommerce markup you don't control — plugin blocks, body-level portals, and render callbacks that drop your classes — from a block theme. Use when a plugin's UI (mini-cart drawer, search-results dropdown, BNPL widget, etc.) won't take your CSS: it renders as a body-level portal outside the block wrapper, strips the is-style-* class you set, ships !important-heavy stylesheets, or its styles bleed into (or leak out of) nested core blocks. Covers portal scoping, safe class re-injection, surgical specificity overrides, and defensive selector scoping.
Как установить скилл wp-thirdparty-markup-styling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл wp-thirdparty-markup-styling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic