Skip to content
Menu

SW10006: Unavailable style.forward()

style.forward() is used through an entrypoint that does not provide it.

On this page

This error occurs when the code calls style.forward() through the Lit, Alpine, or vanilla entrypoint. These entrypoints have no component props to forward, so they do not provide style.forward().

Reported

import { style } from "stillwind/vanilla";

export const props = (attributes: { class?: string }) => style("p-4", style.forward(attributes));

SW10006: style.forward() is not available from `stillwind/vanilla`

Fixed

import { style } from "stillwind/vanilla";

export const props = (attributes: { class?: string }) => style("p-4", { class: attributes.class });

How to fix

  • Pass the received classes in a class field, as in { class: attributes.class }. A class field passes classes only. To set inline style values, use custom properties such as { "--size": value }.

Type to search the documentation.