3 ms·
This is something that has been messing with my workflow so hear me out. First, I use CodeKit on my local machine to compile. CodeKit allows me to choose a fram
by VaughnDTaylor 14y ago
This is something that has been messing with my workflow so hear me out. First, I use CodeKit on my local machine to compile. CodeKit allows me to choose a framework (bootstrap-master > LESS files). I don't want to keep multiple versions of bootstrap-master sitting around on my computer. Preferably, I'd have the most current version with which I'd use to build all of my CSS (regardless of the site I'm working on) by simply pointing to the bootstrap-master directory. However, the inclusion of variables.less in bootstrap-master > bootstrap.less (where it's an import) makes this difficult - variables.less is the ONLY file in bootstrap-master that I need to slightly tweak for each site I create. The variables.less file should not be a default import in bootstrap.less - at least this would be ideal for me. The way things are now, I have to modify bootstrap.less (to tell it not to import variables) and variables.less (to control colors, grid, etc). I'd like to just update all of the bootstrap-master files in one fell swoop without worrying about overwriting my changes to these two files. If variables was not a default import AND it was outside of this framework directory, I could update every file in bootstrap-master without worrying about overwriting anything. I hope I have communicated this in the right way - it seems a bit muddled?
- aed 14y agoI actually know exactly what you're talking about and here's what I do: - Put Bootstrap in a folder and import it as a framework in CodeKit. (Just like you.) - In my project folder, I create a LESS file for the project (e.g. project.less). - At the very top of my project.less I add an import for bootstrap (@import "bootstrap.less") - I define and customize all my LESS variables within the project.less without touching bootstrap.less. Yes, this does mean that the variables are being define again. However, this won't matter because what you define in your project.less will override everything else.
- VaughnDTaylor 14y agoThis solution will work for me. Thanks! I suppose it makes no difference that the variables are defined twice? I guess I was just getting stuck on the metaphor of other frameworks (eg. JQuery UI) where my custom files are kept separate from the library. Make sense?
- juddlyon 14y agoI do the exact same thing and it makes for a nice, modular setup. I have a site.less that imports bootstrap.less and whatever other "legos" I need.
- ZeroGravitas 14y agoThe bootswatch project (basically themes for Bootstrap) uses a similar system, though they generally have two less files, one for overriding variables, and a second one for theme-specific additions. https://github.com/thomaspark/bootswatch/tree/gh-pages/swatchmaker https://github.com/thomaspark/bootswatch/tree/gh-pages/swatc...