Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Suggestions for the icon system - without modifying the core.

$
0
0
Hey,

What i did...
In the image provider (\Composite\scripts\source\top\core\ImageProvider.js) I modified the 'getImageURL' method to only return the resourceName (I suppose you could also include the namespace but I did not).
This results in all controls having this resourcename as the value for the image attribute.
(In some other scripts there are pointers to paths that i simplified to a resourcename.)

Now you can easily target the control style in a stylesheet with:
[image="selectorindicator"] {
    &:after {
        font-size: .8em;
        content: '▼';
        right: 1em;
        top: .7em;
    }
}

[image="fieldhelpindicator"] {
    &:after {
        content: '?';
        left: .75em;
        top: .4em;
     }
}

[image="control-close-default"] {
    &:after {
        content: 'X';
    }
}
This will work throughout the system. If you want to modify the icon/image in a certain situation just override, add class or increase specificity by targeting the control path.

In these examples i used the content property but i think its easy to see that the source can be anything.

The only thing to do now is creating/getting the icons and parse through the system to target all image attributes that you want images for.

JamBo

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>