css
css copied to clipboard
hide do not create element
Description
The hide
isn't adding the class display: none;
on ::before
, instead the content won't be generated at all with class hide
.
This makes me to unable to use JavaScript to select the element::before
. My use case is to remove the hide
after the button is clicked but now the element::before
isn't generated so this is impossible,
Reproduction
No response
System Informations
Browser: Firefox Developer
@karchung0930 Can you provide a https://stackblitz.com/ example to reproduce the problem? Not very clear about your question.
@1Aron Hi, thanks for responding. You can copy the code and inspect it with the developer tool🙏
With the below code, the expected result should be that the display: none;
is set to the div::after
, but the ::after
won't be generated/gone as you will see when you inspect it.
<div class="content:'%'::after hide::after"></div>
Expected result:
div::after { display: none; }
But as you inspect:
the structure would be only <div></div>
instead of <div>::after</div>
, this is what I mean: not generated/gone
I have tried another similar class like invisible
, which works.
The ::after
is still there and the visibility: hidden;
is applied.
<div class="content:'%'::after invisible::after"></div>
@karchung0930 hide::after
will of course hide the after pseudo-element inside <div>::after</div>
.