Comments (7)
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.
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.
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.
@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.
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.
@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 @mixin
s or @function
s 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.
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)
- defcssfn don't behave as documented HOT 2
- Incorrect CSS emitted for inner media queries HOT 6
- Link broken for Tutorial and example in Wiki HOT 6
- how to supply the value to grid-template-area? in css it is multiple strings... HOT 3
- Changelog since 1.3.6 HOT 1
- Property order is different in output CSS, renders incorrectly in browser HOT 7
- `as-hex` taking into account Alpha value
- No `fr` unit
- Question about defining multiple style maps HOT 6
- Add support for container queries HOT 3
- Incorrect CSS emitted for "&" parent selector
- defcssfn is not defined in cljs or cljc
- `ClassNotFoundException` thrown when running tests on Java 11
- Warning about `garden.color/abs` shadowing `clojure.core` output when using Clojure 1.11.0 HOT 1
- `::marker` pseudo element isn't supported HOT 2
- Release request, to prevent repeated shadowed-var warnings in the REPL HOT 13
- Incorrect handling of selectors HOT 1
- Incorrect css generation HOT 1
- content: " " produces wrong output HOT 5
- Feature request: Support for cascade layers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from garden.