bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

variables.less can be .gitignored

Open meglio opened this issue 14 years ago • 8 comments

When using Bootstrap as git submodule, the goal is to be able to customize it and compile it together with the project (my example is using it with Play2 framework).

In order to freely customize variables.less, but to be able to git pull Bootstrap project without overriding customization changes, variables.less can be put into .gitignore, and variables.less.sample provided instead.

meglio avatar Feb 20 '12 09:02 meglio

A way to do it right now is to copy bootstrap.less and variables.less to your own directory, modifying bootstrap.less to import everything but variables.less from the Bootstrap directory, and only importing the modules you need.

jacobrask avatar Feb 20 '12 10:02 jacobrask

Yes, thanks, that is the way I'm doing it now. Btw, even if making additional file variables-local.less and overriding values there, and then using it in bootstrap.less - anyway we modify bootstrap.less.

So at the end modify one of source files: either bootstrap.less or variables.less, so I not found yet any way to do it without modifying source files.

Let me know of any better idea. Thanks.

meglio avatar Feb 20 '12 10:02 meglio

Creating a new file as a layer between should suffice for this instance. We might start including a standard variables override file, but unsure about that for now.

mdo avatar Feb 20 '12 18:02 mdo

@jacobrask, @mdo, copying the less files to their own directory prevents one from using the official Makefile to compile the css.

I'd like to:

  1. Not make any changes to the bootstrap submodule.
  2. Customize bootstrap variables.
  3. Compile bootstrap using the official Makefile.

As far as I can see, this is the usual "pick any two out of three" situation and only gitignore can help.

tasuki avatar Mar 24 '13 10:03 tasuki

for 3) you need the corresponding node.js modules as well. the file package.json provides you with details on which those are. or you copy the package.json file over to your custom dir, and run "npm install" without argument. These needed modules are fetched from that file. This also assumes you haven't changed paths in your custom directory.

neverendingo avatar Mar 24 '13 10:03 neverendingo

@neverendingo, the idea was to make the files within the submodule (so as to limit the amount of extra files I need to commit into my own repo) and symlink them from my project.

tasuki avatar Mar 24 '13 11:03 tasuki

@tasuk same answer then, but i guess you need to adjust the paths in the makefile. This of course without knowing your specific setup.

neverendingo avatar Mar 24 '13 13:03 neverendingo

@neverendingo, the Makefile is part of Twitter Bootstrap, I should not have to touch it. Of course I can copy it and make changes, but that defeats the purpose of using the library as a submodule.

tasuki avatar Mar 24 '13 14:03 tasuki