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

Function color

packages/tailwindcss/src/utilities.ts:3360–3398  ·  packages/tailwindcss/src/utilities.ts::color
(value)

Source from the content-addressed store, hash-verified

3358 function maskEdgeUtility(name: string, stop: MaskStop, edges: Record<MaskEdge, boolean>) {
3359 maskStopUtility(name, {
3360 color(value) {
3361 let nodes: AstNode[] = [
3362 class="cm">// Common @property declarations
3363 maskPropertiesGradient(),
3364 maskPropertiesEdge(),
3365
3366 class="cm">// Common properties to all edge utilities
3367 decl(class="st">'mask-image', class="st">'var(--tw-mask-linear), var(--tw-mask-radial), var(--tw-mask-conic)'),
3368 decl(class="st">'mask-composite', class="st">'intersect'),
3369 decl(
3370 class="st">'--tw-mask-linear',
3371 class="st">'var(--tw-mask-left), var(--tw-mask-right), var(--tw-mask-bottom), var(--tw-mask-top)',
3372 ),
3373 ]
3374
3375 for (let edge of [class="st">'top', class="st">'right', class="st">'bottom', class="st">'left'] as const) {
3376 if (!edges[edge]) continue
3377
3378 nodes.push(
3379 decl(
3380 `--tw-mask-${edge}`,
3381 `linear-gradient(to ${edge}, var(--tw-mask-${edge}-from-color) var(--tw-mask-${edge}-from-position), var(--tw-mask-${edge}-to-color) var(--tw-mask-${edge}-to-position))`,
3382 ),
3383 )
3384
3385 nodes.push(
3386 atRoot([
3387 property(`--tw-mask-${edge}-from-position`, class="st">'0%'),
3388 property(`--tw-mask-${edge}-to-position`, class="st">'100%'),
3389 property(`--tw-mask-${edge}-from-color`, class="st">'black'),
3390 property(`--tw-mask-${edge}-to-color`, class="st">'transparent'),
3391 ]),
3392 )
3393
3394 nodes.push(decl(`--tw-mask-${edge}-${stop}-color`, value))
3395 }
3396
3397 return nodes
3398 },
3399 position(value) {
3400 let nodes: AstNode[] = [
3401 class="cm">// Common @property declarations

Callers

nothing calls this directly

Calls 5

declFunction · 0.90
atRootFunction · 0.90
maskPropertiesGradientFunction · 0.85
maskPropertiesEdgeFunction · 0.85
propertyFunction · 0.85

Tested by

no test coverage detected