-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scope tailwind preflight styles #740
base: main
Are you sure you want to change the base?
Conversation
@Bjoern-Rapp this is working for me. I tested in vscode and it doesn't seem to be leaking styles anymore. Would you be able to run |
f1845d6
to
32c1717
Compare
color: #11181c; | ||
color: hsl(var(--nextui-foreground)); | ||
background-color: #fff; | ||
background-color: hsl(var(--nextui-background)); | ||
margin: 0; | ||
line-height: 1.5; | ||
-webkit-text-size-adjust: 100%; | ||
tab-size: 4; | ||
font-family: | ||
ui-sans-serif, | ||
system-ui, | ||
-apple-system, | ||
Segoe UI, | ||
Roboto, | ||
Ubuntu, | ||
Cantarell, | ||
Noto Sans, | ||
sans-serif, | ||
"Apple Color Emoji", | ||
"Segoe UI Emoji", | ||
Segoe UI Symbol, | ||
"Noto Color Emoji"; | ||
font-feature-settings: normal; | ||
font-variation-settings: normal; | ||
-webkit-tap-highlight-color: transparent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bjoern-Rapp it didn't notice this when I reviewed yesterday. Could you explain why this was added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some selectors in the preflight stylesheet targets html, body and :root elements. They become useless when scoped to the div.lonboard wrapper, since there are no html or body elements inside the wrapper. The only alternative then is to copy / duplicate those properties from the resulting stylesheet and apply them directly to the wrapper.
Anywidget loads CSS from the _css attribute to the global scope. A widget most take care not to conflict with any other CSS selectors. The stylesheet from the tailwind preflight, loaded with
@tailwind base
, will conflict with stylesheets from Sphinx themes (#698) or the VScode interactive display (#696).To scope the preflight stylesheet to descendants of a wrapper should fix that.