3 Replies Latest reply on Mar 2, 2010 3:16 PM by Jay Balunas

    New format of dynamic CSS files

    Andrey Markhel Newbie
      I found one issue in our plans for implementation EL-expresiions inside CSS
      All selectors in CSS have "{" and "}" elements, so using EL-syntax #{context.value} isn't allowed inside selector, because they are use "{" and "}" too.
      So all available parsers and IDE doesn't uderstand were selector ended and new selector started.
      There are couple of variants to solve this issue, for example we can use custom function richEL(context.value) and evaluate context.value during parsing process.
      Same problem arise when we want to use namespaces and custom functions such as rich:function(value) because ":" it is indicator, that new properrty started...

      Any thoughts?
        • 1. Re: New format of dynamic CSS files
          Nick Belaevski Master

          Andrey,

           

          After discussion with Alex & you there are possible variants cleared out:

           

          1. Enclose values in quotes/apostrophes

           

          body {
               border: 1px solid red;
               font-family: '#{skin.baseFont}';
          }
          

           

          body {
               border: 1px solid red;
               font-family: "#{fn:method(skin.baseFont)}";
          }
          

           

          2. Use special el(...) function

           

          body {
               border: 1px solid red;
               background-color: white;
               font-family: el("#{skin.baseFont}");
               border-color: navy;
          }
          

           

          3. Ask JBT team to provide CSS editor that is compatible with such code:

          body { 
               border: 1px solid red; 
               font-family: #{skin.baseFont}; 
          }
          

           

          I'm for the first variant, as this is a valid CSS code, however we need to check if IEs handle this correctly.

          • 2. Re: New format of dynamic CSS files
            Ilya Shaikovsky Master

            I'm also for the first option. If some additional problems appears with that - N2 seems also suitable. But the third I think is not an option. We should not expect that customer using eclipse only and I believe it also could take much time.

            • 3. Re: New format of dynamic CSS files
              Jay Balunas Master

              I too like the first option best.  It is easy to understand, and especially if it is still valid CSS and won't make the tools go crazy ;-)

               

              The second option might be easier for tools to trigger auto-complete on, but we would need to bring that up with them.

               

              Don't like the third because it limits support to just jboss tools.