// Compiled by ClojureScript 1.9.562 {}
goog.provide('garden.stylesheet');
goog.require('cljs.core');
goog.require('garden.util');
goog.require('garden.color');
goog.require('garden.types');
/**
 * Create a rule function for the given selector. The `selector`
 *   argument must be valid selector (ie. a keyword, string, or symbol).
 *   Additional arguments may consist of extra selectors or
 *   declarations.
 * 
 *   The returned function accepts any number of arguments which represent
 *   the rule's children.
 * 
 *   Ex.
 *    (let [text-field (rule "[type="text"])]
 *     (text-field {:border ["1px" :solid "black"]}))
 *    ;; => ["[type="text"] {:boder ["1px" :solid "black"]}]
 */
garden.stylesheet.rule = (function garden$stylesheet$rule(var_args){
var args__24376__auto__ = [];
var len__24369__auto___35773 = arguments.length;
var i__24370__auto___35774 = (0);
while(true){
if((i__24370__auto___35774 < len__24369__auto___35773)){
args__24376__auto__.push((arguments[i__24370__auto___35774]));

var G__35775 = (i__24370__auto___35774 + (1));
i__24370__auto___35774 = G__35775;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((1) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24377__auto__);
});

garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic = (function (selector,more){
if(!(((selector instanceof cljs.core.Keyword)) || (typeof selector === 'string') || ((selector instanceof cljs.core.Symbol)))){
throw cljs.core.ex_info.call(null,"Selector must be either a keyword, string, or symbol.",cljs.core.PersistentArrayMap.EMPTY);
} else {
return (function() { 
var G__35776__delegate = function (children){
return cljs.core.into.call(null,cljs.core.apply.call(null,cljs.core.vector,selector,more),children);
};
var G__35776 = function (var_args){
var children = null;
if (arguments.length > 0) {
var G__35777__i = 0, G__35777__a = new Array(arguments.length -  0);
while (G__35777__i < G__35777__a.length) {G__35777__a[G__35777__i] = arguments[G__35777__i + 0]; ++G__35777__i;}
  children = new cljs.core.IndexedSeq(G__35777__a,0,null);
} 
return G__35776__delegate.call(this,children);};
G__35776.cljs$lang$maxFixedArity = 0;
G__35776.cljs$lang$applyTo = (function (arglist__35778){
var children = cljs.core.seq(arglist__35778);
return G__35776__delegate(children);
});
G__35776.cljs$core$IFn$_invoke$arity$variadic = G__35776__delegate;
return G__35776;
})()
;
}
});

garden.stylesheet.rule.cljs$lang$maxFixedArity = (1);

garden.stylesheet.rule.cljs$lang$applyTo = (function (seq35771){
var G__35772 = cljs.core.first.call(null,seq35771);
var seq35771__$1 = cljs.core.next.call(null,seq35771);
return garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic(G__35772,seq35771__$1);
});

garden.stylesheet.cssfn = (function garden$stylesheet$cssfn(fn_name){
return (function() { 
var G__35779__delegate = function (args){
return (new garden.types.CSSFunction(fn_name,args,null,null,null));
};
var G__35779 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__35780__i = 0, G__35780__a = new Array(arguments.length -  0);
while (G__35780__i < G__35780__a.length) {G__35780__a[G__35780__i] = arguments[G__35780__i + 0]; ++G__35780__i;}
  args = new cljs.core.IndexedSeq(G__35780__a,0,null);
} 
return G__35779__delegate.call(this,args);};
G__35779.cljs$lang$maxFixedArity = 0;
G__35779.cljs$lang$applyTo = (function (arglist__35781){
var args = cljs.core.seq(arglist__35781);
return G__35779__delegate(args);
});
G__35779.cljs$core$IFn$_invoke$arity$variadic = G__35779__delegate;
return G__35779;
})()
;
});
garden.stylesheet.at_rule = (function garden$stylesheet$at_rule(identifier,value){
return (new garden.types.CSSAtRule(identifier,value,null,null,null));
});
/**
 * Create a CSS @font-face rule.
 */
garden.stylesheet.at_font_face = (function garden$stylesheet$at_font_face(var_args){
var args__24376__auto__ = [];
var len__24369__auto___35783 = arguments.length;
var i__24370__auto___35784 = (0);
while(true){
if((i__24370__auto___35784 < len__24369__auto___35783)){
args__24376__auto__.push((arguments[i__24370__auto___35784]));

var G__35785 = (i__24370__auto___35784 + (1));
i__24370__auto___35784 = G__35785;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((0) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__auto__.slice((0)),(0),null)):null);
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(argseq__24377__auto__);
});

garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic = (function (font_properties){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["@font-face",font_properties], null);
});

garden.stylesheet.at_font_face.cljs$lang$maxFixedArity = (0);

garden.stylesheet.at_font_face.cljs$lang$applyTo = (function (seq35782){
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq35782));
});

/**
 * Create a CSS @import rule.
 */
garden.stylesheet.at_import = (function garden$stylesheet$at_import(var_args){
var args35786 = [];
var len__24369__auto___35791 = arguments.length;
var i__24370__auto___35792 = (0);
while(true){
if((i__24370__auto___35792 < len__24369__auto___35791)){
args35786.push((arguments[i__24370__auto___35792]));

var G__35793 = (i__24370__auto___35792 + (1));
i__24370__auto___35792 = G__35793;
continue;
} else {
}
break;
}

var G__35790 = args35786.length;
switch (G__35790) {
case 1:
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
default:
var argseq__24392__auto__ = (new cljs.core.IndexedSeq(args35786.slice((1)),(0),null));
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24392__auto__);

}
});

garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$1 = (function (url){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"import","import",-1399500709),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"url","url",276297046),url,new cljs.core.Keyword(null,"media-queries","media-queries",-1563277678),null], null));
});

garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic = (function (url,media_queries){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"import","import",-1399500709),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"url","url",276297046),url,new cljs.core.Keyword(null,"media-queries","media-queries",-1563277678),media_queries], null));
});

garden.stylesheet.at_import.cljs$lang$applyTo = (function (seq35787){
var G__35788 = cljs.core.first.call(null,seq35787);
var seq35787__$1 = cljs.core.next.call(null,seq35787);
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic(G__35788,seq35787__$1);
});

garden.stylesheet.at_import.cljs$lang$maxFixedArity = (1);

/**
 * Create a CSS @media rule.
 */
garden.stylesheet.at_media = (function garden$stylesheet$at_media(var_args){
var args__24376__auto__ = [];
var len__24369__auto___35797 = arguments.length;
var i__24370__auto___35798 = (0);
while(true){
if((i__24370__auto___35798 < len__24369__auto___35797)){
args__24376__auto__.push((arguments[i__24370__auto___35798]));

var G__35799 = (i__24370__auto___35798 + (1));
i__24370__auto___35798 = G__35799;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((1) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24377__auto__);
});

garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic = (function (media_queries,rules){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"media","media",-1066138403),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"media-queries","media-queries",-1563277678),media_queries,new cljs.core.Keyword(null,"rules","rules",1198912366),rules], null));
});

garden.stylesheet.at_media.cljs$lang$maxFixedArity = (1);

garden.stylesheet.at_media.cljs$lang$applyTo = (function (seq35795){
var G__35796 = cljs.core.first.call(null,seq35795);
var seq35795__$1 = cljs.core.next.call(null,seq35795);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic(G__35796,seq35795__$1);
});

/**
 * Create a CSS @keyframes rule.
 */
garden.stylesheet.at_keyframes = (function garden$stylesheet$at_keyframes(var_args){
var args__24376__auto__ = [];
var len__24369__auto___35802 = arguments.length;
var i__24370__auto___35803 = (0);
while(true){
if((i__24370__auto___35803 < len__24369__auto___35802)){
args__24376__auto__.push((arguments[i__24370__auto___35803]));

var G__35804 = (i__24370__auto___35803 + (1));
i__24370__auto___35803 = G__35804;
continue;
} else {
}
break;
}

var argseq__24377__auto__ = ((((1) < args__24376__auto__.length))?(new cljs.core.IndexedSeq(args__24376__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24377__auto__);
});

garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic = (function (identifier,frames){
return garden.stylesheet.at_rule.call(null,new cljs.core.Keyword(null,"keyframes","keyframes",-1437976012),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"identifier","identifier",-805503498),identifier,new cljs.core.Keyword(null,"frames","frames",1765687497),frames], null));
});

garden.stylesheet.at_keyframes.cljs$lang$maxFixedArity = (1);

garden.stylesheet.at_keyframes.cljs$lang$applyTo = (function (seq35800){
var G__35801 = cljs.core.first.call(null,seq35800);
var seq35800__$1 = cljs.core.next.call(null,seq35800);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic(G__35801,seq35800__$1);
});

/**
 * Create a color from RGB values.
 */
garden.stylesheet.rgb = (function garden$stylesheet$rgb(r,g,b){
return garden.color.rgb.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [r,g,b], null));
});
/**
 * Create a color from HSL values.
 */
garden.stylesheet.hsl = (function garden$stylesheet$hsl(h,s,l){
return garden.color.hsl.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [h,s,l], null));
});
