DataTables / DataTablesSrc

DataTables source repository
https://datatables.net
MIT License
587 stars 422 forks source link

Replaced outdated IE7 CSS hacks #204

Closed eldang closed 2 years ago

eldang commented 2 years ago

Parcel versions 2.4.0 & 2.4.1 refuse to build if any dependency has invalid CSS. This has created an incompatibility with various other projects including DataTables, and the Parcels maintainer has expressed a strong preference for fixing all the other projects rather than loosening the constraint: https://github.com/parcel-bundler/parcel/issues/7854

Fortunately, in this project the issue seems to be confined to a handful of CSS declarations that use the very nonstandard *propertyname hack for IE7 and older. This PR simply replaces each instance of that hack with the modern, standards-compliant @supports construct. In each instance, the IE-specific rule is first, followed by an @supports block that overrides it for more modern browsers. It's written in this slightly counterintuitive way because IE does not itself support @supports.

I would also be happy with dropping IE<=7 support entirely, or allowing a little degradation in those very old browsers by dropping these specific CSS rules. But I do not feel that that's my decision to make! So this is an attempt to maintain that support while complying with modern CSS standards.

Unfortunately I am not able to test this work in IE as I work on a Mac.

All work in this PR is offered under the MIT License.

AllanJard commented 2 years ago

Yes, good call! With DT1.11 we dropped IE6/7 support, going for 8+ ((our browser support page](https://datatables.net/download/compatibility)).

I need to grab a VM with IE8 and check the cursor: pointer support. MDN says it was supported from IE6 which I don't recall being correct, but goodness me it was a while back now! If we don't need the @supports checks, that would be good.

eldang commented 2 years ago

In case this comes up for anyone else: one of the Parcel maintainers suggested some workarounds at https://github.com/parcel-bundler/parcel/issues/7854#issuecomment-1116745050

I just tried https://github.com/ds300/patch-package and it was easy to apply and solved the problem for me.

AllanJard commented 2 years ago

I think that is all the IE6/7 CSS hacks removed now, which I did as part of a recent reorganisation of the CSS. As such I'm going to close this PR. The fixes will be included in DataTables 1.12 :)

eldang commented 2 years ago

Thank you!