Hi Joel,

I think this is a good idea. We've discussed one of my pain points;
particularly "*Exploring Garden At Rules*". Our thread basically looked
like the below (last few messages ellided). Now, for the moment, I indeed
went back to *SCSS*, because *i)* it did what I wanted out of the box and
*ii)* I took a look at garden code and it wasn't clear to me how *cssfn*and
*defcssfn* solved my *@import* problem.

So I'd imagine there are a few more of those kinds of edge cases with which
I'd need to wrestle. And it's sort of on me, to fix and contribute, like
you said. But at the moment, I'm just strapped for time, and needed
something that worked. Also, I've neglected
garden-watch<https://github.com/twashing/garden-watch>,
which is another use case that I needed filled. Ie, I have an external
designer. And I'd just like him to work with *edn*, and have *CSS* be spit
out. So that's my 2 cents. And if I were to have those things working now,
I'd ditch *HAML* and *SCSS*.


*1. *

Hi Joel, I'm playing around with garden a little, and wanted to ask you a
question about the at rules. If I execute the below command, I get the
result output.

*(css (at-import
"url(http://fonts.googleapis.com/css?family=Gentium+Book+Basic:700italic
<http://fonts.googleapis.com/css?family=Gentium+Book+Basic:700italic>)"))*

*=> "@import 
\"url(http://fonts.googleapis.com/css?family=Gentium+Book+Basic:700italic
<http://fonts.googleapis.com/css?family=Gentium+Book+Basic:700italic>)\";"*



However, I need the result CSS to have the below string, without quotes,
etc.

*@import
url(http://fonts.googleapis.com/css?family=Gentium+Book+Basic:700italic
<http://fonts.googleapis.com/css?family=Gentium+Book+Basic:700italic>);*



Now, of course, I peered into the
source<https://github.com/noprompt/garden/blob/master/src/cljx/garden/stylesheet.cljx#L48>,
and tried just passing in the url. But that doesn't give me the output I
want either (has quotes + missing url).

*(css (at-import "http://fubar.com <http://fubar.com/>"))*

*=> "@import \"http://fubar.com <http://fubar.com/>\";"*



Is there a correct way of calling this? Otherwise, is there a way to just
pass through raw CSS, from my input edn / clj? Thanks for any insights.


*2. *

Hi Tim, You can do two things here.
Use garden.stylesheet/cssfn to create a temporary css function:
(def url (cssfn :url))

Use garden.def/defcssfn to do essentially same thing:
(defcssfn url)

You can then use either of these approaches to achieve the result you're
interested in.

    (css (at-import (url "http://example.com/";)))

Otherwise, is there a way to just pass through raw CSS?

People have asked me about this a number of times and it's something I've
generally been against from the start. It leads to dirty hacks and strange
bugs which are usually the result of operator errors. By eliminating the
number of places where one can pass raw strings Garden can ensure correct
output for most cases and in turn the number of issues that might be
opened. Of course, you can still do wacky stuff inside selectors.

Feel free to ask your questions in the issue tracker as well. It's nice to
have these answers documented there for future users.

...


Thanks

Tim Washington
Interruptsoftware.com <http://interruptsoftware.com>



On Sat, Mar 22, 2014 at 9:41 PM, Joel Holdbrooks <cjholdbro...@gmail.com>wrote:

> Greetings everyone,
>
> About a year ago I began working on Garden and in the short time the
> library has been around it's grown a bit. Although many folks seem to be
> interested in it, there's certainly not as much adoption of the library as
> I'd like to see. Sass, Less, and (god help us) pure CSS still appear to be
> the default choices for many people writing web applications in Clojure.
>
> This is something I'd like to change... but I need *your* help!
>
> No, no. Put down the phone. Don't look for a KickStarter URL. It's nothing
> like that.
>
> How you can help Garden
>
> I'm looking for individuals who are interested in the following:
>
>
>    - improving the compiler code
>    - improving/extending existing API's
>    - building an interface to the CSSOM
>
> I'm also open to good 'ol fashioned suggestions, pain points you've
> experienced using the library, or flat out letting me know what it would
> take to get you to choose Garden over the alternatives for your next
> project.
>
> How you can help Thorn
>
> Thorn is very young project and has no official release yet. So what is
> it? At the moment it's the beginnings of a Sass Parse Tree transformer;
> something that will take CSS/SCSS/Sass code and give you Garden code.
> There's a lot of fabulous libraries available in Sass and I'm sure it's a
> big factor when choosing how to go about CSS generation.
>
> I'm looking for individuals who are interested in the following:
>
>
>    - accurately transforming CSS/SCSS/Sass to real Clojure code targeting
>    Garden
>    - accurately transforming Less to real Clojure code targeting Garden
>
> Why?
>
> I deeply believe that being able to author CSS in Clojure or ClojureScript
> is a key piece to having an extremely compelling story for web application
> development in Clojure. Being able to *program* CSS and not just
> *preprocess* is a big advantage over existing tools. Being able to use
> all of Clojure everywhere has astounding possibilities.
>
>
> If any of this sounds interesting to you please get in contact with me or
> reply here. I will also be in San Francisco tomorrow until Tuesday for
> Clojure/West if you'd like to discuss these items in person.
>
>
> Truly,
>
> Joel
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to