Cool. Moving on, moving on. Before we move on to this finding purpose slide, I want to quickly show you like how you can look at the shadow DOM. Looking into the shadows is kind of the one of, one of the very important thing.
So as you can see here, I have a very three generic HTML elements. One is a text area, another is file, file choose another is a dropdown and one, I have a very interesting button that is a custom button that I've created.
So I will just create a, I'll just go here. I'll go, go in the settings, you can see the settings tab. I'll click on here and you can see that here, when I go in this elements thing in the preference site, you can see that show user agent shadow DOM. If I click on this check mark this, and if I close this, if I go here and if I select this thing, you can see here that I something appears here. Like you can see that this, it is, it is something called a shadow root.
And in that shadow root, you can see that a pseudo, a pseudo selectors where we can change the color of this text like this text is in shadow DOM. And you can simply like, like, like I can simply do C-U-L-O-R color blue. You can see that the placeholder of the color, the color of the placeholder changes to blue, uh, which is something residing into the shadow DOM. Uh, but, but you cannot really change the display of this because, because it is given an important. Yes, while I open into the browser you can do it, but from the code point of view you cannot, but if something is given important into the shadow DOM, it is important. I mean, I mean that is something you cannot change it.
So it also gives a very interesting way to log few of you wanted. Uh, if you want some behaviors to it. Cool. In the same manner, if you, if you look at this element like title, uh, in the same manner, like if I, if I click here, if I go here in the, in the shadow DOM, you can see that there is a button, there is a shadow road, which, which, which gives the button of this choose file return. And you can be, we can also change the text if we want. So moving on, same goes for the select. But here's one of the interesting thing here is my button. You can see that here. I've created HTML element called this my button. And here I have given a slot. I've given a slot called as title. So how I have defined this, what I've given a span element inside the my button, inside the my button. If I click on the my button, you can see in the my button, I've written a span with slot title, and I have given a element that does title.
Comments