background property for "td.dt-control" and "tr.dt-hasChild td.dt-control" selectors styles

background property for "td.dt-control" and "tr.dt-hasChild td.dt-control" selectors styles

PalFr39PalFr39 Posts: 2Questions: 1Answers: 0

Hello.

Sorry if I do not post this question in the correct section ...

I installed datatables.net and datatables.net-dt (version 1.11.3) locally with NPM.
The files datatables.net-dt/css/jquery.dataTables.css and datatables.net-dt/css/jquery.dataTables.min.css contains full urls to https://www.datatables.net/examples/resources/details_open.png and https://www.datatables.net/examples/resources/details_close.png for the background property of the td.dt-control and tr.dt-hasChild td.dt-control selectors styles.

td.dt-control {
  background: url("https://www.datatables.net/examples/resources/details_open.png") no-repeat center center;
  cursor: pointer;
}

tr.dt-hasChild td.dt-control {
  background: url("https://www.datatables.net/examples/resources/details_close.png") no-repeat center center;
}

These are the only images with full urls (the other background images in these files are with relative urls to ../images/xxx.png) and they are not present in the images folder.

When I use datatables in conjunction with DarkReader (version 4.9.26, also installed locally with NPM), when activating DarkMode, these two images cause CORS errors on every page load, while I do not use the two offending styles in my pages.
The activation code for DarkReader:

DarkReader.setFetchMethod(window.fetch);
DarkReader.enable({
    brightness: 100,
    contrast: 90,
    sepia: 10
});

An example of this error is visible at the url https://pocs.phaln.info/

By manually uploading these images in the images folder and by modifying their urls in the css files to harmonize them with the others, CORS errors disappear.

Would it be possible to integrate them directly into the images folder like the others in the next updates?

Thank you for your answers!

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    That's a very good point and an error on our part. They should actually be CSS styled icons rather than the pngs. I'll get that fixed for DataTables 1.11.4. Thanks for pointing that out!

    Allan

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    I've gone ahead and committed the fix :).

    Allan

  • PalFr39PalFr39 Posts: 2Questions: 1Answers: 0

    Thank you very much!
    Philippe

Sign In or Register to comment.