// 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__24566__auto__ = [];
var len__24559__auto___35774 = arguments.length;
var i__24560__auto___35775 = (0);
while(true){
if((i__24560__auto___35775 < len__24559__auto___35774)){
args__24566__auto__.push((arguments[i__24560__auto___35775]));

var G__35776 = (i__24560__auto___35775 + (1));
i__24560__auto___35775 = G__35776;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.rule.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__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__35777__delegate = function (children){
return cljs.core.into.call(null,cljs.core.apply.call(null,cljs.core.vector,selector,more),children);
};
var G__35777 = function (var_args){
var children = null;
if (arguments.length > 0) {
var G__35778__i = 0, G__35778__a = new Array(arguments.length -  0);
while (G__35778__i < G__35778__a.length) {G__35778__a[G__35778__i] = arguments[G__35778__i + 0]; ++G__35778__i;}
  children = new cljs.core.IndexedSeq(G__35778__a,0,null);
} 
return G__35777__delegate.call(this,children);};
G__35777.cljs$lang$maxFixedArity = 0;
G__35777.cljs$lang$applyTo = (function (arglist__35779){
var children = cljs.core.seq(arglist__35779);
return G__35777__delegate(children);
});
G__35777.cljs$core$IFn$_invoke$arity$variadic = G__35777__delegate;
return G__35777;
})()
;
}
});

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

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

garden.stylesheet.cssfn = (function garden$stylesheet$cssfn(fn_name){
return (function() { 
var G__35780__delegate = function (args){
return (new garden.types.CSSFunction(fn_name,args,null,null,null));
};
var G__35780 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__35781__i = 0, G__35781__a = new Array(arguments.length -  0);
while (G__35781__i < G__35781__a.length) {G__35781__a[G__35781__i] = arguments[G__35781__i + 0]; ++G__35781__i;}
  args = new cljs.core.IndexedSeq(G__35781__a,0,null);
} 
return G__35780__delegate.call(this,args);};
G__35780.cljs$lang$maxFixedArity = 0;
G__35780.cljs$lang$applyTo = (function (arglist__35782){
var args = cljs.core.seq(arglist__35782);
return G__35780__delegate(args);
});
G__35780.cljs$core$IFn$_invoke$arity$variadic = G__35780__delegate;
return G__35780;
})()
;
});
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__24566__auto__ = [];
var len__24559__auto___35784 = arguments.length;
var i__24560__auto___35785 = (0);
while(true){
if((i__24560__auto___35785 < len__24559__auto___35784)){
args__24566__auto__.push((arguments[i__24560__auto___35785]));

var G__35786 = (i__24560__auto___35785 + (1));
i__24560__auto___35785 = G__35786;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((0) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((0)),(0),null)):null);
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(argseq__24567__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 (seq35783){
return garden.stylesheet.at_font_face.cljs$core$IFn$_invoke$arity$variadic(cljs.core.seq.call(null,seq35783));
});

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

var G__35794 = (i__24560__auto___35793 + (1));
i__24560__auto___35793 = G__35794;
continue;
} else {
}
break;
}

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

break;
default:
var argseq__24582__auto__ = (new cljs.core.IndexedSeq(args35787.slice((1)),(0),null));
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24582__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 (seq35788){
var G__35789 = cljs.core.first.call(null,seq35788);
var seq35788__$1 = cljs.core.next.call(null,seq35788);
return garden.stylesheet.at_import.cljs$core$IFn$_invoke$arity$variadic(G__35789,seq35788__$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__24566__auto__ = [];
var len__24559__auto___35798 = arguments.length;
var i__24560__auto___35799 = (0);
while(true){
if((i__24560__auto___35799 < len__24559__auto___35798)){
args__24566__auto__.push((arguments[i__24560__auto___35799]));

var G__35800 = (i__24560__auto___35799 + (1));
i__24560__auto___35799 = G__35800;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__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 (seq35796){
var G__35797 = cljs.core.first.call(null,seq35796);
var seq35796__$1 = cljs.core.next.call(null,seq35796);
return garden.stylesheet.at_media.cljs$core$IFn$_invoke$arity$variadic(G__35797,seq35796__$1);
});

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

var G__35805 = (i__24560__auto___35804 + (1));
i__24560__auto___35804 = G__35805;
continue;
} else {
}
break;
}

var argseq__24567__auto__ = ((((1) < args__24566__auto__.length))?(new cljs.core.IndexedSeq(args__24566__auto__.slice((1)),(0),null)):null);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__24567__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 (seq35801){
var G__35802 = cljs.core.first.call(null,seq35801);
var seq35801__$1 = cljs.core.next.call(null,seq35801);
return garden.stylesheet.at_keyframes.cljs$core$IFn$_invoke$arity$variadic(G__35802,seq35801__$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));
});
