Пример сборки
фронтэнда по взрослому.
Кто-то не жужжит
и просто меняет переменную в коде
библиотеки, быстро решая текущую проблему
ценой потери возможности обновлений в
будущем.
А кто-то
пользуется средствами сборки/пересборки
(компиляции), автоматом включая свои
патчи/кастомизации.
Approach
Here is the approach
I took to customize Bootstrap. I'm running on Ubuntu 14.10 Utopic
Unicorn 64-bit.
Use the Sass
version of Bootstrap. The standard Bootstrap project uses Less but my
limited knowledge of frontend technology tells me Sass (specifically
SCSS) is a better choice.
Install
Bootstrap using Bower. Bower is a tool used to install frontend
packages.
"What's
bower?" "A package manager, install it with npm."
"What's npm?" "A package manager, you can install it
with APT" "What's APT?" - adapted from Stefan
Baumgartner's tweet
An alternative
is to just download Bootstrap and add it to your project. I chose
Bower because I wanted to be like the cool kids from 2 years ago and
it would be nice to upgrade my libraries with a simple command.
Commit the
bower_components directory to git. Alternatively you can leave
bower_components out of git and use something like grunt-bower-task
or grunt-bower-copy to copy stuff from bower_components into your
project. I chose to commit bower_components to git so that I wouldn't
need an extra grunt task. The downside is that I have big long ugly
paths in my bootstrap.scss file.
Override
Bootstrap's Sass variables, remove unneeded components, and combine
Bootstrap with my site's stylesheet using Sass @imports.
Compile the Sass
SCSS files to CSS using grunt-contrib-sass.
Commit the
compiled Sass files to git. An alternative is to compile the files as
part of the deploy process. At work, it is a pain keeping these files
in git because there are many merge conflicts and differences in
build tool versions and platforms between developers. For my blog, I
am the only committer so I won't run into this
Вот так,
приблизительно, выглядит работа над веб-фронтэндом нынче.
Фронтэндщики
обзавелись своими сборщиками и
компиляторами, с блекджеком и шлюхами.
Все по взрослому.
original post http://vasnake.blogspot.com/2015/03/customizing-bootstrap.html
Комментариев нет:
Отправить комментарий