Style components in layout.xml?
What is the best way to style components in .xml for the layout? I see presentation options only include positioning attributes (margin, height, padding, etc). What about adding a border or background color? Do we have to inject css via a startup workflow? Seems like there could/should be a way to configure that outside of css injection in a workflow.
-- Marc
-
There is limited styling available to us in the Branding module, otherwise injecting CSS with Workflow is usually the best way to go, especially for relatively specific items. Inject CSS is the only way to update most app styling, with the major exception of colors. Inject CSS is also the only way you'll be able to bind to specific app elements.
You can use custom themes to update app colors, but you'll need to write the JSON for it manually (and carefully!); the default theme is set in the app Branding module. I think that themes are only able to update colors though, haven't tried to update fonts or anything like that there and I don't think that you can... it's inject CSS only for that stuff (or a custom app). Themes won't require you to wait for some app startup event to trigger a workflow, so there's no race condition to sorry about with them. I've read about the ability to set up a custom theme in the on-prem viewer template but am unsure whether it's something folks got figured out and whether it survives app updates. I bet you just need to update a file somewhere for it anyway, then it will be available in the Web Designer for all your apps.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
1 kommentar