thincms_patch_css
Patch a named section of a stylesheet by inserting CSS between comment markers. Use dryRun to preview size delta before committing.
Instructions
Replace a named section of the stylesheet between comment markers. The stylesheet must contain /* START: / and / END: */ markers. Only the content between these markers is replaced.
IMPORTANT — what to send: pass ONLY the body to insert between the markers, not a full stylesheet. If your input contains its own START: and END: markers matching the same section name, the API will auto-extract the body for you. If it contains markers for a DIFFERENT section, the call is rejected to prevent silent doubling. Use dryRun=true on large patches to verify the size delta before committing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | Replacement CSS for the section. Send only the body content (not a full stylesheet). | |
| dryRun | No | When true, return the size delta the change would produce without writing. Strongly recommended before any large patch. | |
| siteId | No | Override the active site for this single call. Pass to target a specific tenant without mutating shared active-site state — the right pattern when running concurrent agent sessions managing different tenants. Must match a siteId from your THINCMS_SITES config (use thincms_list_sites to inspect). When omitted, the call uses the active site set by thincms_switch_site. | |
| cssFile | No | Local file path containing replacement CSS. The file may contain matching START:/END: markers for the named section — if present, the body between them is auto-extracted. If the file contains markers for a different section, the call is rejected. | |
| section | Yes | Section name matching comment markers in the stylesheet (e.g., 'hero' matches /* START:hero */ ... /* END:hero */) | |
| confirmProductionWrite | No | Acknowledge that this call may write to a configured production site (THINCMS_PRODUCTION_SITE_IDS env var). Required for any POST/PUT/PATCH/DELETE against a production-listed site; ignored otherwise. The error message lists which site triggered the requirement and recommends thincms_snapshot before any production write. |