I am currently learning ReactJs and JavaScript and I have a question on how to optimize this css setup effectively.
I am utilizing the react-responsive library to detect screen sizes and determine the best layout for my project.
The issue I am facing is with the following css:
.navbar-dark .navbar-toggler-icon {
height: 40px;
width: 40px;
}
.navbar {
transition: top 0.6s;
opacity: 0.95;
filter: alpha(opacity=30); /* For IE8 and earlier */
}
.navbar--hidden {
top: -150px;
}
This css code corresponds to the react-bootstrap NavBar
, and I need to create three different versions of this css, such as:
.navbar-desktop {...
.navbar-mobile {...
.navbar-tablet {...
However, when I attempt to implement these variations, the Navbar does not apply the new css styles since the className
does not match the css classes correctly. What solutions or alternatives do I have in this scenario?
I hope my explanation makes sense!