title: Is it bad practice to override LESS variables?
body: <p>I'm using Twitter Bootstrap on a project at the moment, including the LESS files and compiling with some additional LESS code that we've written.</p>
  <p>The latest release has meant we need to override some of the Bootstrap LESS variables. One option here was to maintain a modified copy of Bootstrap which we patch on each release.</p>
  <p>But I note that it's possible to override a variable defined in an <code>@import</code> LESS file by re-declaring the variable <em>after</em> the import statement.</p>
  <p>E.g.:</p>
  <pre><code>@import &quot;twitter-bootstrap/bootstrap.less&quot;;
  // Restore base font size to pre 2.1.1 defaults
  @baseFontSize:          13px;
  // Add some custom LESS code here
  </code></pre>
  <p>Is this bad practice? Is it an artifact of the way the LESS compiler works, or an intended part of it? I couldn't find much information on this, although I did find the following two references:</p>
  <blockquote>
  <p>Because of a bug in the Less compiler, you can override the “constant” value of a variable by changing it after it is initially declared.</p>
  <p><a href="http://rubysource.com/how-to-customize-twitter-bootstrap%E2%80%99s-design-in-a-rails-app" rel="noreferrer">http://rubysource.com/how-to-customize-twitter-bootstrap%E2%80%99s-design-in-a-rails-app</a></p>
  </blockquote>
  <p>and</p>
  <blockquote>
  <p>Customize the columns and gutters by overriding these three variables (after the grid.less import has been declared).</p>
  <p><a href="http://semantic.gs/" rel="noreferrer">http://semantic.gs/</a></p>
  </blockquote>
  <p>The LESS site itself says that variables are 'constants':</p>
  <p><a href="http://lesscss.org/" rel="noreferrer">http://lesscss.org/</a></p>
  <blockquote>
  <p>Note that variables in LESS are actually ‘constants’ in that they can only be defined once.</p>
  </blockquote>
  <p>But then I see other sites using this approach.. It's certainly easier than maintaining a vendor branch and seems to work fine with less.js.</p>
  <p>Would appreciate any thoughts on whether this is a bad thing to do or not!</p>