This is a really powerful idea and makes a lot of sense.
It's as flexible and readable as any CSS preprocessor I've seen, possibly more so because it's in a syntax I won't forget because I program in it all day.
And it's trivial to integrate into any JavaScript setup because it's just JavaScript. Brilliant!
When I get a chance, I am going to attempt thing that are impossible with SASS and LESS. There are things that are impossible such as using multiply and screen to create a button of an arbitrary gradient and color that looks good.
This is the first preprocessor that is capable of doing something other than just saving keystrokes.
Absolutely, and it takes CSS (preprocessors at least) closer to the LISP ideal of code is data and data is code.
Now that I've seen it, in hindsight I'm struck with several thoughts: 1) in hindsight it seems so obvious, 2) why didn't I think of this, and 3) LESS/SASS/Stylus/etc are obsolete.
I guess it's trying to be a more flexible version of LESS/SASS by leveraging the full power of JavaScript. I've never felt that LESS was really lacking in power... I'm curious what others think. But interesting idea.
One use case would be to create server-side 'widgets' just like Yesod does.
The basic idea is that they combine the document, style and scripting in a single reusable component. Pages are then built by composing these widgets together and can finally be used as templates when responding to requests.
I think it makes a lot of sense to build the features of Less/Sass etc on top of a well-known parser/interpreter (JS), rather than inventing a new one from scratch.
I already feel like I understand how AbsurdJS works better than I understand Less/Sass, for that reason.
Off the top of my head, order in CSS is only important when a property is defined multiple times for a given selector, either within the same block or in separate ones. Like these examples:
the only difference is using JSON and JS input vs. a CSS string, but he could have easily written that in less than 100 lines vs an entirely separate framework.
I like the idea. People should note that this doesn't mean mixing your CSS into your JavaScript necessarily - you can precompile CSS just like you would with S*SS.
It doesn't seem to handle vendor-specific prefixes (-webkit, -moz, etc). I suppose you could write your own mixins (plugins) to handle that, but still, a shame.
Hello guys. Thanks for the comments. The next things which I'm going to do is to start packing components. One of the big problems which I have for a long time, is the fact that I have to deliver html, css and javascript. Usually they are placed in different places and I have to take care to put them in the browser. With AbsurdJS I could send the javascript logic and the css together.
This seems like it would be good for filling a similar role to LLVM, providing a framework to take an object and turn it into CSS. I'm not so sure it makes sense as a language to directly use: JSON is nice as a data serialization format, but it's not very fun to author complex things in it.
[+] [-] lux|12 years ago|reply
It's as flexible and readable as any CSS preprocessor I've seen, possibly more so because it's in a syntax I won't forget because I program in it all day.
And it's trivial to integrate into any JavaScript setup because it's just JavaScript. Brilliant!
[+] [-] jcampbell1|12 years ago|reply
When I get a chance, I am going to attempt thing that are impossible with SASS and LESS. There are things that are impossible such as using multiply and screen to create a button of an arbitrary gradient and color that looks good.
This is the first preprocessor that is capable of doing something other than just saving keystrokes.
[+] [-] SkyMarshal|12 years ago|reply
Now that I've seen it, in hindsight I'm struck with several thoughts: 1) in hindsight it seems so obvious, 2) why didn't I think of this, and 3) LESS/SASS/Stylus/etc are obsolete.
[+] [-] krrishd|12 years ago|reply
[+] [-] jonnyscholes|12 years ago|reply
[+] [-] crazygringo|12 years ago|reply
...or is there some use case for CSS-in-your-JS that I can't quite manage to imagine? I'm straining my brain to think of one...
Edit: more info at http://davidwalsh.name/write-css-javascript
I guess it's trying to be a more flexible version of LESS/SASS by leveraging the full power of JavaScript. I've never felt that LESS was really lacking in power... I'm curious what others think. But interesting idea.
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] jeremiep|12 years ago|reply
The basic idea is that they combine the document, style and scripting in a single reusable component. Pages are then built by composing these widgets together and can finally be used as templates when responding to requests.
[+] [-] elros|12 years ago|reply
Also, https://en.wikipedia.org/wiki/JavaScript_Style_Sheets anybody? ;-)
[+] [-] latchkey|12 years ago|reply
[+] [-] paulannesley|12 years ago|reply
I already feel like I understand how AbsurdJS works better than I understand Less/Sass, for that reason.
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] padolsey|12 years ago|reply
[+] [-] tomjakubowski|12 years ago|reply
[+] [-] jongleberry|12 years ago|reply
the only difference is using JSON and JS input vs. a CSS string, but he could have easily written that in less than 100 lines vs an entirely separate framework.
[+] [-] todd3834|12 years ago|reply
EDIT: Krasimir Tsonev's article not David Walsh
[+] [-] Pirate-of-SV|12 years ago|reply
I guess I wouldn't bee too upset with CSS being replaced by json in the future. It makes sense in a way of using fewer languages.
On the other hand Javascript should probably be replaced by something better too.
[+] [-] nilved|12 years ago|reply
[+] [-] mrfancypants|12 years ago|reply
[+] [-] krasimirtsonev|12 years ago|reply
[+] [-] chadscira|12 years ago|reply
[+] [-] lux|12 years ago|reply
[+] [-] PLejeck|12 years ago|reply
[+] [-] underwater|12 years ago|reply
[+] [-] elwell|12 years ago|reply
[+] [-] caiob|12 years ago|reply
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] thenerdfiles|12 years ago|reply