New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons in dynamic DOM #144

Closed
dominikwilkowski opened this Issue Oct 23, 2015 · 7 comments

Comments

Projects
None yet
2 participants
@dominikwilkowski
Contributor

dominikwilkowski commented Oct 23, 2015

How to run grunticon in an SPA?

This issue is linked with filamentgroup/grunticon#258 and still open.
Until grunticon has this issue open let me suggest some way to get this to work for now:

Angular solution 1

(function guiGrunticonsEmbedDirective() {
    'use strict';
    var componentsModule = angular.module('gui.ng.components.grunticonEmbed', []);
    componentsModule.directive('grunticonEmbed', grunticonEmbed);

    function grunticonEmbed() {
        var directive = {
            restrict: 'A',
            scope: false,
            link: linkFunc
        };

        return directive;

        function linkFunc() {
            grunticon.embedIcons(grunticon.getIcons(grunticon.getCSS(grunticon.href)));
        }
    }
})();

Angular solution 2

https://gist.github.com/navad/c6da12424ef9bc573700 (not sure about that one)

If you have more let us know.

@dominikwilkowski

This comment has been minimized.

Contributor

dominikwilkowski commented Oct 23, 2015

There is also a cool way to change the color by using -webkit-mask-image in CSS. This also should be an option to be considered here.

@navad

This comment has been minimized.

navad commented Oct 26, 2015

Gist updated with our latest version (more in the comments section)

@dominikwilkowski

This comment has been minimized.

Contributor

dominikwilkowski commented Oct 26, 2015

nice work @navad
looks great

@dominikwilkowski

This comment has been minimized.

Contributor

dominikwilkowski commented Nov 9, 2015

There is effort in writing an angular GUI which is also tackling the same issue.
For reference see more here: WestpacCXTeam/Angular-GUI#1

@dominikwilkowski

This comment has been minimized.

Contributor

dominikwilkowski commented Jan 20, 2016

Just for future references, this is the unminified version of the loader script for grunticon:
https://github.com/filamentgroup/grunticon-lib/blob/master/static/grunticon.loader.js

@dominikwilkowski

This comment has been minimized.

Contributor

dominikwilkowski commented Mar 18, 2016

Just an FYI:
A new proposed svg system will be implemented soonish. Please have a look and submit any concerns. We expect it to solve this issue.

#209

@dominikwilkowski

This comment has been minimized.

Contributor

dominikwilkowski commented Sep 7, 2016

Closing due to the fact that we already have a working directive for Angular and are also moving away from grunticon via #209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment