Toolkit: A Front-End Framework for the Modern Web

Originally published at: http://www.sitepoint.com/toolkit-front-end-framework-modern-web/

Titon Toolkit, or simply Toolkit, is a project that I’ve been working on in my free time for the past 4 years. It started out as a MooTools UI framework, which slowly transitioned to jQuery, with plans to be vendorless for 3.0. So why did I write another framework? At its inception, the world of “CSS/JavaScript frameworks” was still young, with Bootstrap and Foundation being about a year old. I was intrigued with the concept of a front-end framework and set out to build my own, with the main selling point being customizability and extensibility.

So, what is Toolkit exactly? Toolkit is a front-end framework that provides a collection of powerful state-based, role-specific user interface components and utility classes for the responsive, mobile, and modern web. It makes use of the latest and greatest in technology — HTML5 for semantics, CSS3 for animations and styles, Sass for CSS pre-processing, Gulp for task and package management, and powerful new browser APIs for the JavaScript layer, just to name a few.

Titon Toolkit website

The core of Toolkit is based on strict but important design principles, which include responsive design, mobile-first design, semantic markup, progressive enhancement, graceful degradation, continuous integration, and configuration over convention. These principles ultimately shape the decisions behind Toolkit.

So, is Toolkit just another front-end UI framework? Yes but, as mentioned, with some key differences: Toolkit was built to be extremely extensible, easily customizable, and efficiently architected.

Let’s look at some of its unique features.

Decoupled JavaScript, CSS, and HTML

A running paradigm in front-end development is tying JavaScript to a fixed CSS structure via class names as well as a fixed HTML structure. Toolkit disagrees with this approach and strives to decouple the CSS, JavaScript, and HTML as much as possible, which opens up the possibility of customizable alternatives. Toolkit mitigates many coupling issues by requiring specific data attributes — all of which are used for element traversal, look-up, and event binding.

The following example uses Toolkit’s carousel component as a proof of concept.

<div class="carousel" data-carousel>
  <div class="carousel-items">
    <ul data-carousel-items>
      <li>...</li>
      <li>...</li>
      <li>...</li>
    </ul>
  </div>

  <button type="button" class="carousel-prev" data-carousel-prev>
  </button>
  <button type="button" class="carousel-next" data-carousel-next>
  </button>
</div>

With decoupling in place, custom HTML is now possible, which isn’t the case when using alternative frameworks. No longer is the markup tied to the JavaScript component; the JavaScript component is now tied to the markup via data-* attributes. Want to add new markup to a component? Go for it! Want to change the markup to match the project? Feel free! Want to remove component functionality? Remove away! Data attributes provide what we think is a much better level of customization.

Continue reading this article on SitePoint
3 Likes

Shameless self-promotion, nice.

It’s an article published on SITEPOINT about a front-end development framework that will benefit the community. Open source at that. Hardly promotion.

It was by request of the SitePoint staff.

Thanks for taking the time to read it though. :thumbsup:

1 Like

Although I don’t have any plans to use this framework in my project at the moment because I have to learn and use Bootstrap for it, I felt this is concise, simple and well-designed when I checked the official web site. So I forked toolkit at github. I want to try it on ruby on rails.
One question: are there any compatibility problems with other frameworks, such as compass or susy?
thanks.

I did read the article, and was a good article, but doesn’t mean my statement isn’t still true.

You are missing the point :persevere:

Sitepoint wanted an article published on Toolkit. What does it matter that the author of the framework did the article? He gives more insight.

I, along with everyone else, fails to see what point you are trying to make.

1 Like

I’m cool if you want to believe that it is self-promotion… because, you are right. And of course, it is shameless! Because SP asked for it. And since SP asked for it. It is NOT spam.

So we will agree that this si self-promotion but not spam.

Now, I think that’s clear so we can go back to discussing what’s important… the project itself :smiley:

@milesj Loved the article, nicely written and direct. And it does look like a very interesting project… But I do confess that with so many frameworks out there, I doin’t know if to give it a try or not… Call me lazy but right now I just can’t choose what framework is better for what :smiley:

I’m sure that there has been quite a bit of learning for you after developing it for four years. And I bet you’re proud of the result. It looks really cool.

But now the I “know” the author, maybe I will push myself a bit harder and give it a try :smiley:

Or maybe I’ll need a bit of more convincing :wink:

2 Likes

There should be no collision when using with Compass, especially as a Compass extension (I use this approach in my own projects). The same could be said for Susy but I haven’t tested them in the same project before.

However, If there ever are collisions, mainly with class names, they can be customized and changed on Toolkit’s end.

