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

Function substituteAtSlot

packages/tailwindcss/src/variants.ts:1244–1257  ·  view source on GitHub ↗
(ast: AstNode[], nodes: AstNode[])

Source from the content-addressed store, hash-verified

1242}
1243
1244export function substituteAtSlot(ast: AstNode[], nodes: AstNode[]) {
1245 walk(ast, (node) => {
1246 // Replace `@slot` with rule nodes
1247 if (node.kind === 'at-rule' && node.name === '@slot') {
1248 return WalkAction.ReplaceSkip(nodes)
1249 }
1250
1251 // Wrap `@keyframes` and `@property` in `AtRoot` nodes
1252 else if (node.kind === 'at-rule' && (node.name === '@keyframes' || node.name === '@property')) {
1253 Object.assign(node, atRoot([atRule(node.name, node.params, node.nodes)]))
1254 return WalkAction.Skip
1255 }
1256 })
1257}
1258
1259export function substituteAtVariant(ast: AstNode[], designSystem: DesignSystem): Features {
1260 let features = Features.None

Callers 2

parseVariantValueFunction · 0.90
fromAstMethod · 0.85

Calls 3

walkFunction · 0.90
atRootFunction · 0.90
atRuleFunction · 0.90

Tested by

no test coverage detected