This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-f0162c43-8627-46eb-9e28-b962c52d4d0e XWIKI-25757 Open

Use CSS variables instead of color theme Velocity variables in the wiki page stylesheets that need no other Velocity code

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-da8edede-e861-4c50-8675-cbb9ee3610a9 Charpentier Lucas created this issue on 13/Nov/26 16:04
 
Summary: Use CSS variables instead of color theme Velocity variables in the wiki page stylesheets that need no other Velocity code
Issue Type: cid:jira-generated-image-avatar-f0162c43-8627-46eb-9e28-b962c52d4d0e Improvement
Affects Versions: 17.10.15
Assignee: Unassigned
Components: Flamingo Skin
Created: 13/Nov/26 16:04
Priority: cid:jira-generated-image-static-major-0ca13411-f0ef-472c-9291-b6cb41923144 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.

25 StyleSheetExtension objects of the wiki pages of XWiki Standard are parsed with Velocity only to load colorThemeInit.vm and read color theme variables, 80 usages in total:

  • AppWithinMinutes.LiveTableEditSheet, AppWithinMinutes.CreateApplication, AppWithinMinutes.StaticList and the second stylesheet of AppWithinMinutes.ClassEditSheet
  • Panels.PanelWizard and Panels.Applications
  • XWiki.AdminSheet and XWiki.TemplateProviderMacros
  • IconThemesCode.IconPicker
  • FlamingoThemesCode.ThemeSheet and FlamingoThemesCode.WebHomeSheet
  • SkinsCode.XWikiSkinsSheet
  • XWiki.SharePage
  • WikiManager.UserWikiSheet and the second stylesheet of WikiManager.CreateWiki
  • ExtensionCode.ExtensionSheet, ExtensionCode.ExtensionVersionSheet and ExtensionCode.ProjectVersionSheet
  • XWiki.Extension.Security.Code.NotificationAlert
  • XWiki.Notifications.Code.NotificationsDisplayerUIX
  • Image.Style.Code.DefaultImageStyleStyleSheet
  • Main.SolrMediaTypeFacet, Main.SolrSpaceFacet and XWiki.SolrSearchAdmin
  • Main.MessageSenderMacro

We should:

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

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.