Friday, June 6, 2014

Folder-like html nested lists & Create your own CSS Icon Font

Recent trend saw the rise of mobile technology. In order to accommodate it, websites have to cater mobile users as well. Bootstrap, the most popular front-end framework for developing responsive, has take to web development to a more elegant way. At the same time, Icon Font has rode along the wave. Two major popular clans of Icon Font is Glyphicons & Font Awesome. Icon Font comes with a lots of benefits, eg, size, color, shape. Why it has such advantages? Reads more.

I involved in a website, where one of the requirement is to create Folder-like html nested lists. There's some trick to do it, some have introduced at:
1) using image (simple)

2) CSS background property (a bit imagination requires)

So far no issue, but to apply them on HTML with bootstrap, it really takes a bit extra of time, especially for those people that are not good in CSS, like me. I was looking fast-and-clean approach, something like CSS Icon Fonts, but built-in Glyphicons & Font Awesome does not come with it, Goggling other existing icon font also yields no result.

Then I bumped into this website, fontastic, prompting the idea of creating my Icon Font. From here, I found out that it needs .svg file to create icon font. SVG defines graphics in XML format. Now you know why Icon Font can be sized, since it's vector image. Thus I pick-up the tool, svg-edit, I used before in this post, and start creating the asset. Let's begin.

1) Download the "svg-edit", extract the zip file and click "svg-editor.html" to load the editor.
2) You'll be welcomed with default blank canvas. Click on the "Rectangle".


3) Try to create something like this. As you can see, I create the vertical rectangle over the size of the canvas. If i create with exact fit, it'd be far too small when Icon Font generated later, could be padding or margin issue. Try it yourself. And I found out that the color does not matter now.


4) When you done, save the file, let's say "m.svg". You can click on the "SVG", and reveal the svg content.



5) Now the asset is done. Let's go to create the Icon Font at fontastic.
6) Select "Modify Font" if it default to it, else create new font.



7) Give a descriptive name, this will be the name use in html.


8) Now we import the "m.svg" created early.


9) Import successful!


10) Preview of our Icon Font. It still looks weird, huh? Bear for while, click "Change set name".

 11) Change the set name



12) Click this set to add to your font, and you can see you have "1" ready to publish.


13) Click "Publish" tab and click the "Manual Download" button.


14) Now you can prepare to add it to your HTML. Let's use one of the very nice bootstrap menu library, metisMenu.

15) Download it's js library and sample. Add these few lines into the sample html provided by metisMenu.

  

This CSS is for adding extra second-level indentation.


Add this HTML to all the nested list "li" , and it is for adding the Icon Font generated.
  

16) Yeah, a nice folder-like html nested lists you got by now! You can download the source here.


p/s: When you use this Icon Font in Google Chrome browser, you might experience some weird issue. I think Google Chrome use some scaling technique to adjust the web content, so when you enlarge the browser to a special size like "110%", it skewed.


So, you have to apply the fix, for more please follow this link.
@media screen and (-webkit-min-device-pixel-ratio:0) {
 @font-face {
 font-family: 'startcoding';
 src: url("fonts/startcoding.svg#startcoding") format("svg");
 }
}

12 comments:

Unknown said...

For deletion or handling of long name i check that "Long Path Tool" software should be try, many articles refer this for such solutions.

George Morgan said...

I have read this article it is really helpful for getting amazing tips on related topic. You have described everything in a professional way.

Crystal Tech Solution is buffalo seo company that provides professional digital marketing service for developing your business.

Moin khan chouhan said...

CodingHoliday Camps - We provide the best online learning coaching for Stem Education Coding in Singapore. Get the best online Stem Education Coding for your kids.

harunrashiod said...

Coding

Holiday Camps - We provide the best online learning coaching for Stem Education Coding in Singapore. Get the best online Stem Education Coding for your kids.

to get more - https://www.bricks4kidz.com.sg/

chiku said...

Sora paper premium blogger template jiska price 10 $ hai lekin mein aap sabhi ko free mein de raha hu kyuki mein nhi chahta newbie blogger ko koi pareshani ho jo mujhe huyi thi or crack theme apne blogger se hata do warna rank karne mein bohot mushkil hoga maine bhi hata diya hai ye wala theme use karo AMP version hai or bohot Fast hai

Sorapaperpremiumbloggertemplate and please put my premium template links in your article

Blogger said...

Strange "water hack" burns 2lbs overnight

At least 160k men and women are using a easy and secret "liquids hack" to burn 2 lbs every night as they sleep.

It's simple and it works every time.

Just follow these easy step:

1) Hold a drinking glass and fill it up half full

2) Now do this amazing hack

and you'll become 2 lbs skinnier when you wake up!

larry said...

Great post.
https://www.producthunt.com/@victor_hall

Five Fingers Exports said...

Five Fingers Exports is the leading manufacturers of non woven bag making machine, offset printing machine, paper bag printing machine, PP woven sack making machine, non woven roll slitting and sheet cutting machine in India at the lowest cost.

Tidak Boleh Kosong said...

1.LIVE22
2.SLOT LIVE22
3.ACE333
4.AGEN ACE333
5.CASINO ONLINE
6.SBOBET
7.AGEN SBOBET
8.MAXBET
9.AGEN MAXBET
10.AFB88
11.AGEN AFB88
12.M8BET
13.AGEN M8BET
14.TOGEL ONLINE
15.AGEN TOGEL ONLINE
16.BOLA TANGKAS
17.BOLA TANGKAS ONLINE
18.TEMBAK IKAN
19.TEMBAK IKAN ONLINE
18.FREE LIVESCORE
19.Agen Casino Live22 Tepercaya – ASIANBET77
20.BANDAR BOLA TERBAIK DAN TERPERCAYA

Onroadz Car Rental said...

Our Onroadz provide you with the best self drive car rental services in Chennai, Coimbatore, Madurai, Trichy, Salem, Theni, Mysore, Vizag, Vijayawada and so on. You can rent any kind of makes and models at very cost-effective prices.

Self drive car hire in Chennai
Self driving rental cars in Coimbatore
Self drive car rent in Madurai
Self driving car in Trichy
Self driven cars in Theni
Self drive rental car in Vizag
Self driving car rentals in Vijayawada
Self driving car for rent in Mysore
Self drive cars for rent in Salem

Senco India said...

Sre Senthil Engineering company (SENCO) manufactures and supplies the most reliable pressure sand filters and activated carbon filters all over India. The manufactured filters are vastly known for their effective performance and long-lasting capability features. We are well known as iron removal plant manufacturers in india!

Navish Tours And Travels said...

I have read this article it is really helpful for getting amazing tips on related topic.call taxi services in trichy
"