css

For all your CSS related content...
meow 2015-06-17T02:03:22.000010Z

hello @domkm and @pri :simple_smile:

meow 2015-06-17T02:03:50.000011Z

@pri: I'm quite interested in your work with CSS and grid systems.

pre 2015-06-17T02:05:00.000012Z

@meow: thanks, I’ve been slowly making progress though it’s still a mess now

pre 2015-06-17T02:05:46.000013Z

Do you have experience working in Garden

meow 2015-06-17T02:06:13.000014Z

Sometimes I make better progress if I give myself permission to knowingly create a big mess that I can then clean up over time. Seriously. Gets me over that hump. :simple_smile:

pre 2015-06-17T02:06:47.000015Z

True, that’s how I’ve been rolling too: keep pushing on git, until it makes sense

meow 2015-06-17T02:06:58.000016Z

I have a tiny bit of experience with Garden.

meow 2015-06-17T02:07:58.000017Z

I've been working with clojure for about 4 weeks now, coming most recently from QML and Python and too many years of too many other non-lisp languages.

pre 2015-06-17T02:08:26.000019Z

You’re on the right track then

meow 2015-06-17T02:08:44.000020Z

Learning as quickly as I can.

pre 2015-06-17T02:09:16.000021Z

For those who’re new to css in Cljs, I’m working on a garden based lib called Mesh - https://github.com/facjure/mesh

meow 2015-06-17T02:09:39.000023Z

Yes, I have looked at mesh and mala.

meow 2015-06-17T02:10:33.000024Z

Like I said, I'm quite interested in your work. :simple_smile:

pre 2015-06-17T02:11:21.000025Z

I should get something usable out next month, starting with v0.4

meow 2015-06-17T02:12:42.000026Z

I'm exploring various approaches to Reactive single page apps here: https://github.com/pkobrien/ing

meow 2015-06-17T02:13:46.000028Z

This one, for example, does a basic flexbox with the css coming from garden: https://github.com/pkobrien/ing/blob/master/styling/src/app/core.cljs

pre 2015-06-17T02:14:32.000029Z

nice

meow 2015-06-17T02:15:51.000030Z

You should recognize the set-stylesheet fn since I stole it from you... 😉

meow 2015-06-17T02:17:53.000032Z

Though I think I changed the name - iirc yours was insert-stylesheet or insert-styles

pre 2015-06-17T02:19:12.000033Z

ha

pre 2015-06-17T02:19:45.000034Z

Do you know if there’s a way to unset a stylesheet?

meow 2015-06-17T02:20:53.000035Z

Interesting question. Not sure. Remove the element from the header and refresh the DOM somehow?

pre 2015-06-17T02:21:25.000036Z

I thought about it, seems slow

meow 2015-06-17T02:22:13.000037Z

I never learned more js than I had to and haven't done browser apps recently so I'm still getting up to speed on react and dom manipulations.

meow 2015-06-17T02:25:57.000038Z

I did notice something in mesh today that I was going to ask you about since I was looking for examples of code using Garden's defstyles macro and it seemed like maybe mesh was calling (list ...) inside (defstyles ...) unnecessarily, such as here: https://github.com/facjure/mesh/blob/master/examples/grids/styles.clj

meow 2015-06-17T02:27:08.000039Z

But I just learned about defstyles, your code came up in my search on github, then something else distracted me and I hadn't gotten back to it yet.

meow 2015-06-17T02:30:48.000040Z

I'm also wondering if garden supports the combinators such as mentioned here: http://www.planningforaliens.com/blog/2013/04/28/grokking-css-combinators/. I'm thinking they aren't supported and, contrary to that article, its probably a good thing if I avoid those advanced forms of crazy selectors and keep things simple.

meow 2015-06-17T02:33:12.000041Z

About the only thing I'm sure about at this point is that I want to keep all my css generation inside of cljs without writing out to a .css file if at all possible. Then the question is what should go into the stylesheet for the document and what should go into the style attribute of the component and how that all works properly with React.

