css icon indicating copy to clipboard operation
css copied to clipboard

hide do not create element

Open karchung0930 opened this issue 2 years ago • 2 comments

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 avatar Jul 16 '22 13:07 karchung0930

@karchung0930 Can you provide a https://stackblitz.com/ example to reproduce the problem? Not very clear about your question. Screen Shot 2022-07-20 at 9 39 27 PM

1aron avatar Jul 20 '22 13:07 1aron

@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>

ghost avatar Jul 20 '22 15:07 ghost

@karchung0930 hide::after will of course hide the after pseudo-element inside <div>::after</div>.

1aron avatar Aug 13 '22 11:08 1aron