echo75 / my-movie-db

MIT License
1 stars 0 forks source link

#CleanCode Using important isn't unimportant #9

Closed Dr4gon closed 1 year ago

Dr4gon commented 1 year ago

@echo75 I assume u need to override certain bootstrap styles. In general using important means there's something wrong in the css styling. I know that sometimes, you have to do it. At that point I try to understand the styling and fix the actual issue behind it. On the long run, this will end in a series of important important important overrides.

App.vue

html {
  height: 101% !important;
}
.nav-link.active {
  font-weight: 700;
  color: #ffca2b !important;
}
.nav-link:hover {
  color: #ffca2b !important;
}
ghost commented 1 year ago

I use it very seldom. Here it's just there to force the scrollbar in the browser, so the screen doesn't jump (as you say in German), when there sometimes is a scrollbar and sometimes not, depending on the length of the content. HTML: 101% means -> always scrollbar :-)

echo75 commented 1 year ago

!important here, is used to overwrite definitions from bootstrap. Definitions in bootstrap can be very consistent.