Handling Bootstrap overrides when removing bower_compontents

OK, so I know it’s not good practice to be uploading node_modules and bower_compontents into repositories and live servers. I usually exclude the folders and just build them out again if needs be later on. I’ll usually have a working copy on my machine but for older projects, I tend to archive them.

However, the issue is when there’s been overrides to Bootstrap itself such as changing the breakpoint variables to control when the mobile nav kicks in etc. This hadn’t occurred to me previously but I’ve just figured out that this is the reason a cloned version of an old site hasn’t built out correctly.

How should this be handled in the future? Generally, I create theme-specific overrides within a themes CSS/Sass but in some situations that doesn’t make sense (too many overrides) or it’s simply not how Bootstrap was set up to be used (bootstrap-wide variables).

Not sure what you mean. One of the main points of using CSS preprocessors is to have variables that can be overridden so that we don’t have to touch the source code from the vendor package.

For LESS, you override variables after the default variable is set. For SASS, you need to override the variable BEFORE the default is included. But this is always how Sage has been set up for each pre-processor

Wow I feel like an idiot for asking that question. Something so obvious that I’ve been doing wrong for a while now! I never really considered overriding vendor variables, I always edited them directly – clearly so wrong :smile:

Thanks for taking the time to answer such an idiot question!