Adds default styles for [popover]#17945
Adds default styles for [popover]#17945brandonmcconnell wants to merge 1 commit intotailwindlabs:mainfrom
[popover]#17945Conversation
|
@brandonmcconnell Hey! Thanks for the PR but I do think we should handle For colors and background colors, So I wonder if the move here is to also mention that |
|
So the browser default styling actually breaks the styling (specifically inset) for non-dialog popovers. Even if you were to change just the inset, I think that would be a huge improvement. Una Kravets has been fighting for this specifically: Something like this: [popover]:not(dialog) {
inset: auto;
} |
This PR addresses existing preflight styles that break the default positioning of popover elements, as well as add some sensible default colors to override those set by the UA by default
margin: autoto maintain the expected centering for popovers.color: inheritfor more predictable text styles.background-color: transparentfor easier customization.The browser's defaults for these colors are
canvastextandcanvascolor, respectively, which is another option (to allow the UA styles to take precedence), but I think the inherit/transparent styles are more customizable by default, similar to how borders are removed from form controls when Tailwind CSS appliesappearance: noneto form controls, by default.Minimal repro: https://play.tailwindcss.com/jjyvteYH0n