Cool Post!
While I do like the Idea of having a native Dialog element, It doesn't always turns to be that good, think of the select element for example, it is always a mess to style one in a good way across browsers, that you end up using a third party library that renders a consistent select element, even the MDN Docs say so:
The <select> element is considered impossible to style consistently cross-platform. However, some styles are workable.
I think this is one of the reasons the dialog element hasn't been rushed to implement.
That being said, it is nice to know it could be an alternative in the future.
I think that the issue of styling has been taken into consideration in the design of the dialog element. It is very easy to override the default styles and it even provides a pseudo-element (::backdrop) for customizing the background.
So in the end, it is as easy as styling a div tag, but with the added accessibility benefit.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Cool Post!
While I do like the Idea of having a
nativeDialog element, It doesn't always turns to be that good, think of theselectelement for example, it is always a mess to style one in a good way across browsers, that you end up using a third party library that renders a consistentselectelement, even the MDN Docs say so:I think this is one of the reasons the
dialogelement hasn't been rushed to implement.That being said, it is nice to know it could be an alternative in the future.
Thanks for your comment 😃
I think that the issue of styling has been taken into consideration in the design of the dialog element. It is very easy to override the default styles and it even provides a pseudo-element (::backdrop) for customizing the background.
So in the end, it is as easy as styling a div tag, but with the added accessibility benefit.