1 Like

Honestly, thanks for reading the article. I appreciate it.

I do agree that this article is a self promotion type of article, but I wouldn’t label it shameless. I shouldn’t be ashamed of my work, or this article, as I’m simple talking about it, not forcing anyone to use it. Just my two cents.

2 Likes

I definitely agree with where you’re coming from, but if you ever want to try something new, why not Toolkit! Thanks for the support!

1 Like

Supporting you is easy. The article is well written and engaging. :wink:

I’m curious though… What do you feel that it would be Toolkit’s hardest competitor? Do you think about what others do when you upgrade it? Or is Toolkit more a vision of how to build a website?

Sorry if I’m asking too much. :smiley:

I do have a small project coming up so I will think about using it although I don’t know if it will be possible at all because it involves shopify and these type of sites have their own templates so I’m not sure how to ingretate it

I’m the editor for the HTML/CSS content and I can tell you right now that we don’t have enough of this type of “self promotion”. I would love it if more framework, library, plugin, and tool authors would write honest, down-to-earth articles on their experience building their projects and how those projects can help developers. When the tool is open source, it’s hardly “shameless”. In fact, we pay for these articles just like any others.

Of course, that doesn’t mean we only want promo articles. We aren’t going to publish too many like this, but I don’t think we do enough of these. Anything to help new tools get noticed is more than fine by me.

7 Likes

I fully agree with you. The article is very well-written and it all makes sense. I didn’t think this was going to spark this kind of response, but I can’t say I don’t like it. I think it’s great.

No problem, don’t worry about it. And just to be clear: I kind of took your comment to be somewhat half-joking anyhow, so I don’t think it’s a big deal. You did say “nice” so to me you were saying “good job, self promoting is shameless, but that’s ok”… Maybe @RyanReese was a little overly sensitive on this one. :wink:

3 Likes

The bottom line is that it’s an interesting article and a cool piece of work. Win, win!

For others who’d love to showcase their work, the forums have a Showcase category for this very purpose. :slight_smile:

First off, to call this “shameless self-promotion” is disingenuous. Besides, when someone has put this much effort to something - in their free time, no less - they’re quite entitled to shout about it!

As for the framework itself. I’ll be honest, my first thought was predictable - “another front-end framework?!?”. But then I looked at it in more detail, and I like a lot of what I see.

I’d like to make some comments and observations in list-form, if I may?

  • I’m not all that keen on some of it visually, but that’s a moot point - since it’s so customisable. I love that the styles are primarily structural, which should make it much easier to style and make unique.

  • Having said that, the demo site might benefit from having alternative “themes” to look at; partly because really good-looking examples will “grab” people, partly because it demonstrates the flexibility.

  • My biggest bug-bear about a lot of JQuery plugins and the like is that they force very specific markup structure on you. Things like carousels in particular. If Toolkit provides more flexibility, that’s a great plus-point in my book.

  • The JS being class/component based is great.

  • In fact, modern approaches all round. I particularly like the fact that it uses CSS3 animations where possible.

  • From a personal point-of-view, being RequireJS-friendly is a big plus point. No shims for Backbone work, which is great!

  • Again personal preference, but being SASS-based rather than Less is alright by me!

  • Personal preference once again, but I’d have preferred Grunt to Gulp - but you can’t please everyone!

  • Lastly, if there’s one thing I think might really help the accompanying website, it’s trying to cram as many of the components and styles onto a single page as possible, to make it easier to see what it offers at a glance; having a drop-down and forward/back arrows to browse through the framework is good for viewing components in isolation, but a “single page demo” would, I think, make it more accessible.

Overall though, really good work!

2 Likes

@molona - I’d say that Bootstrap and Foundation are the biggest competitors, simply because the feature sets are very similar. However, I’d say that Toolkit’s unique features (JS classes, CSS namespaces, etc), is what will really set it apart.

When working on Toolkit, I take a lot of inspiration from fellow open source projects and developers. I’m constantly iterating and improving on the code base as technology moves so quickly.

@lukaswhite - I’m actually in the process of a new titon.io design that will be accompanied with a new, more advanced demo system. Right now, the demo is a bit sub-par, but it’s actually the testing suite I use for development, which can be seen here: https://github.com/titon/toolkit-tests

I appreciate all the feedback! I’ll definitely keep it in mind for 3.0.

Nice article…the framework by it selves looks really awesome although the website is just too crowded…hard to find your way around…I can see how it benefits developers searching for a certain functionality although if you see it for the first time…if it wasn’t because of your article I would just close it without giving it much thought…right now I am considering though using it for some smaller project :slight_smile: