setStylePieceCompiler (src/style.ts)

tamagui · code/core/web/src/style.ts · typescript · MIT
ui

Core module for creating and resolving style pieces in Tamagui, exposing compiler and resolver APIs.

// Source: https://github.com/tamagui/tamagui.git | License: MIT | Copyright 2020 Nate Wienert
// Provided via justclaw.it.com; keep this notice with the code.
import React from 'react'

import type { StaticShapeStyle, StylePiece, TextStyle, ThemeParsed } from './types'
import { stylePieceSymbol } from './types'
import { warnOnce } from './helpers/warnOnce'

const isProd = process.env.NODE_ENV === 'production'

type StylePieceLayer = 'base' | 'style'
type StylePieceCompiler = (piece: StylePiece, layer: StylePieceLayer) => void
type StylePieceResolver = (
  piece: StylePiece,
  theme: ThemeParsed,
  themeName: string
) => TextStyle

let compileStylePiece: StylePieceCompiler | undefined
let resolveStylePiece: StylePieceResolver | undefined
const uncacheablePieces = new WeakSet<StylePiece>()


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key