There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-2330d464-15ba-4b26-99f8-941f14eb4fd8 XWIKI-13299 Open

LESS compilation of SSX may sometimes generate invalid CSS with missing colors

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-a042cbaa-0035-40d9-aed8-933c86f6d2b2 Manuel Leduc on 15/Oct/26 11:43
 

Reproduced on 17.10.13 (jetty-hsqldb distribution, default flavor, single wiki, logged in as Admin).

Steps with the Menu macro SSX

  1. Create a page holding a FlamingoThemesCode.ThemeClass object with all its properties left empty, for example Sandbox.ThemeEmpty. In particular dropdown-link-hover-bg is empty.
  2. Flush the LESS cache: run $services.lesscss.clearCache() in a Velocity macro, or use the flush action of the LESS administration.
  3. Open /xwiki/bin/ssx/Menu/MenuMacro?language=en&colorTheme=Sandbox.ThemeEmpty.

Expected: the .menu.menu-horizontal>ul ul li a:hover rule has background-color:#f5f5f5 (the Bootstrap default, also what the skin's style.css gets for the same theme).
Actual:

.menu.menu-horizontal>ul ul li a:hover,.menu.menu-horizontal>ul ul li a:focus-within{text-decoration:none;color:#4d4d4d;background-color:}

The same happens when dropdown-link-hover-bg is a single space or ;. It does not happen with the bundled themes (Iceberg, Charcoal, Garden, Kitty, Marina), which all set dropdown-link-hover-bg.

Minimal steps, showing it also affects the default Iceberg theme

  1. Create a page, for example Sandbox.TwoSSX, with two XWiki.StyleSheetExtension objects. Both have content type LESS, use "On this page or on demand", parse "No", and this code (with p0 in the first object and p1 in the second):
    .p0-hover-bg{color:@dropdown-link-hover-bg}
    .p0-link-color{color:@dropdown-link-color}
    .p0-headings{color:@headings-color}
    
  2. Flush the LESS cache.
  3. Open /xwiki/bin/ssx/Sandbox/TwoSSX?language=en (wiki color theme: Iceberg), then flush again and open /xwiki/bin/ssx/Sandbox/TwoSSX?language=en&colorTheme=Sandbox.ThemeEmpty.

Both objects should compile to the same values. They don't: the second object differs.

Theme Variable First object Second object
Iceberg @dropdown-link-hover-bg #f5f5f5 #f5f5f5
Iceberg @dropdown-link-color #333 #4d4d4d
Iceberg @headings-color inherit #4d5860
ThemeEmpty @dropdown-link-hover-bg #f5f5f5 (empty)
ThemeEmpty @dropdown-link-color #333 #4d4d4d
ThemeEmpty @headings-color inherit #4d5860

The wrong result is then cached, so it stays until the next LESS cache flush or SSX save. Menu.MenuMacro also has two LESS SSX objects.