{"id":24594289,"url":"https://github.com/nilern/gssrden","last_synced_at":"2025-04-30T13:12:51.982Z","repository":{"id":20491791,"uuid":"23770029","full_name":"nilern/gssrden","owner":"nilern","description":"A GSS plugin for Garden","archived":false,"fork":false,"pushed_at":"2014-09-10T18:29:50.000Z","size":216,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T16:22:40.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/nilern/gssrden","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nilern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-07T20:21:58.000Z","updated_at":"2020-05-02T21:04:16.000Z","dependencies_parsed_at":"2022-09-09T11:40:53.408Z","dependency_job_id":null,"html_url":"https://github.com/nilern/gssrden","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fgssrden","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fgssrden/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fgssrden/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilern%2Fgssrden/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilern","download_url":"https://codeload.github.com/nilern/gssrden/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251711288,"owners_count":21631293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-24T11:14:16.898Z","updated_at":"2025-04-30T13:12:51.945Z","avatar_url":"https://github.com/nilern.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"GSSrden\n=======\n\nA [GSS][gss] plugin for [Garden][garden].\n\nInstallation\n------------\n\n### Leiningen\n\n````clojure\n[gssrden \"0.2.0\"]\n```\n\n### Gradle\n\n```\ncompile \"gssrden:gssrden:0.2.0\"\n```\n\n### Maven\n   \n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003egssrden\u003c/groupId\u003e\n  \u003cartifactId\u003egssrden\u003c/artifactId\u003e\n  \u003cversion\u003e0.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nUsage\n-----\n\nInstall GSS as detailed [here][gss-install]. Direct your Garden-produced CSS\ninto a `.gss` file (say, `resources/gss/screen.gss`) and link to it as detailed \nin the GSS installation, i.e.\n\n```html\n\u003clink rel=\"stylesheet\" type=\"text/gss\" href=\"gss/screen.gss\"\u003e\u003c/link\u003e\n```\n    \nor [Hiccup][hiccup] and similar templates:\n\n```clojure\n[:link {:rel \"stylesheet\", :type \"test/gss\", :href \"gss/screen.gss\"}]\n```\n\nFor Hiccup in particular, there is also a helper function, include-gss:\n\n```clojure\n(gssrden.core/include-gss \"gss/screen.gss\" \"gss/colors.gss\")\n```\n   \nIn addition to that Hiccup helper, the GSSrden API consists of just the \n`constraints` macro, which can be used like this:\n\n```clojure\n(ns super-responsive.styles.screen\n  (:require [garden.def :refer [defstyles]]\n            [gssrden.core :refer [constraints]])\n           \n(defstyles screen\n  [:body\n    (constraints\n      (== :width (:window :width))\n      (== :height (:window :height)))\n    {:background-color \"red\"}])\n```\n       \nIf you are on ClojureScript, you will have to use `:require-macros` instead.\n\n### The constraints macro\n\n`constraints` takes a number of constraint expressions and turns them into a \nvalid Garden property map whose keys are GSS properties and values GSS \nconstraint strings:\n\n```clojure\n(constraints\n  (== :width (:body :width)\n      :strength :medium\n      :weight 1000)\n  (\u003c= :height (- (/ (:parent :$col-width) 2) :$my-var 15)\n      :strong))\n;=\u003e \n{:width \"== body[width] !medium1000\"\n :height \"\u003c= (::parent[$col-width] / 2 - [$my-var] - 15) !strong\"}\n```\n\nThe constraints can take the following forms:\n\n* `(eq-operator property goal-expression)`\n* `(eq-operator property goal-expression :strength strength :weight weight)`\n* `(eq-operator property goal-expression :s strength :w weight)`\n* `(eq-operator property goal-expression :strength strength)`\n* `(eq-operator property goal-expression :s strength)`\n* `(eq-operator property goal-expression strength weight)`\n* `(eq-operator property goal-expression strength)`\n* `(center-in center-target)`\n* `(fill fill-target)`\n* `center-in` and `fill` with strength and weight specified just like for\n the other forms.\n\nWhere eq-operator is an (in)equality operator symbol, property is a GSS\nproperty (a Garden key) and goal-expression is a linear function of the\nproperties of certain elements and GSS variables. As described in the\n[GSS CCSS documentation][ccss-doc], strength can be one of\n\n* `:weak` / `\"weak\"` / `weak`\n* `:medium` / `\"medium\"` / `medium`\n* `:strong` / `\"strong\"` / `strong`\n* `:require` / `\"require\"` / `require`\n\nand weight is just an integer.\n\nYou can get a property prop of element elem like this: `(:elem :prop)`.\n\n`center-in` and `fill` are sugar inspired by QML and are simply\n\n```clojure\n(= (constraints\n     (center-in :parent))\n   (constraints\n     (== :center-x (:parent :center-x))\n     (== :center-y (:parent :center-y))))\n```\n\nand\n\n```clojure\n(= (constraints\n     (fill :parent))\n   (constraints\n     (== :center-x (:parent :center-x))\n     (== :center-y (:parent :center-y))\n     (== :width (:parent :width))\n     (== :height (:parent :height))))\n```\n\nIn GSSrden custom constraint and element variables are keywords beginning\nwith $: `:$my-var`. The special pseudo selectors are provided as the\nkeywords `:window`, `:this` and `:parent`. You can use intrinsic properties\nexactly like in GSS, by prefixing with intrinsic-: `:intrinsic-height`.\n\nNote that due to the output being a map, it is not possible to declare\nmultiple constraint for a single property in one `constraints` form. You also\ncannot do non-constraint property assigments in a `constraints` form (this is\nintentional). Since a Garden rule can contain multiple maps, you can instead\ndo this:\n\n```clojure\n[:li :a\n  (constraints\n    (\u003e= :line-height 16))\n  (constraints\n    (\u003c= :line-height (/ (:window :height) 2)))\n  {:color \"purple\"}]\n```\n      \nSee the included tests and [Marginalia][marginalia] documentation for more \ninsight into the inner life of GSSrden.\n      \nFuture plans\n------------\n\nThe rest of GSS:\n\n* Support `@stay`\n* Add [VFL-like sugar][vfl-doc]\n* Support [@if and @else][ifelse]\n\nThe lack of raw CSS directive support in Garden complicates these tasks.\n\nKnown issues\n------------\n\nSymbols won't work as element, property or variable names. Using them would risk\nconfusion anyway, so this is not of high priority.\n\nLicense\n-------\n\nCopyright © 2014 Pauli Jaakkola\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n\n[gss]: http://gridstylesheets.org/\n[garden]: https://github.com/noprompt/garden\n[gss-install]: http://gridstylesheets.org/usage/\n[hiccup]: https://github.com/weavejester/hiccup\n[ccss-doc]: http://gridstylesheets.org/guides/ccss/\n[marginalia]: https://github.com/gdeer81/marginalia\n[qml]: http://en.wikipedia.org/wiki/QML\n[vfl-doc]: http://gridstylesheets.org/guides/vfl/\n[ifelse]: http://gridstylesheets.org/guides/ifelse/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilern%2Fgssrden","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilern%2Fgssrden","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilern%2Fgssrden/lists"}