What does !default in a css property value mean?


The twitter bootstrap code has a lot of CSS properties with a !default at the end.


p {
  color: white !default;

What does !default do?


My bad for not being clear. I am using the SASS part of Bootstrap.


Twitter Bootstrap uses LESS as far as I’ve seen. On the other hand, !default is actually part of Sass, and is used for giving Sass variables ($var) default values, which would make it invalid in your given context, even in Sass.

Besides, I’ve not been able to find any references to !default in the LESS documentation, and to my knowledge it is exclusive to Sass. Are you sure you found this in Bootstrap’s source and not elsewhere? Because I honestly don’t remember seeing Sass/SCSS code in Bootstrap’s stylesheets.

For what it’s worth, the only valid token that starts with ! in CSS is !important, which you may already be aware of.

Answered By – BoltClock

Answer Checked By – Senaida (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.