-
Bug
-
Resolution: Fixed
-
Low
-
9.1.0, 9.1.1, 9.2.0, 9.2.1, 9.3.1, 9.2.2, 9.3.2
-
3
-
Severity 3 - Minor
-
23
-
Issue Summary
From Confluence 9.1 onwards, custom CSS applied using @import is being ignored. This affects the CSS from an external URL and CSS attached to a Confluence page.
Steps to Reproduce
1. Create a Confluence instance for any of the affected versions (>= 9.1).
2. In the Global Stylsheet (General Config > Stylesheet) or space's Stylesheet (Space Tools > Look and Feel > Stylesheet), enter:
@import url("<any external .css>");
or
@import url("<Confluence attachment URL containing CSS>")
3. Load a page from this space
4. In the developer tools, on the source tab, notice that the external .CSS is not mentioned
Expected Results
The CSS provided in the Stylesheet should be applied Globally or to the Space.
Actual Results
The CSS is ignored and not applied Globally or to the Space.
Workaround
A workaround is possible if we manually change the custom-css.vm file to prioritize $style attributes:
- Navigate to <install-folder>/confluence/styles
- Move the "Custom styles" section in the file custom-css.vm so that it is above the "### CUSTOM SITE LOGOS", like this:
#disableAntiXss() ## Custom styles for Confluence (included for all themes by default) $style ## End custom styles for Confluence ### CUSTOM SITE LOGOS .aui-header .aui-header-logo img { content: var(--confluence-custom-logo-content); }
- Save this change and restart Confluence
Please take note of this manual change to Confluence's install files. Until a fixed version is released, you will need to reapply this change every time you upgrade your Confluence instance.