Skip to content
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

feat: bring back shadowRoot #222

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

LukasHirt
Copy link
Contributor

Summary

Since some of the styles used in the File picker can have an effect on the parent document, it is needed to handle the styles inside of shadowRoot and have them isolated.

One challenge though - vite does not inject styles into the built bundle when library mode is used in the config (open issue here vitejs/vite#1579). This of course brings the problem of including the style inside the shadowRoot. Some plugins exists that can still handle the injection but unfortunately does not work with custom elements as it anyway tries to add the styles into the document instead of shadowRoot. This forces us to append the styles ourselves into the shadowRoot when the custom element is being constructed.

This change does not affect the lib build as the style.css file is still there and can be imported manually in a scoped context.

Theming will be handled via CSS custom properties.

src/style.css Outdated
@@ -1,5 +1,7 @@
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't fetch the font directly from google but embed it here in the repo. Or even better: import it from the design system. we've switched from source sans pro to inter a while ago. At least for web. Would make sense to do the same here and would make the import from ods easy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - I am copying only the css file now as the link into the head is inserted automatically.

@LukasHirt LukasHirt force-pushed the feat/bring-back-shadow-root branch from 92819f4 to c3af85a Compare June 27, 2023 16:21
@LukasHirt LukasHirt force-pushed the feat/bring-back-shadow-root branch from c3af85a to 4690b84 Compare June 27, 2023 16:23
@kulmann kulmann merged commit c39df0d into owncloud:master Jun 28, 2023
@LukasHirt LukasHirt deleted the feat/bring-back-shadow-root branch June 28, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants