This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-334a310b-fab8-481a-b3de-b5f6d5bb0613 XWIKI-25756 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-599a1d1e-4d56-42bd-99ea-9152618c9151 Charpentier Lucas created this issue on 13/Nov/26 16:04
 
Summary: Use CSS variables instead of color theme Velocity variables in the WAR stylesheets that need no other Velocity code
Issue Type: cid:jira-generated-image-avatar-334a310b-fab8-481a-b3de-b5f6d5bb0613 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-1fcb0f24-63a3-4566-8391-e299ed414716 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.

12 stylesheets of the WAR use color theme Velocity variables and no other Velocity code, 85 usages in total:

  • uicomponents/viewers/diff.css
  • uicomponents/wizard/wizard.css
  • js/xwiki/usersandgroups/usersandgroups.css
  • uicomponents/viewers/tags.css
  • uicomponents/extension/history.css
  • uicomponents/viewers/comments.css
  • uicomponents/widgets/fullScreen.css
  • uicomponents/job/job.css
  • js/xwiki/widgets/modalPopup.css
  • uicomponents/flavor/picker.css
  • js/xwiki/viewers/information.css
  • uicomponents/widgets/validation/livevalidation.css

5 more stylesheets load colorThemeInit.vm without using any of its variables: css/resubmit.css, js/xwiki/actionbuttons/actionButtons.css, uicomponents/widgets/compactLocationPicker.css, uicomponents/widgets/locationPicker.css and uicomponents/widgets/select/select.css.

We should:

  • Replace each color theme Velocity variable of the 12 stylesheets with its CSS variable.
  • Remove the loading of colorThemeInit.vm from the 17 stylesheets.
  • Remove the stale $theme.highlightColor comment of misc.less in the Flamingo skin.

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.

The stylesheets are still requested with Velocity evaluation after this change. Stopping that is a separate issue.