Skip to content

Why no style? (or animation)

jasononeil edited this page May 1, 2013 · 1 revision

Currently Detox provides no Effects, Animations or general Style type properties. That is, no fade(), slide() and none of these.

The reason for this is my understanding of separation of concerns:

  • HTML - Content
  • CSS - Style
  • JS (or Haxe) - Scripting and Interaction

I'd put animations, effects and general glitziness in the "Style" category, and think it therefore is best handled by CSS. This means your designer can just use CSS (or LESS or SASS or whatever), and program the nice-ness of the animations, without fiddling with your precious Haxe code.

More-over, CSS transitions should be faster than a scripted solution.

What I am okay with

Although it's not supported yet, I am okay with, and may implement at some point:

  • Helper methods that are tied to specific stylesheets (Eg. Dan Eden's animate.css http://daneden.me/animate/)
  • General CSS / Style reading: elm.style('display');
  • General CSS / Style manipulation: elm.setStyle('display', 'inline');, elm.setStyle(properties) ... I probably wouldn't get any more specific with the helper methods though.
  • Style information functions: elm.pos(), elm.innerWidth() etc.

If you want any of these things, or want to argue with me, feel free to open an issue/feature request and ask!

Clone this wiki locally