$default = json('default.json', { hash: true });
$custom = json('../../../../ui.config.json', { hash: true, optional: true });

$loaders = typeof($custom) != 'null' ? $custom.$loaders : $default.$loaders;

@import 'themes/default.styl';
@import 'themes/cube-grid.styl';
@import 'themes/petal.styl';

.loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
    user-select: none;
    pointer-events: none;

    for type, params in $loaders {
        $mixin = lookup('loader-' + params.theme)

        if (type == 'default') {
            & {
                $mixin(params)
            }
        } else {      
            &.loader-{type} {
                $mixin(params)
            }
        }
    }
}