render() — tailwindcss Function Reference
Architecture documentation for the render() function in ui.spec.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 03cdd11e_2ae7_a373_7130_c6663e810fd9["render()"] 38bfe51e_e2b6_fcde_5ec2_9e78b758e748["compile()"] 03cdd11e_2ae7_a373_7130_c6663e810fd9 -->|calls| 38bfe51e_e2b6_fcde_5ec2_9e78b758e748 ca298ed8_b5fc_603c_b217_9d1765544d10["optimize()"] 03cdd11e_2ae7_a373_7130_c6663e810fd9 -->|calls| ca298ed8_b5fc_603c_b217_9d1765544d10 c4bc6d51_425a_4240_4e44_1f5bc3ab4ac3["getPropertyValue()"] 03cdd11e_2ae7_a373_7130_c6663e810fd9 -->|calls| c4bc6d51_425a_4240_4e44_1f5bc3ab4ac3 03b8d706_a876_a776_0056_186ced5d6067["segment()"] 03cdd11e_2ae7_a373_7130_c6663e810fd9 -->|calls| 03b8d706_a876_a776_0056_186ced5d6067 style 03cdd11e_2ae7_a373_7130_c6663e810fd9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/tests/ui.spec.ts lines 2185–2245
async function render(page: Page, content: string, extraCss: string = '') {
let { build } = await compile(css`
@layer theme, base, components, utilities;
@layer theme {
${defaultTheme}
@theme {
--color-red: rgb(255, 0, 0);
--color-green: rgb(0, 255, 0);
--color-blue: rgb(0, 0, 255);
--color-black: black;
--color-transparent: transparent;
}
}
@layer base {
${preflight}
}
@layer utilities {
@tailwind utilities;
}
${extraCss}
`)
// We noticed that some of the tests depending on the `hover:` variant were
// flaky. After some investigation, we found that injected elements had the
// `:hover` state without us explicitly hovering over the element.
//
// To avoid this, we now set up an explicit placeholder element to move the
// mouse to before running the tests.
content = `<div id="mouse-park" class="size-12"></div>${content}`
let scanner = new Scanner({})
let candidates = scanner.scanFiles([{ content, extension: 'html' }])
let { code: styles } = optimize(build(candidates))
content = `<style type="text/css">${styles}</style>${content}`
await page.setContent(content)
await page.locator('#mouse-park').hover()
return {
getPropertyValue(selector: string | [string, string], property: string) {
return getPropertyValue(
page,
Array.isArray(selector) ? selector : [selector, undefined],
property,
)
},
async getPropertyList(selector: string | [string, string], property: string) {
let value = await getPropertyValue(
page,
Array.isArray(selector) ? selector : [selector, undefined],
property,
)
return segment(value, ',').map((item) => item.trim())
},
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does render() do?
render() is a function in the tailwindcss codebase.
What does render() call?
render() calls 4 function(s): compile, getPropertyValue, optimize, segment.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free