Giter VIP home page Giter VIP logo

Comments (7)

jeluard avatar jeluard commented on May 18, 2024

How about :

(defn padding
  [t r b l]
  {:padding [[(px t) (px r) (px b) (px l)]]})

Or you could probably make it unit agnostic.

from garden.

ccfontes avatar ccfontes commented on May 18, 2024

So the value of padding is a vector of a vector. looks strange, but I'm sure there were strong reasons!
How about the generator? Any idea?

from garden.

jeluard avatar jeluard commented on May 18, 2024

Well I guess the reason is there need to be some syntax to differentiate between the various CSS form you can find. See more details here.

In the linear-gradient case you could mix nested and non-nested vectors:

{:-moz-linear-gradient ["top" ["#a90329" (percent 0)] ...]}

from garden.

noprompt avatar noprompt commented on May 18, 2024

@ccfontes Yes, it does look strange but that was the best idea I had when coming up with a way to represent the difference between comma and space separated lists. If you want you can write a function or macro to clean that up.

(defmacro defproperty [name]
  `(defn ~name [& params#] 
      {'~name [params#]}))

(defproperty padding)

(padding [0 1] [2 3]) 
;; => {padding [([0 1] [2 3])]}

Edit: Paste fail

from garden.

ccfontes avatar ccfontes commented on May 18, 2024

Nah.. it's awesome!

from garden.

noprompt avatar noprompt commented on May 18, 2024

@ccfontes There are also some other examples (unrelated) here.

from garden.

ccfontes avatar ccfontes commented on May 18, 2024

Thanks!

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.