Bower_component, como funciona?

17 views
Skip to first unread message

ToniRezende-SP

unread,
Jun 29, 2015, 9:50:09 AM6/29/15
to nod...@googlegroups.com
Estou usando o BootStrap e com sua instalação veio o Bower_component com vários arquivos em less.
Minha dúvida:
1 - editando os arquivo Less no bower, ele compila o  css ou tenho de fazer manual.
2 - posso aplicar direto o código less nas páginas?

Aria Stewart

unread,
Jun 29, 2015, 10:13:32 AM6/29/15
to nod...@googlegroups.com
Two things -- this list is an English language list, but let me see if I can help.

It sounds like you're asking about bootstrap, which comes with a bower_component folder, and whether you have to compile that less if you modify it, and can less be directly applied to an HTML page?

So first -- the fact that bower is involved doesn't seem relevant. It's another package manager, mostly just downloads web components and puts them in the bower_components folder if you run "bower install".

There are less files in the bootstrap distribution -- that's its native form, how it's written. However, browsers can't understand that without one of two things.

Either the less has to be compiled to css with lessc, then the browser uses that, or you load the less in the browser and you run the less compiler as included javascript. That's better for development, since it will affect the load time significantly.

If you edit the CSS properties in the browser, there's no support for updating the less file from that. You have to copy any modifications into the source.

So, TL;DR: compile your less with lessc, it's a manual process.

Aria

Reply all
Reply to author
Forward
0 new messages