Tuesday, June 23, 2015

Fancy tabs using pure CSS and AngularJS

I'll start this post with demonstration of what I mean by "fancy"
One way to do that, would be using a predefined image for each tab for each state. 
As you can see from the pictures above, it would be 4 separate images cut to fit specific dimensions. 
Downsides of this approach would be:
  1. Resizing of these tabs won't be possible,  if you try to do so, you will definitely change the triangular part angle 
  2. Downloading pretty big images might be noticeable
  3. Adding effects on tab swap will look clunky
On the positive side, I would put only the ease of implementation.

After playing a while with CSS options and adding some AngularJS wiring  (my application is using AngularJS so it was necessary), I came up with following solution:

This code snippet shows how to create two tabs control with triangular inner side of the tab. The tab swapping powered by AngularJS, of course it can be done using JQuery or any other JS library.
Note:
A proper way to do that would be creating a directive, that will support multiple tabs, but currently I'm a bit short of time. 
This solutions seems to be working for me, I've removed most of the unnecessary content to keep the code clean.

Thursday, June 11, 2015

Very nice site http://www.cssmatic.com/. It allows you to visually define some of the CSS features and copy the resulting stylesheet.
I've used it to define an appropriate shadow for a tab control I've had to develope for my company. 

Monday, March 23, 2015

Some time ago I've stumbled upon very clean design concepts defined by Google, named Material design.
Today I've had to create a dashboard where one of the components would be a Table displaying some cost related information.
Since I'm working with AngularJS I've looked into Angular Material project for inspiration (I haven't migrated my projects  to work with this framework yet). I was surprised to find out that simple table\grid has nor design guidelines neither implementation. After some googling   I've found this solution . It's very clean and professional looking table design. All I had to do was just to take whole css content from attached codepan and apply i to my table. IMHO it looks great.
I've forked it to a GIST , feel free to borrow and use.