Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13152

Provide a non-deprecated way to override "style.css" using the Skin Application

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 7.4.1
    • Flamingo Skin
    • None
    • Unknown

    Description

      Steps to reproduce:

      • create a new skin page
      • add a new template "style.css" using the "Add" button next to "Add a new overriding template"
      • add the content from the default template on the filesystem:
        ## Get the compiled LESS code
        #set($css = $services.lesscss.compileSkinFile('style.less.vm'))
        ## Remove the useless part
        #set($index = $css.indexOf('.not-sent-to-the-browser-from-this-point'))
        #if($index >= 0)
          #set($css = $css.substring(0, $index))
        #end
        ## Remove from the CSS some rules that make IE9 crash using the WYSIWYG (XWIKI-10661)
        ## Only if the user agent contains the IE9 signature
        ## @TODO: Remove this when IE9 will no longer be supported.
        #if($request.getHeader('User-Agent').contains('MSIE 9.0'))
          ## We removes css rules like ".className:empty{...}"
          ## "(?s)" means that the expression "." matches any character, including a line terminator
          #set($css = $css.replaceAll('(?s)\.[^\{]*:empty\{[^\}]*\}', ''))
        #end
        ## Display the CSS
        $!css
        
      • set the skin in administration
      • open http://localhost:8080/xwiki/bin/view/Sandbox/TestPage1

      Result: the page appears without a skin.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oana.tabaranu Elena-Oana Florea
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: