-
Notifications
You must be signed in to change notification settings - Fork 168
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
Use application theme for exported web components #8564
Comments
We haven’t actually tested this yet, but we will most likely need better support for this. Our upcoming documentation system uses Flow embedding for Java component examples, and if customers have done theme customizations using global style sheets, then those would not work for the component examples. |
I stumbled over this ticket because I need to embed a vaadin 14 component in a plain HTML page. Is there a way to include css in the shadow dom of the exported web component? |
While the solution to this issue would most likely be adding a new feature/capabilities, the fact that this is not possible (easily) is basically a bug since we didn't consider this properly and have not clearly communicated that this is a known limitation. |
I found a workaround for now. public abstract class StyledWebComponentBase extends Div {
public void addStyle(final String path) {
final Element style = new Element("style");
style.setText(getCss(path));
getElement().appendChild(style);
}
private String getCss(final String path) {
try (final InputStream resourceAsStream = getClass().getResourceAsStream(path)) {
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
final byte[] buffer = new byte[1024];
int len;
while ((len = resourceAsStream.read(buffer)) > 0) {
((OutputStream) outputStream).write(buffer, 0, len);
}
outputStream.flush();
return new String(outputStream.toByteArray(), UTF_8);
} catch (IOException ignored) {
// ignore and set the background to bright red to make it visible that styling failed
return ":host {background-color: red;}";
}
} |
Hi, is there any news for this? In which Vaadin version can the enhancement be expected? |
Actually yes, although with a slightly different solution. We're working on a new theming mechanism (vaadin/platform#1571) that will solve this, amongst other things, which will come to V19 if all goes well. Specifically this part in the AC:
In short:
|
What are the "global" styles in case of the WebComponentExporter? Also if I export multiple web components in a single embedded application. |
Well, assuming you have a Flow component, like And the problem with the exported web component is that now there's suddenly a shadow root around the component, so there's no way for the styles in foobar.css to be applied to the component. So what the new theming system does is to automatically inject foobar.css inside of that shadow root, so that it's actually applied to the component, just as they would be in a Flow app, as long as So, if you have a second component, |
As with the new theming mechanism, the "application theme" will be automatically applied for the exported web components when the The theme should be applied similarly as done in the PoC https://github.com/vaadin/flow/blob/poc/applicationTheme/flow-server/src/main/resources/plugins/application-theme-plugin/theme-generator.js#L134 (without the parent theme feature at this point). Acceptance Criteria
|
Add support for application theme with embedded components. Fixes #8564
Add support for application theme with embedded components. Fixes #8564
* test: Fix duplicate registration (#9233) Lock the registry when registering dynamic route in serviceInit to not have a race where 2 inits note that path is not registered and then try to register the route. Fixes #9223 * refactor: Remove log usage in embedded components (#9254) 8d012f7 removed some log and converted others into debug but log in disconnectedCallback was left. * refactor: expose the items count API to components (#9257) Exposes DataCommunicator::getDataProviderSize to the components, in order to get the items count taking into account the countCallback, if it has been set previously. Related-to: vaadin/flow-components#282 * chore: unit test for devmode-not-ready page contents and type (#9266) * chore: do not depend on commons.lang3 (#9271) * chore: fix typo (#9272) Fix typo in DataCommunicator::getDataProviderSize() javadoc. * fix: Sync HierarchicalDataCommunicator's expand state with client side (#9275) HierarchicalDataCommunicator's expanded state were not being synchronised with client side and TreeGrid's expanded nodes were being collapsed after re-attaching. Warranty: Sync TreeGrid expanded items state with the client side when detaching and reattaching Fixes: #9175 * chore: Bump version to 6.0-SNAPSHOT (#9279) * refactor: make web browser immutable (#9298) * feat: Create Flow plugins for webpack (#9295) * feat: Create Flow plugins for webpack Moved stats file handling to a custom plugin. Added feature for copying custom Flow plugins for use with webpack. Fixes #9283 * fix: AppShellConfigurator is now considered for theme endpoint (#9332) AppShellConfigurator is now also considered when scanning for annotations and deciding theme. Fixes #9110 * fix: fix TreeGrid updating wrong expanded items state on setDataProvider (#9336) Fixes: #9328 Details: HierarchicalDataProvider's reset method was called before recreating the HierrarchyMapper in setDataProvider. This was creating wrong updates for the client side. * feat!: Theme annotation should be only on AppShellConfigurator (#9313) Having the `@Theme` annotation on Flow views or router layouts will not be allowed anymore, it should be on `AppShellConfigurator` instead. Fixes #9092 * test(TypeScript): ensure CSRF token is updated when session is invalidated (#9329) * test(TypeScript): ensure CSRF token is updated when session is invalidated Fixes #9164 * add log message * fix: increase threshold for performance test (#9381) * fix: hide loading indicator when endpoint call fails (#9380) * feat: tree-shakeable ES imports for TS form validators (#9374) - Use tree-shakeable ES imports for TS form validators based on the latest version of validators lib. - Add missing `return` in the `submit()` method * feat: Theme can be defined as string or class (#9349) Add a string definition for theme that matches the "application theme" in the theme folder inside /frontend/theme/, loading the css automatically from there. This is based on Lumo theme, always. Change old class based theme to use themeClass for theme selection. Fixes #9281 * fix!: Use data view filter and sorting only to that component (#9315) In-memory filtering and sorting are now stored directly in component, which gives an opportunity to change it through the data view API for a certain component separately from other components bound to the same data provider. Fixes #8655 * fix: support Range requests with either start or end byte index omitted (#9368) Supports headers of the type Range: -123 and Range: 123-. Fixes #9083. * refactor: revert 'Use data view filter and sorting only to that component' (#9390) Revert the changes for #8655 to be able to bump the version of components and avoid compile errors. * chore: remove test module test-subcontext (#9394) This module is subsumed by test-router-custom-context. * chore: update readme with discord link (#9382) * test: remove Theme annotation from demo helpers module (#9395) * feat: Do not allow themeClass and themeName in same annotation (#9389) Theme Class and Theme Name is not supported in the same Theme annotation as theme name builds on the Lumo theme. test-themes is now for testing the Application theme only. Old theme test was moved into test-misc. Fixes #9370 * fix!: Use data view filter and sorting only to that component (#9315) In-memory filtering and sorting are now stored directly in component, which gives an opportunity to change it through the data view API for a certain component separately from other components bound to the same data provider. Fixes: #8655 * feat: Only use one theme and fail for duplicates (#9406) Now we only handle the theme with the name inside the Theme annotation. Fixes #9383 * Read stats.json content as a bundle resource in OSGi Read token file as a bundle resource in OSGi Fixes #9146 Fix NPE Revert logic back to the previous state # Conflicts: # flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java # flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendUtils.java # flow-server/src/main/java/com/vaadin/flow/server/osgi/OSGiAccess.java * Refactor Instantiator and resources access Fixes #9185 Exclude non-serializable classes Drop dependency to flow-push from flow-server # Conflicts: # flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java # flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java # flow-server/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer # flow-server/src/test/java/com/vaadin/flow/server/connect/generator/endpoints/model/OSGiInstantiatorFactory.java # flow-server/src/test/java/com/vaadin/flow/server/connect/generator/endpoints/model/OSGiResourceProvider.java # flow-server/src/test/java/com/vaadin/flow/server/connect/typeconversion/StringConversionTest.java * Remove flow-osgi dep from flow-push, increase osgi cmpn version # Conflicts: # flow-push/pom.xml # flow-server/src/main/java/com/vaadin/flow/server/osgi/VaadinBundleTracker.java * Correct unit tests after refactoring: make them compiling Mock VaadinServlet in MockVaadinServletService Adapt unit tests for refactored code Adapt more unti tests and add one more new SPI method Fix serializable test, proceed with unit tests adaption Adapt unit tests for classes in com.vaadin.flow.server Adapt unit tests in the com.vaadin.flow.server.communication package * Adapt more unit tests * Make sure that ServletContextInitializers are executed after LookupInitializer Fix OSGi presence check to be able to run unit test Adapt servlet deployer unit tests Exclude OSGi related classes from test Exclude all OSGi impl classes from serializable test # Conflicts: # flow-polymer-template/src/test/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParserTest.java # flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java # flow-server/src/main/java/com/vaadin/flow/server/startup/ApplicationRouteRegistry.java # flow-server/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer # flow-server/src/test/java/com/vaadin/flow/component/InvalidUrlTest.java # flow-server/src/test/java/com/vaadin/flow/component/UITest.java # flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerDependenciesTest.java # flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerTest.java # flow-server/src/test/java/com/vaadin/flow/server/DeploymentConfigurationFactoryTest.java # flow-server/src/test/java/com/vaadin/flow/server/I18NProviderTest.java # flow-server/src/test/java/com/vaadin/flow/server/MockServletServiceSessionSetup.java # flow-server/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java # flow-server/src/test/java/com/vaadin/flow/server/VaadinServiceTest.java # flow-server/src/test/java/com/vaadin/flow/server/VaadinServletConfigurationTest.java # flow-server/src/test/java/com/vaadin/flow/server/VaadinServletServiceTest.java # flow-server/src/test/java/com/vaadin/flow/server/VaadinSessionTest.java # flow-server/src/test/java/com/vaadin/flow/server/communication/PushHandlerTest.java # flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java # flow-server/src/test/java/com/vaadin/flow/server/frontend/FrontendUtilsTest.java # flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTestBase.java # flow-server/src/test/java/com/vaadin/flow/server/startup/EnableOSGiRunner.java # flow-server/src/test/java/com/vaadin/flow/server/startup/ServletDeployerTest.java * Fix OSGi Lookup related issues Fix OSGi related unit test one more time # Conflicts: # flow-osgi/src/main/java/com/vaadin/flow/osgi/support/OSGiResourceProvider.java # flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java # flow-server/src/main/java/com/vaadin/flow/server/osgi/OSGiAccess.java # flow-server/src/main/java/com/vaadin/flow/server/osgi/VaadinBundleTracker.java # flow-server/src/main/java/com/vaadin/flow/server/startup/LookupInitializer.java # flow-server/src/test/java/com/vaadin/flow/server/startup/EnableOSGiRunner.java # flow-server/src/test/java/com/vaadin/flow/server/startup/OSGiInitApplicationRouteRegistryTest.java # flow-server/src/test/java/com/vaadin/flow/server/webcomponent/OSGiWebComponentConfigurationRegistryTest.java # flow-tests/test-root-context/src/main/java/com/vaadin/flow/osgi/Activator.java * Correct the resource access for VaadinService * Extend SPI, provide javadocs some unit tests fixes Minor code corrections, javadocs Correct unit test # Conflicts: # flow-polymer-template/src/test/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParserTest.java # flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java * test: add unit tests # Conflicts: # flow-tests/test-root-context/src/main/java/com/vaadin/flow/osgi/Activator.java * test: make it possible to run felix-jetty in npm mode # Conflicts: # flow-tests/servlet-containers/felix-jetty/pom.xml # flow-tests/test-root-context/pom-npm.xml * Make httpclient dependency optional for now. (#9262) * refactoring: move OSGi resource provider impl to flow-server (#9268) OSGi ResourceProvider impl should be available as a service at the moment when Vaadin WAB register a servlet. It's not possible without extra unclear config to make sure that the service is registered if it's in the flow-osgi : the bundle may be activated at any moment regardless of servlet registration. The issue doesn't appear if the service is registered at the flow-bundle start phase. * refactor: review fixes for OSGi (#9289) * refactoring: review fixes * chore: add a comment about Jar packaging in test-root-context module * fix: ensureServletContext should be always called * fix: fix review comments # Conflicts: # flow-tests/test-root-context/pom-npm.xml * refactor: get rid of cmpn osgi dependency (#9307) Not needed for flow-server. * refactoring: App classpath resources should be access via ResourceProvider (#9278) Fixes #9269 # Conflicts: # flow-polymer-template/src/main/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParser.java # flow-server/src/main/java/com/vaadin/flow/server/BootstrapUtils.java * test: update unit tests * refactor: fix various OSGi related issues * add back lost classes during cherry-picks * fix unit tests * rewrite polymer template RPC * fix: fix javadocs after merge conflicts * fix: fix mocks in unit tests * test: Correct activator * refactor: correct lookup initializer filtering code * fix: fix javadocs (SQ) * refactor: Remove OSGi related ITs and osgi module from the repo * fix: fix some review comments * fix: test unstable test * refactor: get rid of OSGiClientStaticResource (#9277) * fix: use content parameter in the activate method * fix: Make OSGi incompatible vaadin-connect dependencies optional * fix: make Spring deps optional * fix: make a workaround for broken Route registry API * fix: avoid not-breaking exception ojn loading class from another bundle * fix: workaround for possible bug in route registry (like #9360). * [OSGi] - Cleanup BudleActivator and Service registration, Update bnd and osgi deps (#9361) refactor: OSGi improvements * update bnd-version Signed-off-by: Stefan Bischof <[email protected]> * update osgi dependency and version Signed-off-by: Stefan Bischof <[email protected]> * fix mocking osgi-classes Signed-off-by: Stefan Bischof <[email protected]> * OSGiResourceProvider uses @component to declare the service Signed-off-by: Stefan Bischof <[email protected]> * VaadinBundleTracker uses @component to declare the service Signed-off-by: Stefan Bischof <[email protected]> * Remove `empty` BundleActivator Signed-off-by: Stefan Bischof <[email protected]> * use constants for osgi.http.whiteboard.servlet.pattern Signed-off-by: Stefan Bischof <[email protected]> * fix unregister Service PolymerPublishedEventRpcHandler Signed-off-by: Stefan Bischof <[email protected]> * registers PolymerPublishedEventRpcHandler as a declarative service Signed-off-by: Stefan Bischof <[email protected]> * fix: add explanation why OSGi Component annotation is safe to use * fix: code review fixes * fix: return back accidentially removed method and call init for service * fix: remove non-existent class pattern from test * fix: fix import order * fix: extract code to a separate method * fix: correct unit test * fix: fix unit test * refactor: simplify list merging * fix: return back lost code after review * fix: imports order * fix: revert bnd version * fix: imports order, review comments * fix: restore lost test method * fix: import orders * fix: revert not working deployment of test-root-context ui classifier * fix: check if Url contains directory change in Dev Mode (#9392) Checks whether the Url contains a directory change and a double encoding in Dev Mode. Returns 403 Forbidden immediately and skip the request handling, if does. * fix: preserve filter to not lose it between page requests (#9421) Data communicator's filter removal, which has been introduced for components with internal filtering (like a ComboBox), may lead to filter loss during the items scrolling. This fix reverts the filter removal and the components should implement this feature on their side, if necessary. Related-to: vaadin/flow-components#388 * chore: Update issue template with discord link (#9426) * chore: update chrome expectation to 87 (#9445) * fix: revert changes which broke route registration (#9432) Need to active the tracker from an servlet context initializer because @activate doesn't work on CTOR with parameter * chore: fix outdated AppShell javadoc (#9453) * test: add test for setting global font (#9436) Fixes #9409 * fix race-condition in IT-Tests (#9416) Signed-off-by: Stefan Bischof <[email protected]> * fix: mark tests that should not be executed in OSGi (#9456) * fix: mark tests that should not be executed in OSGi * fix: don't use push in route not found error page in OSGi * fix: avoid route with wildcard parameter which doesn't work in OSGi * fix: exclude wildcard parameter IT and devmode IT * fix: exclude "context" resource IT from OSGi tests * fix: make annotation packages optional in OSGi (#9465) Also fix test to first open page before checking client. fixes #9463 * fix: made VaadinRequest available in endpoint (#9442) * fix: made vaadinrequest available in endpoint * clear VaadinRequest instance after endpoint call * chore: remove mentions of “Connect” (#9151) * Rename “Connect” to “Fusion” * Remove “Fusion” naming * feat: Serve theme static files from VAADIN/static (#9451) Static files in META-INF/VAADIN/static will now be served on request to VAADIN/static. Added new webpack loader that changes app theme css urls targeting ./ and ../ to be VAADIN/static/ instead. Where ../ can not go outside of the application theme folder. Fixes #9405 * refactor: Remove OSGi code from flow-server (#9472) * refactor: Remove OSGi code from flow-server Fixes #9219 * chore: update Flow versions description (#9469) * feat: Theme component with app theme. (#9418) Added the feature that you can theme components with the app theme by creating a css file in 'frontend/theme/myTheme/components' with the component tag name e.g. 'my-field' should have 'my-field.css' Fixes #9348 * fix: check whether class implements an interface first directly (#9486) Part of #9480 * fix: remove instance field from singleton IndexHtmlRequestHandler (#9475) * fix: remove instance field from singleton IndexHtmlRequestHandler * apply code review suggestions * Stop logging error when updating dev dependencies (#9476) As there is a conflict with the dependencies and prevent adding the flow-dev-dependencies package to the platform (#9345), this will hide the unavoidable error that was logged for Vaadin apps. Fixes #9251 * fix: optimize handling of requests containing Range header (#9484) More efficient parsing of the header value. Also, range count is capped at 16 (additional will be ignored) and overlapping ranges at 2 (request will be denied if above). * fix: Correct regexp to only match when digit first (#9496) Use Matcher::find instead of Matcher::matches as matches never matched. Fixes #9494 * test: add test that external urls are not touched (#9482) Added test that we don't touch external urls (relative or abosolute). Moved flow to be under path so we can have jetty serve "external" resources. Fixes #9430 * fix: Add polyfill for constructable stylesheets (#9489) Add the constructable stylesheets polyfill so app theme also works with non chrome based browsers. Fixes #9488 * fix: Initialize VaadinServlet after Lookup is available (#9500) fix: don't initialize Vaadin servlet until Lookup is not available * feat: Enable adding assets from node_modules (#9495) * feat: Enable adding assets from node_modules It is now possible to import resources from installed node_modules by adding the asset to theme/my-theme/theme.json Fixes #9468 * Add comment to doc on copyStaticAssets * Fix url expectation after merge * format lines * test: add unit test for clear all in the servlet init method (#9507) * Fix: fix file system traversal of theme-loader to stop at root (#9505) The theme-loader recursion for themeFolder should stop at the root level. Also if no theme folder found we should not spend time on replacement. * fix: enable PlainScriptViaJavaScriptIT in OSGi (#9520) fixes #9461 * fix: enable PushRouteWildcardParameterIT in OSGi (#9518) fixes #9459 * fix: enable BaseHref IT back (#9515) Fixes #9458 * chore: Add information on logging in webpack (#9527) Added information on log levels with webpack loaders and plugins. * test: fix test class and register view servlet with a context in OSGi (#9528) Part of vaadin/osgi#5 * fix: removed `hasClientIssue("8236")` guard as ITs now pass (#9536) * Fix: Update Lit bundle parser regex. (#9546) Now the pattern will not fail with a StackOverflowException as we will search from the start character accepting any characters until we reach the caught start character with ; * fix: Enable lit css importing (#9550) Fixes #9532 * fix: use provided executor for frontend tools (#9553) fixes vaadin/spring#691 * feat: Resource handling to not need plugin copying (#9558) Fixed the url handling so that theme resources get prepended with theme/[themeName] while having the correct absolute path. With this we can handle these url resources with the css-loader which in turn leads to file-loader gettign the files for copying. External url are still not touched in any way. part of #9410 and #9533 * fix: file-loader name for windows execution (#9575) Windows file path separator \ should not be used as it will result in %0B when it should be / * test: Fixed flaky tests caused by variable ui in ValidatorTestBase.java (#9524) Added a ui variable in the ValidatorTestBase class to attach strong reference, in order to avoid garbage collecting it during the test run. * refactor: get Executor service from Lookup instead init params (#9572) fixes #9570 * fix: Add missing refreshAll method to data view Adds the missed refresh all method to data view API. Fixes: #9574 * chore: Update contributing guide with setup info (#9576) The contribution guide was missing the project setup information. There were outdated instructions in the readme, which was on the other hand not up to date and only had instructions for Eclipse. Now everything is in contribution guide and readme is short and simple, pointing to contribution guide for those who want to work with the project. * fix!: Make VaadinService.dependencyFilters unmodifiable While the change is backwards compatible from API perspective, it could be considered a behavior change although there is quite low risk of exposure in apps. Thus targeting 2.5 for the LTS and the recently released 5.0. * fix: encode attribute value during transfer from embedded web app (#9583) encode attribute value during transfer from embedded web app * chore: move fusion endpoint code to fusion-endpoint module (#9499) Fixes: #9354 move fusion code to a separate fusion-endpoint module, so that the fusion dependencies which are not OSGi compatible can be removed from the flow-server module. - move the code in the connect package to fusion-server - removed the non OSGi compatible packages from the bnd file in flow-server - change `TaskGenerateOpenApi` and `TaskGenerateConnect` to interfaces in flow-server, have the implementations in fusion-endpoint since they are using code inside the connect package - Move endpoint related tests: - from NodeTasksTest to NodeTasksEndpointTest, - from DevModeInitializerTest to DevModeInitializerEndpointTest - Add a `LookupImpl` class in the `flow-maven-plugin` module for finding endpoint services. - Introduce a `isInstantiableService`method in `ReflectTools` * feat: Embedded component appTheme support (#9588) Add support for application theme with embedded components. Fixes #8564 * feat: Enable importing CSS from node_modules (#9543) Enable using CSS files from installed node_modules by adding 'importCss' to theme/my-theme/theme.json. Fixes #9410 * refactor: simplify ResourceProvider (#9609) fixes #9605 * chore: add internal classes to access classloader and init context (#9618) * chore: add internal classes to access classloader and init context related to #9601 : needed to restore OSGi resource provider * fix: loading indicator visible and isActive true while endpoint fetch (#9593) * fix: loading indicator visible and isActive true while endpoint fetch * Clarified code and added test * fix: theme files can now be referenced as theme/theme-name (#9590) Theme files are now copied under theme/[theme-name] and can be referenced by theme/them-name/path/file.ff even though they are located at VAADIN/static Fixes: #9405 and #9535 * Fix: Generated theme.js is now named theme.generated.js (#9616) my-theme.js is now generated as my-theme.generated.js Fixes #9595 * Feat: Check that npm resources are available (#9617) Check that we have named npm resources available or throw an exception informing the user to install it using a NpmPackage annotation or manually with (p)npm i Fixes #9615 * refactor: rename the app-theme root folder from theme to themes (#9626) Fixes #9611 * refactor: refine renaming and incorrect paths in ThemeIT (#9634) * rename app-theme root folder to themes * chore: fix flaky tests that depends on mock count (#9631) * chore: create deepClean profile (#9311) Using the deepClean profile one can clean up all the generated files and node_modules folders from all test modules. * test: add document.css level styles tests (#9646) Adds a tests for checking that the document.css file is injected to the document scope and not injected to embedded element shadow root. Fixes #9552 * refactor: extract common config functionality and introduce add config (#9635) refactor: extract common config functionality and introduce add config part of #9417 Co-authored-by: caalador <[email protected]> Co-authored-by: Guille <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Johannes Eriksson <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]> Co-authored-by: Denis <[email protected]> Co-authored-by: Artem Godin <[email protected]> Co-authored-by: Anton Platonov <[email protected]> Co-authored-by: Haijian Wang <[email protected]> Co-authored-by: Pekka Hyvönen <[email protected]> Co-authored-by: Manuel Carrasco Moñino <[email protected]> Co-authored-by: Stefan Bischof <[email protected]> Co-authored-by: Jouni Koivuviita <[email protected]> Co-authored-by: Jialin Shao <[email protected]> Co-authored-by: Tan Bui <[email protected]>
Add support for application theme with embedded components. Fixes #8564
Add support for application theme with embedded components. Fixes #8564
Add support for application theme with embedded components. Fixes #8564
See the original issue :#8543.
The current behavior is by design but I don't even know how to style the embedded component since it's inside shadow root of the generated wrapper.
I've made already a ticket in the docs about styling of embedded components.
May be we should provide API for
WebComponentExporter
which allows to include styles which works for its content and allow to style the embedded component in its shadow root.The only way to do styling which I see at the moment is: make the embedded component as a web component ( e.g. a Polymer element) and "inline styling" there so that it's local and doesn't leak globally.
But it's silly because if I want to use only standard HTML components (like
div
) I have to make my own wrapper just to style it.It's reasonable to add styling to already existing wrapper which we generate.
The text was updated successfully, but these errors were encountered: