Giter VIP home page Giter VIP logo

Comments (7)

noprompt avatar noprompt commented on May 18, 2024

I'd love to use Garden--assuming it works as advertised

It does. :)

the one thing that keeps me from switching is Bourbon.

I totally understand. I've been using Compass for years.

Bourbon is just a simple layer over vendor-specific prefixes. Porting it should be easy.

I'm definitely open to this idea. Personally, I think Garden should come with "batteries included" in step with the ClojureWerks attitude. If you've perused the code you may have noticed work in the stylesheet folder. Though I've been a bit on the busy side, I'm slowly trying to cover the core CSS functions and properties. So any patches in that area or "mixins" ported from Bourbon/Compass that cover those bases around vendor-specific prefixes are 100% welcome.

I've only used Bourbon a few times and I've never seriously browsed the code behind if. If you're familiar with the code and feel like submitting a few pull requests you'd be doing the community a big favor. Not to mention, it'd help with getting Garden out of beta.

from garden.

noprompt avatar noprompt commented on May 18, 2024

So, I've decided that this is probably not the direction Garden should head in. Instead I would like to maintain a solid focus on simply producing "core" CSS from data structures while leaving it up to others to produce third party solutions such as ports, etc which target this library.

from garden.

danneu avatar danneu commented on May 18, 2024

@noprompt

What's the general way to incorporate mixins?

(defn white []
    {:color "white"})

These are what come to mind:

(css
 [:body [:& {:padding "10px"}
            (whiten)]])

(defrule body :body)
(css
 (body {:padding "10px"}
       (whiten)))

(css
 [:body (merge {:padding "10px"}
               (whiten))])

I happen to use defrule for almost everything which cleans up syntax, but is there a nicer way to throw in mixins otherwise?

from garden.

noprompt avatar noprompt commented on May 18, 2024

@danneu Probably the best way to go is to use functions as "mixins." If you need to return several declarations you can wrap the result in a vector with an empty parent selector reference (ie. [:& ...]).

Also defstyles was recently added to Garden for defining named groups of styles when you don't need a function. You could use those too. See the ChangeLog for examples.

from garden.

danneu avatar danneu commented on May 18, 2024

@noprompt

I'm not very good at this sort of thing but last night I tried to port some of Compass' CSS3 mixins to Clojure functions that return maps.

Do you have any advice or could you explain how you'd personally go about writing a library like this so it'd be the most convenient to use with Garden?

Trying to shave a yak.

from garden.

noprompt avatar noprompt commented on May 18, 2024

@danneu So I've never attempted to port something as large as Compass to Garden but I have ported a few grid systems. There isn't much I can give by way of advice except that when porting over @mixins or @functions to use hash maps as function arguments where ever possible (you're probably already doing that). Sass hasn't traditionally had support for something like hash maps so people end up writing those things with several arguments. Other than that I'd say the only way you can determine if a library is easy-to-use or not is to use it yourself.

Also WRT vendors, use the ^:prefix notation where ever it makes sense.

Trying to shave a yak.

If you're serious about about porting Compass, I'd be happy to help pitch in. You'd be doing a huge favor for folks.

from garden.

icambron avatar icambron commented on May 18, 2024

@noprompt

but I have ported a few grid systems.

Are there any open source grid systems written with Garden? I have simple needs and don't mind doing the work to port something, but I figured I'd check if something exists first.

from garden.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.