4

I actually acomplished what I wanted to do: hiding some webkit pseudo-elements from the page when I want to print it, the code looks like below.

The problem is that I didnt learn anything from my research to do tha and I couldn't find any documentation about it, and every answer I saw about this topic only shows the code, without any further explanation.

::-webkit-resizer,
::-webkit-calendar-picker-indicator {
    display: none; 
    -webkit-appearance: none;
}

enter image description here

Some sources:

Some similar answers: 6195329, 11418289, 17340038, 15530850, 53483852

Also visited the wikipedia article and this site: https://webkit.org/

I really want to understand the concept behind this webkit things and any help would be appeciated.

To be more specific: if any time in the future I want to override a component, how can I know what pseudo-element has being aplied on an compnonet given the browser?

guilfer
  • 164
  • 1
  • 12
  • 1
    https://www.tjvantoll.com/2013/04/15/list-of-pseudo-elements-to-style-form-controls/ – zer00ne Feb 17 '22 at 23:44
  • @zer00ne On my research I passed by this article, it unfortunately doesnt have all pseudo-elements neither the the way to find them, but it sure is a good article! Thank you! – guilfer Feb 18 '22 at 00:06
  • 1
    https://stackoverflow.com/questions/16382108/hide-form-controls-when-printing-an-html-page-with-css – adampweb Feb 23 '22 at 18:33

2 Answers2

1

The best way to know which pseudo-elements you can work with is by reading specifications (like W3C standards) and realiable docs and resources (like MDN). If you can't find a particular pseudo-element there (or if it's only referred with a vendor prefix), you should probably avoid using it.

It seems ::-webkit-calendar-picker-indicator is supported by Blink and WebKit (follow the links for little pieces of information), but since it's poorly documented and also non-standard I would refrain from adopting it at all.

Felipe Saldanha
  • 1,087
  • 8
  • 17
1

There is no specific documentation for pseudo-elements, but I finally could find, while tinkering on the Chrome Dev Tools' preferences a setting that shows the "Shadow-Dom" from the user-agent.

Go to "Preferences" and scroll to the "Elements" section, where there is a oprtion for that:

shadow-dom option for google chrome

guilfer
  • 164
  • 1
  • 12