src/docs/list-style-image.mdx
import { ApiTable } from "@/components/api-table.tsx"; import { Example } from "@/components/example.tsx"; import { Figure } from "@/components/figure.tsx"; import { ResponsiveDesign } from "@/components/content.tsx";
export const title = "list-style-image"; export const description = "Utilities for controlling the marker images for list items.";
<ApiTable rows={[ ["list-image-[<value>]", "list-style-image: <value>;"], ["list-image-(<custom-property>)", "list-style-image: var(<custom-property>);"], ["list-image-none", "list-style-image: none;"], ]} />
Use the list-image-[<value>] syntax to control the marker image for list items:
<!-- [!code classes:list-image-[url(/img/checkmark.png)]] -->
<ul class="list-image-[url(/img/checkmark.png)]">
<li>5 cups chopped Porcini mushrooms</li>
<!-- ... -->
</ul>
Use the <code>list-image-{'(<custom-property>)'}</code> syntax to control the marker image for list items using a CSS variable:
<!-- [!code classes:list-image-(--my-list-image)] -->
<ul class="list-image-(--my-list-image)">
<!-- ... -->
</ul>
This is just a shorthand for <code>list-image-{'[var(<custom-property>)]'}</code> that adds the var() function for you automatically.
Use the list-image-none utility to remove an existing marker image from list items:
<!-- [!code classes:list-image-none] -->
<ul class="list-image-none">
<!-- ... -->
</ul>
<ResponsiveDesign property="list-style-image" defaultClass="list-image-none" featuredClass="list-image-[url(/img/checkmark.png)]" element="ul" />