We have a couple of confluence macros that we recently also enabled in mobile view. These macros are really simple that just render a vm template with some regular link buttons. There is some CSS but no JS.
The action buttons styling is following AUI buttons class description here:
<button class="aui-button aui-button-primary">Button Title</button>
The above documentation states that you do not need to explicitly require the web resource key as its included in the AUI core.
The button styling appears fine in desktop view. However, in mobile view, the css styling for these classes aren’t downloaded.
We tried to add a condition to require the AUI buttons web resource in mobile view like this:
in VM file:
#if ($isMobile)
#requireResource("plugin-key:myResourcesKey")
#end
and in atlassian-plugin.xml
<web-resource key="myResourcesKey" name="Mobile Macros Resources">
<dependency>com.atlassian.auiplugin:aui-buttons</dependency>
</web-resource>
However, the above method didn’t work. I’ve tried different ways too but it won’t work. The only way that worked with me was to put my own CSS file and style the buttons similar to the AUI buttons style. But this is not a good fix at all, and I want to use the proper AUI resources to match between mobile and desktop. Any ideas or tips?