pre 2015-06-17T02:40:04.000042Z

thanks for the tip, fixed!

pre 2015-06-17T02:42:14.000043Z

I prefer coding css in cljs and would avoid generating .css files. Organizing a hierarchy of styles for page->components, and ensuring the styles are scoped is still an unsolved problem.

meow 2015-06-17T03:02:14.000044Z

@pri: np. It does seem like css organization is a challenge. With that in mind I liked the look of garden's macros so I went looking for good examples of code using them and added several to this file: https://github.com/pkobrien/ing/blob/master/styling/src/app/core.cljs

meow 2015-06-17T03:03:12.000045Z

I also just added a defrule for each of the "big" semantic elements like body, header, footer, aside, article - seemed like the best place to start.

meow 2015-06-17T03:04:11.000046Z

Not sure if it makes sense to try to collect some kind of canonical list of these into a shared library - any thought on that?

meow 2015-06-17T03:05:18.000047Z

What's in that file now is just a mess of what I found in the wild.

pre 2015-06-17T03:05:56.000048Z

I have a similar example in mesh. The challenge is defining scope and ensuring components’ styles aren’t overridden by others. Currently, this isn’t possible in CSS, as you know CSS is inheritance-based.

pre 2015-06-17T03:06:42.000049Z

Developers in React/Postcss seem to be moving towards inline styles

meow 2015-06-17T03:10:15.000050Z

When I first learned css way back when it seemed pretty cool and powerful. Which it is. And then I also learned what a nightmare it really is. Then I didn't do web stuff for several years. Now that I'm back into the web stuff with cljs and react I really have no desire to allow css to be anything more than the simplest possible thing it can be.

meow 2015-06-17T03:11:43.000051Z

And I am familiar with the fact that React folks seem to favor inline styles but I don't know much more than that, and I'm not sure how that translates into our cljs/garden world.

meow 2015-06-17T03:13:09.000052Z

Sure, its just a style attribute, but how will that scale up? Which is why I'm creating these sample apps so I can start small and see how things fall out as the apps grow in complexity.

pre 2015-06-17T03:13:40.000053Z

It’s a good start. Keep posting your updates so we can learn, together

meow 2015-06-17T03:16:53.000054Z

I'd be happy to do so. I was quite inspired by the video of your presentation. Some of the first database apps I worked on back around 1990 or so were used to publish print directories. So I learned a lot about typography and page layout and when I look at what you are working on it reminds me of all that stuff, which I really enjoyed.

pre 2015-06-17T03:22:06.000055Z

Print design has over a century of modern knowledge that we can tap into. I’m glad you’re thinking in the same lines ...

meow 2015-06-17T03:26:53.000056Z

Before I really dive into flexbox, which I plan to do tomorrow, I'm curious to know your opinion of it. Is it good? Any limitations or problems with its use in cljs?

meow 2015-06-17T03:28:02.000057Z

And if you need a guinea pig for any of the stuff you are working on I would be happy to be an early user/adopter/tester if you want one.

pre 2015-06-17T03:28:54.000058Z

I haven’t tried flexbox much, except an example using with flexboxcss - https://github.com/priyatam/thinking-grids/tree/master/flexbox

meow 2015-06-17T03:29:02.000060Z

You're much further along with all of this than I am.

pre 2015-06-17T03:30:41.000061Z

Here’s a test I do: Can I explain flexbox to a graphic/print designer who has never written CSS? If the answer is no, I get back to work.

meow 2015-06-17T03:34:44.000062Z

Well, hopefully I'll get to really dive into this tomorrow.

meow 2015-06-17T03:36:17.000063Z

re-com has a nice-looking demo that makes use of flexbox: http://re-demo.s3-website-ap-southeast-2.amazonaws.com/

meow 2015-06-17T03:37:11.000064Z

and it uses re-frame so its a reactive app as well

pre 2015-06-17T03:38:38.000065Z

I’ll check it out, thanks.