question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$enable-* Variables for each component

See original GitHub issue

What do you think about creating a $enable-* variable for each component? So the bootstrap.scss would be even more modular.

By default, the variables would be set to true. For example, if the "jumbotron"component is not desired, you could disable it as follows:

$enableJumbotron: false;

https://v4-alpha.getbootstrap.com/getting-started/options/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mdocommented, Nov 3, 2017

This is essentially the same as commenting out an import statement in bootstrap.scss. I know there’s a bit more to it when it comes to shared components, but it’s basically 1:1. It’s been requested before and I was a pass then, still am now.

0reactions
FlorianKoernercommented, Nov 4, 2017

@mdo but you have to copy the bootstrap.scss before. Duplicated content has always been a bad practice.

The following example shows - this is not 1:1 the same thing.

$enableImages: false;

@import 'node_modules/bootstrap/scss/bootstrap';

vs.

@import "node_modules/bootstrap/scss/functions";
@import "node_modules/bootstrap/scss/variables";
@import "node_modules/bootstrap/scss/mixins";
@import "node_modules/bootstrap/scss/root";
@import "node_modules/bootstrap/scss/print";
@import "node_modules/bootstrap/scss/reboot";
@import "node_modules/bootstrap/scss/type";
//@import "node_modules/bootstrap/scss/images";
@import "node_modules/bootstrap/scss/code";
@import "node_modules/bootstrap/scss/grid";
@import "node_modules/bootstrap/scss/tables";
@import "node_modules/bootstrap/scss/forms";
@import "node_modules/bootstrap/scss/buttons";
@import "node_modules/bootstrap/scss/transitions";
@import "node_modules/bootstrap/scss/dropdown";
@import "node_modules/bootstrap/scss/button-group";
@import "node_modules/bootstrap/scss/input-group";
@import "node_modules/bootstrap/scss/custom-forms";
@import "node_modules/bootstrap/scss/nav";
@import "node_modules/bootstrap/scss/navbar";
@import "node_modules/bootstrap/scss/card";
@import "node_modules/bootstrap/scss/breadcrumb";
@import "node_modules/bootstrap/scss/pagination";
@import "node_modules/bootstrap/scss/badge";
@import "node_modules/bootstrap/scss/jumbotron";
@import "node_modules/bootstrap/scss/alert";
@import "node_modules/bootstrap/scss/progress";
@import "node_modules/bootstrap/scss/media";
@import "node_modules/bootstrap/scss/list-group";
@import "node_modules/bootstrap/scss/close";
@import "node_modules/bootstrap/scss/modal";
@import "node_modules/bootstrap/scss/tooltip";
@import "node_modules/bootstrap/scss/popover";
@import "node_modules/bootstrap/scss/carousel";
@import "node_modules/bootstrap/scss/utilities";
Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Update global variable within component
This will enable you to update global variables from within your component. In your component, have you tried toggling on the "Access app...
Read more >
Reusable Components - Variables and Properties
Learn about how to use a variable in a component. Even though a variable may be 'global', it is scoped to its own...
Read more >
How to Use Variables within Classes | Pluralsight
In this guide, you learned how to declare and use variables such as local, global, static, state, and props as a variable. Developers...
Read more >
How to set GLOBAL VARIABLE at Page level, which is used ...
Is there any way we can Set some GLOBAL VARIABLE at page level , which can be used by all the LS Components...
Read more >
How to declare a global variable in React? - Stack Overflow
You can declare a global context variable in any of the parent components and this variable will be accessible across the component tree...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found