CSS, Tailwind & artifacts
Sample documentation (demo only)
This is an incomplete, outdated docs snapshot shipped with the playground — screenshots were removed on purpose.
For the full, current manuals go to voodflow.com/docs.
Voodflow\Voodbuilder\Support\Editor\EditorComponentTailwindCompiler
- File:
Support/Editor/EditorComponentTailwindCompiler.php - Kind:
class - Responsibility: Editor Component Tailwind Compiler.
Methods
public static function isAvailable(): bool- Boolean predicate
isAvailable.
- Boolean predicate
public static function compile(string $html, string $scope = 'component'): ?string- Compile.
public static function scriptPath(): string- Script Path.
protected static function resolveNodeBinary(): ?string- Resolve Node Binary.
protected static function resolveAppRoot(): string- Prefer the host app root when it can resolve Tailwind packages; otherwise use the VoodBuilder package root (package-local installs / Orchestra Testbench).
Voodflow\Voodbuilder\Support\Editor\EditorImportedTailwindCssBuilder
- File:
Support/Editor/EditorImportedTailwindCssBuilder.php - Kind:
class - Responsibility: Editor Imported Tailwind Css Builder.
Methods
public static function build(string $html): string- Build.
public static function buildForPage(string $html): string- Build For Page.
public static function baseStyles(): string- Base Styles.
protected static function ruleForClass(string $class, ?string $scope = self::SCOPE): ?string- Rule For Class.
protected static function declarationForUtility(string $utility, ?string $variant = null): ?string- Declaration For Utility.
protected static function gradientFromDeclaration(string $utility): string- Gradient From Declaration.
protected static function gradientFromDeclarationForColor(string $color): string- Gradient From Declaration For Color.
protected static function gradientToDeclaration(string $utility): string- Gradient To Declaration.
protected static function ringDeclaration(string $utility): ?string- Ring Declaration.
protected static function focusOutlineDeclaration(string $utility): ?string- Focus Outline Declaration.
protected static function aspectDeclaration(string $utility): ?string- Aspect Declaration.
protected static function widthDeclaration(string $utility): ?string- Width Declaration.
protected static function positionDeclaration(string $property, string $utility): ?string- Position Declaration.
protected static function spacingToRem(float $value): string- Spacing To Rem.
protected static function extractBracketValue(string $utility): ?string- Extract Bracket Value.
protected static function scopedSelector(string $class, ?string $variant = null, ?string $scope = self::SCOPE): string- Scoped Selector.
protected static function escapeClassSelector(string $class): string- Escape Class Selector.
Voodflow\Voodbuilder\Support\Editor\EditorImportedTailwindSupport
- File:
Support/Editor/EditorImportedTailwindSupport.php - Kind:
class - Responsibility: Editor Imported Tailwind Support.
Methods
public static function prepareHtml(string $html): string- Prepare Html.
public static function stripSpuriousSvgBakedPaint(string $html): string- Strip Spurious Svg Baked Paint.
protected static function svgPreservesTailwindCurrentColorPaint(DOMElement $svg): bool- Svg Preserves Tailwind Current Color Paint.
protected static function svgShapeHasOnlyAccentOrEmptyFills(DOMElement $svg): bool- Svg Shape Has Only Accent Or Empty Fills.
protected static function svgIsStrokeOnlyCurrentColorIcon(DOMElement $svg): bool- Svg Is Stroke Only Current Color Icon.
protected static function svgHasUsableStroke(DOMElement $svg): bool- Svg Has Usable Stroke.
protected static function svgRootFillIsNone(DOMElement $svg): bool- Svg Root Fill Is None.
protected static function restoreStrokeOnlySvgCurrentColorPaint(DOMElement $svg): void- Performs
restoreStrokeOnlySvgCurrentColorPaintside effects.
- Performs
protected static function isGenericBlackPaint(string $paint): bool- Boolean predicate
isGenericBlackPaint.
- Boolean predicate
protected static function serializeStyleAttribute(array $style): string- Serialize Style Attribute.
public static function bakeSvgPaintInHtml(string $html): string- Bake Svg Paint In Html.
public static function isUsableSvgPaint(string $paint): bool- True when a CSS paint can drive SVG color/stroke (not none / cleared / currentColor).
public static function resolveSvgPaintFromElement(DOMElement $svg): ?string- Resolve Svg Paint From Element.
protected static function applySvgPaintToTree(DOMElement $svg, string $paint): void- Performs
applySvgPaintToTreeside effects.
- Performs
protected static function isPaintableSvgFillValue(string $fill, bool $rootFillIsNone = false): bool- Boolean predicate
isPaintableSvgFillValue.
- Boolean predicate
protected static function isPaintableSvgStrokeValue(string $stroke): bool- Boolean predicate
isPaintableSvgStrokeValue.
- Boolean predicate
protected static function parseStyleAttribute(string $style): array- Parse Style Attribute.
public static function ensureDarkVariantScope(string $html): string- Ensure Dark Variant Scope.
public static function extractClassNames(string $html): array- Extract Class Names.
public static function migrateClassTokens(string $html): string- Migrate Class Tokens.
public static function simplifyCustomElements(string $html): string- Simplify Custom Elements.
public static function ensureEditorLayoutShell(string $html): string- Ensure imported snippets expose the standard section → content shell so the canvas content-width ("resize") toolbar and Layers stay compliant.
protected static function stripMeasureUtilitiesFromSection(DOMElement $section): void- Full-bleed section bands must not carry measure utilities (max-w / mx-auto). Those belong on the content shell so selection/save keep the band edge-to-edge.
protected static function liftSurfaceUtilitiesOntoSection(DOMElement $section, DOMElement $from): void- Move full-bleed surface utilities (bg, padding, overflow, text color, …) from a pasted root onto the editor section so the content shell stays measure-only.
protected static function isEmptyAfterSurfaceLift(DOMElement $element): bool- Boolean predicate
isEmptyAfterSurfaceLift.
- Boolean predicate
protected static function isSectionMeasureUtility(string $token): bool- Boolean predicate
isSectionMeasureUtility.
- Boolean predicate
protected static function isSectionSurfaceUtility(string $token): bool- Boolean predicate
isSectionSurfaceUtility.
- Boolean predicate
protected static function isTextColorUtility(string $bare): bool- Boolean predicate
isTextColorUtility.
- Boolean predicate
protected static function stripUtilityVariants(string $token): string- Strip Utility Variants.
protected static function createEditorSection(DOMDocument $document): DOMElement- Create Editor Section.
protected static function createEditorContentContainer(DOMDocument $document): DOMElement- Create Editor Content Container.
protected static function stampContentShellAttributes(DOMElement $element): void- Performs
stampContentShellAttributesside effects.
- Performs
protected static function isDecorativeSectionChild(DOMElement $element): bool- Full-bleed hero layers (shade / aurora mesh) often use .voodbuilder-editor-container for stacking context — they must not be treated as the content measure shell.
protected static function unstampDecorativeContentShell(DOMElement $element): void- Undo a mistaken content-width stamp on decorative layers (save used to re-apply max-w-[80rem]).
protected static function isEditorSectionElement(DOMElement $element): bool- Boolean predicate
isEditorSectionElement.
- Boolean predicate
protected static function isContentShellElement(DOMElement $element): bool- Boolean predicate
isContentShellElement.
- Boolean predicate
protected static function findDirectContentShellChild(DOMElement $parent): ?DOMElement- Find Direct Content Shell Child.
protected static function ensureContentWrapperOnSection(DOMDocument $document, DOMElement $section): void- Performs
ensureContentWrapperOnSectionside effects.
- Performs
protected static function promotePastedComponentClassToSection(DOMElement $section): void- Performs
promotePastedComponentClassToSectionside effects.
- Performs
protected static function stripPastedComponentClass(DOMElement $element): void- Performs
stripPastedComponentClassside effects.
- Performs
protected static function isTrivialWrapper(DOMElement $element): bool- Boolean predicate
isTrivialWrapper.
- Boolean predicate
protected static function replaceBodyChildren(DOMElement $body, array $children): void- Performs
replaceBodyChildrenside effects.
- Performs
public static function inlineBackgroundImageClasses(string $html): string- Inline Background Image Classes.
public static function parseBackgroundUrlClass(string $class): ?string- Parse Background Url Class.
public static function stripNonStandardAttributes(string $html): string- Strip Non Standard Attributes.
public static function markPastedComponentRoot(string $html): string- Mark Pasted Component Root.
protected static function loadDocument(string $html): DOMDocument- Load Document.
protected static function extractBodyHtml(DOMDocument $document): ?string- Extract Body Html.
protected static function mergeStyleProperty(string $style, string $property, string $value): string- Merge Style Property.
protected static function cssUrl(string $url): string- Css Url.
Voodflow\Voodbuilder\Support\Editor\PageCssArtifactStore
- File:
Support/Editor/PageCssArtifactStore.php - Kind:
class - Responsibility: Persists and resolves compiled page CSS artifacts on the public disk (live + revision slim payloads).
Methods
public static function persistForPage(SitePage $page, string $fullCss, ?string $authorCss = null): array- Writes live CSS artifact for a page; returns payload meta (path, hash, etc.).
public static function slimPayloadForHistory(array $payload, int $pageId, string $suffix): array- Replaces inline CSS in a history payload with a revision artifact reference.
public static function resolveCss(array $payload): string- Resolves CSS string from payload (inline or artifact read).
public static function publicUrl(array $payload): ?string- Public URL for the CSS artifact referenced by payload meta.
public static function metaFromPayload(array $payload): ?array- Extracts CSS artifact metadata from a project payload.
public static function deleteLiveArtifact(SitePage $page): void- Deletes the live CSS file for a page.
public static function deleteArtifactFromPayload(array $payload): void- Deletes the artifact path referenced by a payload.
public static function inlineThresholdBytes(): int- Byte threshold above which CSS is stored as artifact instead of inline.
public static function liveRelativePath(int $pageId): string- Relative disk path for a page live CSS artifact.
public static function revisionRelativePath(int $pageId, string $suffix): string- Relative disk path for a revision CSS artifact suffix.
Voodflow\Voodbuilder\Support\Editor\PageSurfaceCssPublish
- File:
Support/Editor/PageSurfaceCssPublish.php - Kind:
class - Responsibility: Remap Grapes page-surface #id wallpaper rules to a fixed paint layer for public pages.
Methods
public static function remapForPublic(string $css, string $html = ''): string- Remap orphan #id wallpaper rules (and wrapper attribute selectors) to the public page surface fixed layer, then keep chrome shells transparent.
public static function publicWallpaperOverlay(string $css, string $html = ''): string- When the full sheet is linked as an artifact, return only the remapped orphan wallpaper rules so an inline companion style can paint the page.
public static function bodyTarget(): string- Body Target.
public static function darkBodyTarget(): string- Dark Body Target.
public static function fixedLayerSelector(): string- Fixed Layer Selector.
public static function darkFixedLayerSelector(): string- Dark Fixed Layer Selector.
Voodflow\Voodbuilder\Support\Editor\TailwindV4ClassMigrator
- File:
Support/Editor/TailwindV4ClassMigrator.php - Kind:
class - Responsibility: Tailwind V4 Class Migrator.
Methods
public static function migrateHtml(string $html): string- Migrate Html.