-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwind runs out of memory in v3.2.3+ with duplicate selectors in a layer #10355
Comments
Hey! We can probably fix this either way but can you share an example of something you’d actually want to do in a real project that looks like this? |
Hi Adam, thanks for replying so quickly. That snippet is an example of something we actually use in a project, I just made it as small as possible for a reproducable example. a:link, a:visited
{
color: #3384B9;
text-decoration: none;
}
a:hover
{
color: #27668F;
text-decoration: underline;
} and then, to override their specificity, as recommended in these CSS Guidelines, we chain classes together with themselves so their specificity is increased without introducing location dependency (there are other examples than just these 2): .ftb-btn.ftb-btn {
color: #fff;
text-decoration: none;
cursor: pointer;
}
.underline.underline {
text-decoration-line: underline;
} We put the If you would like to see our HTML: <div>
<textarea
ref="textarea"
v-model="templateContentDisplayWrapper"
:class="{
invalid: isContentEmpty
}"
:maxlength="maximumCharacters"
class="w-full p-3 textarea"
placeholder="Enter a message here"
required
>
</textarea>
<div class="flex justify-end">
<button
class="ftb-btn ftb-btn--flat border-0 text-base text-blue-dark cursor-pointer hover:underline"
type="button"
@click="templateContent = ''"
>
Clear
</button>
</div>
<slot name="slotBelowTextarea"></slot>
</div> and our CSS @charset "utf-8";
@layer utilities {
/*------------------------------------*\
#TAILWIND-OVERRIDES
we want to override our too-specific rules like a:hover {text-decoration: underline;} - these are the same as
Tailwind's utilities, just more specific
\*------------------------------------*/
.underline.underline {
text-decoration-line: underline;
}
.overline.overline {
text-decoration-line: overline;
}
.line-through.line-through {
text-decoration-line: line-through;
}
.no-underline.no-underline {
text-decoration-line: none;
}
} |
Hey! I've merged the fix for this in #10397. It'll be available in our next release but you can also test it using our insiders build: |
Thanks for fixing it so quickly! |
What version of Tailwind CSS are you using?
v3.2.3
What build tool are you using?
Gulp v2.3.0, postcss v8.4.21
What version of Node.js are you using?
v14.21.2
What browser are you using?
N/A
What operating system are you using?
Linux
Reproduction URL
https://play.tailwindcss.com/brgSOna4ng
Describe your issue
Tailwind runs out of memory and crashes when I put this in one of my CSS files (I duplicate selectors to increase their specificity):
then put
<div class="hover:underline"></div>
in a HTML file,.This is what Gulp reports:
I think it is because of #9765, specifically this line - if I change line
#72
in my node_modules to be} else if (a.type === 'class' && b.type === 'pseudo' && b.value !== ':merge') {
again, Tailwind doesn't crash.The text was updated successfully, but these errors were encountered: