Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Regarding setting a CSS class to Icons created by isomorphic.

    Hi Team,
    In SmartClient for Label icons we will provide the relative path of the images and smart client will be adding the <img src="relativepath"/> with this can we set a CSS class to the img tag.
    There are options to set the src(ex-Label.setIncon()), height (Label.iconHeight) in the same way can you provide an API to set the class.
    It helps us in loading the image from css using the sprite image.

    Thanks
    Vinay

    #2
    There's not currently a property to do manual spriting for icons in 9.0. However we've just exposed a new property in 9.1, Button.iconStyle, that would allow you to apply a stateful CSS suffix to the Button.icon (and therefore the Label.icon). You'll need tomorrow's nightly build to see both the docs and the working property.

    Comment


      #3
      I know this is a stretch... but have you guys considered expanding the icon src attribute to take into account html instead of just a url to an icon?

      I say this because it would be awesome, along with this new API, to add stuff like GlyphIcons or FontAwesome to SmartClient.

      I know it has some backwards compatibility issues with older browsers, but would be nice to build this into the 'CSS3Support' check.

      Comment


        #4
        We're aware of GlyphIcons and have been thinking about adding support of some kind, however, GylphIcons are really quite a hack - smuggling monochrome vector graphics through fonts.

        Have you looked at SVG data URIs? These already work with any "src" or "icon" attribute.

        Comment


          #5
          Originally posted by Isomorphic View Post
          There's not currently a property to do manual spriting for icons in 9.0. However we've just exposed a new property in 9.1, Button.iconStyle, that would allow you to apply a stateful CSS suffix to the Button.icon (and therefore the Label.icon). You'll need tomorrow's nightly build to see both the docs and the working property.
          Could you please let us know, how to use the 9.1.

          Comment


            #6
            See SmartClient.com/builds.

            Comment


              #7
              yea - didn't mean to hijack the thread so I'll keep it brief.

              I'm aware of SVG and Data URIs. Still means you have precompiled images that can't be changed via CSS. And there are some IE8 issues too if I remember correctly.

              And yes - I agree font icons are a hack but it IS a pretty cool hack that is gaining momentum.

              Comment


                #8
                SVG can be generated on the fly to apply colors, shadows or other effects, and eliminates GlyphIcon's monochrome limitation.

                Or consider the "Get Data URL" button in this sample - anything you can render into a DrawPane becomes usable as an icon or in any other context where an image is allowed (Window edges..).

                You are probably correct that GlyphIcons exist essentially because of IE8 and earlier. We'll keep an eye on it and see how many requests we get to support it, but because of the dramatically greater flexibility of the approaches above, at the moment it looks like a hack that will fall into disuse as ancient IE versions fade further.

                Comment

                Working...
                X