Questions Tagged With themehttps://answers.axonivy.com/tags/theme/?type=rss&user=lphieuquestions tagged <span class="tag">theme</span>enFri, 05 Apr 2019 07:34:29 -0400How to override css from child module to parent modulehttps://answers.axonivy.com/questions/3763/how-to-override-css-from-child-module-to-parent-module<p>Dear Ivy team.</p> <p>I just wanna ask you that is there any possibility to override CSS from child module to parent module.</p> <p>For example, we are having 2 ivy projects: project Parent and project Child, Child depends on Parent and both of them are deployed in the same application.</p> <p>We need to change some style for both of them but the problem is we don't have right to modify project Parent. So in project Child, we defined some custom CSS styles and import it in XHTML page. This way works well for only views that belong to Child project, but with the view in Parent project, it can't work because we can't inject our CSS to Parent project.</p> <p>Our attempt was creating a custom theme as this suggestion: <a href="https://answers.axonivy.com/questions/12/how-to-create-my-own-theme-for-html-user-dialogs">https://answers.axonivy.com/questions/12/how-to-create-my-own-theme-for-html-user-dialogs</a> and put this jar file under Designer/Engine folder. The way just works perfectly, our custom CSS style can apply for both Parent and Child. But the small problem is whenever we change our style, we need to build the jar and put it in Designer/Engine manually, it's really not convenient.</p> <p>So to overcome this inconvenience, we try to put our custom theme in project Child with the same structure of custom PrimeFaces theme like this: <img alt="alt text" src="https://answers.axonivy.com/upfiles/Image1.png"></p> <p>With this way still only work for Child project, not Parent project because when we start a view in Parent project, we got a problem: FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-serenity-bluegrey" library</p> <p>that error comes from org.primefaces.renderkit.HeadRenderer <img alt="alt text" src="https://answers.axonivy.com/upfiles/Image2.png"></p> <p>After debugging, I figure out that Ivy also takes part in the resource loading process: <img alt="alt text" src="https://answers.axonivy.com/upfiles/Image3.png"></p> <p>Unfortunately, we can't see what inside that class and don't know is there any possibility to inject our custom CSS into that process. I know that inject CSS from child to parent is something weird but actually, we can't find an alternative way.</p> <p>So I just wanna ask you that is there any possibility to inject CSS from child to parent?</p> <p>Thank in advance!</p>lphieuFri, 05 Apr 2019 07:34:29 -0400https://answers.axonivy.com/questions/3763/how-to-override-css-from-child-module-to-parent-modulethemecss