Janky at-rule catches FillDeclaration in an infinite loop
I pointed this at a tailwind css file with a @apply rule and the ParseStylesheet gets caught in an infinite loop in StylesheetComposer at FillDeclarations trying to handle the AtKeyword.
Quick little reproduction.
var parser = new StylesheetParser();
var r = parser.Parse(@"
.test {
@apply ml-2;
}
");
As an aside, it would be pretty slick if things like this weren't ignored but included in the results.
Thanks for posting this. While the engine shouldn't land in an endless loop, I'm not sure what to do with the rule since it's not part of the CSS2/3 standard. The @apply tag proposal was abandoned in favor of shadow parts. However some CSS pre-processors make use of it.
The rules currently supported are those listed in the At-rule specs https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule
So the question is whether a malformed rule is something to code for. While this is fine for Tailwind, I don't know if it makes sense to try to add specific At rules as children of properties. Perhaps a generic catch-all rule would suffice - I'll have to think through this one.
Yeah, I agree that not a ton of effort should be spent on non-standard things like this. It being discarded wouldn't be an unexpected behavior to me
similar bugs https://github.com/TylerBrinks/ExCSS/issues/138