1

What does !important mean in VueJS?

I am new to vue.js and I am seeing this piece of code included after values in style sheets.
I can't find it in the docs.

OArnarsson
  • 801
  • 1
  • 9
  • 25
GreySage
  • 1,153
  • 19
  • 39
  • I guess this is a duplicate of a duplicate. I thought it was a vue.js thing, so I didn't look under css. my bad. – GreySage Jan 27 '17 at 23:45

1 Answers1

2

!important is used in CSS to make sure that style overrides any competing styles.

lets say I have a button .btn and it was in a container called .btn-container

if I had css this css

.btn {
 color: red !important;
}

.btn-container .btn {
  color: blue;
}

the .btn color would still be red even though the nested rule is higher in specificity. Once you add the !important it overrides the specificity. https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity#The_!important_exception

finalfreq
  • 6,830
  • 2
  • 27
  • 28