diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 142df455aa..83c9bec75a 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -5427,6 +5427,11 @@ a.thumbnail:hover { border-radius: 9px; } +.label:empty, +.badge:empty { + display: none; +} + a.label:hover, a.badge:hover { color: #ffffff; diff --git a/docs/components.html b/docs/components.html index 1874470f46..a99a96b9b1 100644 --- a/docs/components.html +++ b/docs/components.html @@ -1859,6 +1859,9 @@ +

Easily collapsible

+

For easy implementation, labels and badges will simply collapse (via CSS's :empty selector) when no content exists within.

+ diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache index 3c024451c2..0a655d6de2 100644 --- a/docs/templates/pages/components.mustache +++ b/docs/templates/pages/components.mustache @@ -1788,6 +1788,9 @@ +

{{_i}}Easily collapsible{{/i}}

+

{{_i}}For easy implementation, labels and badges will simply collapse (via CSS's :empty selector) when no content exists within.{{/i}}

+ diff --git a/less/labels-badges.less b/less/labels-badges.less index d118a0190e..9c3a40bfbf 100644 --- a/less/labels-badges.less +++ b/less/labels-badges.less @@ -27,6 +27,14 @@ .border-radius(9px); } +// Empty labels/badges collapse +.label, +.badge { + &:empty { + display: none; + } +} + // Hover state, but only for links a { &.label:hover,