MCPcopy
hub / github.com/tailwindlabs/tailwindcss / parseValue

Function parseValue

packages/tailwindcss/src/compat/plugin-api.test.ts:2719–2724  ·  packages/tailwindcss/src/compat/plugin-api.test.ts::parseValue
(value: string)

Source from the content-addressed store, hash-verified

2717 module: ({ matchVariant }: PluginAPI) => {
2718 matchVariant(class="st">'my-container', (value, { modifier }) => {
2719 function parseValue(value: string) {
2720 const numericValue = value.match(/^(\d+\.\d+|\d+|\.\d+)\D+/)?.[1] ?? null
2721 if (numericValue === null) return null
2722
2723 return parseFloat(value)
2724 }
2725
2726 const parsed = parseValue(value)
2727 return parsed !== null ? `@container ${modifier ?? class="st">''} (min-width: ${value})` : []

Callers 1

plugin-api.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected