Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

New in Nikola v6 part V: LESS is more

I am plan­ning to do a ma­jor re­lea­se (ver­sion 6!) of Niko­la my sta­tic blog and si­te ge­ne­ra­tor the next weeken­d. It's a ma­jor ver­sion be­cau­se the­re has been a ton of fea­tu­re wo­rk do­ne. So, I wi­ll do a qui­ck se­ries hi­gh­li­gh­ting so­me of tho­se im­pro­ve­men­ts this week.

Today's Topic: LESS

Un­le­ss you are ha­ppy wi­th your si­te looking like strai­ght boots­trap (and you rea­lly should no­t) CSS goes a long way to­war­ds making your pa­ges look just the way you want them to.

The bad part is tha­t, if you ha­ve do­ne any CSS you wi­ll know CSS is a rea­ll­y, rea­lly cra­ppy "lan­gua­ge". Tha­t's why a who­le phi­lum of tools has been created that take a mo­re po­wer­ful syn­tax and ou­tput CSS.

Niko­la now has su­pport for one of the­s­e, ca­lled LE­SS (al­thou­gh adding su­pport for others like SASS should be ve­ry ea­s­y).

So, how does it wo­rk?

  1. In your the­me, put LE­SS fi­les in the le­ss/ fol­de­r.

  2. Crea­te le­ss/­tar­ge­ts and put the­re the fi­les that should be com­pi­led using le­ssc, one per li­ne.

  3. The­­re is no step 3

Nikola will automatically build output/assets/css/foo.css out of theme/foo/less/foo.less and will even support the usual theme inheritance, so if there ever is a LESS-based theme out there, you can just tweaks the files you want.

I per­so­na­lly am not wri­ting that hy­po­the­ti­cal LE­SS-­ba­sed the­me, but I am mo­re than ready to help whoe­ver wan­ts to do one.

Brandon Rhodes / 2013-09-03 06:04:

In case people ask me about how, exactly, to choose between them: how did you decide on LESS?

ralsina / 2013-09-03 12:55:

well, the default theme is bootstrap-based, and bootstrap is less-based so it was mostly "by default" :-)


Contents © 2000-2023 Roberto Alsina