ui icon indicating copy to clipboard operation
ui copied to clipboard

Unexpected :empty selector

Open ExileofAranei opened this issue 1 year ago • 4 comments

Describe the bug

Hi, 5.0.34 introduced this style:

.fancybox__container *:empty {
  display: block;
}

Is this required style? Because by default it has higher specifity than base classes, display: block; is not always wanted for each element with no children. :empty ignores pseudo elements, what kinda broke my UI in popup. Maybe there are a way more unexpected side effects with this rule

image image image image

Reproduction

A minimal example for issue with pseudo elements: https://jsfiddle.net/exileofaranei/1Lg9ednh/35/

Additional context

No response

ExileofAranei avatar Mar 15 '24 10:03 ExileofAranei

It's so typical. This snippet was added to make Fancybox compatible with Shopify so that it works without writing any additional code. But you call this "a bug".

fancyapps avatar Mar 15 '24 10:03 fancyapps

But with this style library enforces me to write some extra code, patch updates should not bring that

ExileofAranei avatar Mar 15 '24 10:03 ExileofAranei

Yes I see. I'll adjust the selector so it doesn't affect the content. Sorry for the trouble.

fancyapps avatar Mar 15 '24 16:03 fancyapps

Sorry, my first demo was too poor. There is a better one: https://jsfiddle.net/exileofaranei/zo3vhcbj/1/

ExileofAranei avatar Mar 15 '24 16:03 ExileofAranei

Just found this too :) It breaks font awesome icons (webfont based) where it's an empty <i> with a ::before to set the character representing the icon in the font.

brendon avatar Apr 08 '24 02:04 brendon

It should be fixed in the latest release, sorry for the inconvenience.

fancyapps avatar Apr 10 '24 15:04 fancyapps