Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Mar 11, 2024
1 parent ac29d40 commit fa665e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/tailwindcss/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Variants } from './variants'
export function compileCandidates(
rawCandidates: Iterable<string>,
designSystem: DesignSystem,
{ onInvalidCanidate }: { onInvalidCanidate?: (candidate: string) => void } = {},
{ onInvalidCandidate }: { onInvalidCandidate?: (candidate: string) => void } = {},
) {
let nodeSorting = new Map<
AstNode,
Expand All @@ -21,7 +21,7 @@ export function compileCandidates(
for (let rawCandidate of rawCandidates) {
let candidate = designSystem.parseCandidate(rawCandidate)
if (candidate === null) {
onInvalidCanidate?.(rawCandidate)
onInvalidCandidate?.(rawCandidate)
continue // Bail, invalid candidate
}
candidates.set(candidate, rawCandidate)
Expand All @@ -36,7 +36,7 @@ export function compileCandidates(
next: for (let [candidate, rawCandidate] of candidates) {
let astNode = designSystem.compileAstNodes(rawCandidate)
if (astNode === null) {
onInvalidCanidate?.(rawCandidate)
onInvalidCandidate?.(rawCandidate)
continue next
}

Expand Down
6 changes: 3 additions & 3 deletions packages/tailwindcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function compile(css: string): {

// Track all invalid candidates
let invalidCandidates = new Set<string>()
function onInvalidCanidate(candidate: string) {
function onInvalidCandidate(candidate: string) {
invalidCandidates.add(candidate)
}

Expand Down Expand Up @@ -133,7 +133,7 @@ export function compile(css: string): {
{
// Parse the candidates to an AST that we can replace the `@apply` rule with.
let candidateAst = compileCandidates(candidates, designSystem, {
onInvalidCanidate: (candidate) => {
onInvalidCandidate: (candidate) => {
throw new Error(`Cannot apply unknown utility class: ${candidate}`)
},
}).astNodes
Expand Down Expand Up @@ -203,7 +203,7 @@ export function compile(css: string): {

if (tailwindUtilitiesNode) {
let newNodes = compileCandidates(allValidCandidates, designSystem, {
onInvalidCanidate,
onInvalidCandidate,
}).astNodes

// If no new ast nodes were generated, then we can return the original
Expand Down

0 comments on commit fa665e0

Please sign in to comment.