Question

I recently discovered that you can access some fontawesome fonts when using the app2sdk to very nice effect. For example, here I'm using them to show trend arrows in a rallygrid:

enter image description here

This was so much easier than any alternative, for one because you can easily style these icons (in this example the color) just like a font. It also give a wide array of useful icons ready to use.

But is it wise to use this feature? This feature is working in rc2, but was not working in rc1, and I don't think it is documented anywhere. Does anybody know if it is likely to keep working in future releases of the SDK?

Also, not all the icons are available- does this get updated periodically in Rally?

Was it helpful?

Solution

We have Rally icons, based on Entypo. This is a work in progress, so fonts may change in the future, but it is Rally's own set, and not all Entypo icons are available.

You may find out programmatically what icons of 'Rally' font-family are available in a given release of AppSDK2 by running this custom app:

<!DOCTYPE html>
<html>
<head>
    <title>FontExplorer</title>

    <script type="text/javascript" src="/apps/2.0rc2/sdk.js"></script>

    <script type="text/javascript">
        Rally.onReady(function () {
                Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',
    launch: function() {
        var fontStyles = _.find(document.styleSheets, function(styleSheet) {
            return styleSheet.href.match(/rui-fonts\.css$/);
        });
        var iconRules = _.filter(fontStyles.rules, function(rule) { 
            return rule.selectorText && rule.selectorText.match(/\.icon\-\w+\:\:before/) && rule.style[0] === 'content';  
        });

        this.add(_.map(iconRules, function(cssRule) {
            var iconName = cssRule.selectorText.substring(1).replace('::before', '');
            return {
                xtype: 'component',
                html: '<span style="font-family:courier" >' + iconName + '</span>',
                style: {
                    fontSize: '20px',
                    display: 'block'
                },
                cls: iconName,
                listeners: {
                    afterrender: function() {
                        if(this.getEl().getStyle('fontFamily') !== 'Rally') {
                            this.destroy();
                        }
                    }
                }
            };    
        }, this));
    }
});


            Rally.launchApp('CustomApp', {
                name:"FontExplorer",
           parentRepos:""
            });

        });
    </script>


    <style type="text/css">
        .app {
     /* Add app styles here */
}

    </style>
</head>
<body></body>
</html>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top