Objective :
- I need to apply the complete bootstrap CSS to a single react component without affecting other components. However, other components also depend on bootstrap and use bootstrap classes.
- Is there a way to achieve this without modifying the classes/ids used in the component and ensuring that the CSS is specific only to that component? This may not be ideal from a programming standpoint, but any workaround would suffice.
- If it's not possible, what are the minimal changes I can make to make it work? The code is extensive, so manually checking each division for CSS and adding an ID is not feasible at this point - considering it as a last resort solution.
Situation :
I have 2 components with lengthy code - let's call them Component A and B.
Component A includes:
<link rel="stylesheet" href="assets/scss/style.css"> <link rel="stylesheet" href="assets/css/bootstrap.min.css">
Component B includes:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
Both components conflict with each other - using A damages B's CSS and vice versa.