This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-287a15f5-232d-4c57-ab1e-ffa378ce2f70 XWIKI-25758 Open

Use CSS variables instead of color theme Velocity variables in the stylesheets that reference skin files

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-470f6bc1-c548-4b80-a19b-90d4e7e1284d Charpentier Lucas created this issue on 13/Nov/26 16:04
 
Summary: Use CSS variables instead of color theme Velocity variables in the stylesheets that reference skin files
Issue Type: cid:jira-generated-image-avatar-287a15f5-232d-4c57-ab1e-ffa378ce2f70 Improvement
Affects Versions: 17.10.15
Assignee: Unassigned
Components: Web - Templates & Resources
Created: 13/Nov/26 16:04
Priority: cid:jira-generated-image-static-major-65cb3e90-0847-4312-948c-6725ee229831 Major
Reporter: Charpentier Lucas
Description:

Part of the removal of the color theme Velocity variables ($theme, loaded with colorThemeInit.vm) from the stylesheets of XWiki Standard, following XWIKI-25649. The CSS variables introduced by XWIKI-22667 expose the same colors.

Some stylesheets use color theme Velocity variables next to other Velocity code, mostly $xwiki.getSkinFile(...) calls for icon URLs, 113 usages in total:

  • In the WAR: js/xwiki/editors/dataeditors.css, js/xwiki/importer/import.css, uicomponents/extension/extension.css, uicomponents/logging/logging.css, uicomponents/suggest/suggest.css and js/xwiki/viewers/attachments.css
  • In the search webjar: search.css
  • In wiki pages: the first stylesheet of AppWithinMinutes.ClassEditSheet, AnnotationCode.Style, AnnotationCode.Settings, XWiki.SearchSuggestConfigSheet, Main.Tags, XWiki.AttachmentSelector, XWiki.XWikiUserProfileSheet, WikiManager.WikisMacro and the first stylesheet of WikiManager.CreateWiki

We should:

  • Replace each color theme Velocity variable of these stylesheets with its CSS variable.
  • Remove the loading of colorThemeInit.vm from them.

These stylesheets keep their Velocity evaluation, since the rest of their Velocity code stays.

The replacement follows the mapping Flamingo already uses in colorThemeMappingOutput.vm, for instance borderColor becomes -xwiki-border-color, textSecondaryColor becomes text-muted and highlightColor becomes -nav-link-hover-bg.

Visible change: none expected beyond small color differences. backgroundSecondaryColor becomes -xwiki-background-secondary-color, which follows the color theme, and a few CSS variables such as -text-muted have a value adjusted for contrast.