Skip to content

Commit

Permalink
ensure that both group and peer can't be used in @apply
Browse files Browse the repository at this point in the history
This was only configured for `group`
  • Loading branch information
RobinMalfait committed Feb 10, 2022
1 parent ba80553 commit 5807529
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/expandApplyAtRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ function processApply(root, context) {

for (let applyCandidate of applyCandidates) {
if (!applyClassCache.has(applyCandidate)) {
if (applyCandidate === prefix(context, 'group')) {
if ([prefix(context, 'group'), prefix(context, 'peer')].includes(applyCandidate)) {
// TODO: Link to specific documentation page with error code.
throw apply.error(`@apply should not be used with the '${applyCandidate}' utility`)
}

throw apply.error(
`The \`${applyCandidate}\` class does not exist. If \`${applyCandidate}\` is a custom class, make sure it is defined within a \`@layer\` directive.`
)
Expand Down

0 comments on commit 5807529

Please sign in to comment.