diff --git a/css.html b/css.html index 377339a47a..389ff06637 100644 --- a/css.html +++ b/css.html @@ -2355,6 +2355,34 @@ For example, <section> should be wrapped as inline. ✔ Visible on large +
+
+ + ✔ Visible on x-small and small +
+
+ + ✔ Visible on medium and large +
+
+
+ + ✔ Visible on x-small and medium +
+
+ + ✔ Visible on small and large +
+
+
+ + ✔ Visible on x-small and large +
+
+ + ✔ Visible on small and medium +
+

Hidden on...

Here, green checkmarks indicate the element is hidden in your current viewport.

@@ -2376,5 +2404,33 @@ For example, <section> should be wrapped as inline.
+
+
+ Extra small and small + +
+
+ Medium and large + +
+
+
+ Extra small and medium + +
+
+ Small and large + +
+
+
+ Extra small and large + +
+
+ Small and medium + +
+
diff --git a/less/responsive-utilities.less b/less/responsive-utilities.less index 062d6820ce..c756b23615 100644 --- a/less/responsive-utilities.less +++ b/less/responsive-utilities.less @@ -36,48 +36,84 @@ // Visibility utilities .visible-xs { - .responsive-visibility(); - @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { - .responsive-invisibility(); + .responsive-invisibility(); + @media (max-width: @screen-xs-max) { + .responsive-visibility(); } - @media (min-width: @screen-md) and (max-width: @screen-md-max) { - .responsive-invisibility(); + &.visible-sm { + @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { + .responsive-visibility(); + } } - @media (min-width: @screen-lg) { - .responsive-invisibility(); + &.visible-md { + @media (min-width: @screen-md) and (max-width: @screen-md-max) { + .responsive-visibility(); + } + } + &.visible-lg { + @media (min-width: @screen-lg) { + .responsive-visibility(); + } } } .visible-sm { .responsive-invisibility(); + &.visible-xs { + @media (max-width: @screen-xs-max) { + .responsive-visibility(); + } + } @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { .responsive-visibility(); } - @media (min-width: @screen-md) and (max-width: @screen-md-max) { - .responsive-invisibility(); + &.visible-md { + @media (min-width: @screen-md) and (max-width: @screen-md-max) { + .responsive-visibility(); + } } - @media (min-width: @screen-lg) { - .responsive-invisibility(); + &.visible-lg { + @media (min-width: @screen-lg) { + .responsive-visibility(); + } } } .visible-md { .responsive-invisibility(); - @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { - .responsive-invisibility(); + &.visible-xs { + @media (max-width: @screen-xs-max) { + .responsive-visibility(); + } + } + &.visible-sm { + @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { + .responsive-visibility(); + } } @media (min-width: @screen-md) and (max-width: @screen-md-max) { .responsive-visibility(); } - @media (min-width: @screen-lg) { - .responsive-invisibility(); + &.visible-lg { + @media (min-width: @screen-lg) { + .responsive-visibility(); + } } } .visible-lg { .responsive-invisibility(); - @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { - .responsive-invisibility(); + &.visible-xs { + @media (max-width: @screen-xs-max) { + .responsive-visibility(); + } } - @media (min-width: @screen-md) and (max-width: @screen-md-max) { - .responsive-invisibility(); + &.visible-sm { + @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { + .responsive-visibility(); + } + } + &.visible-md { + @media (min-width: @screen-md) and (max-width: @screen-md-max) { + .responsive-visibility(); + } } @media (min-width: @screen-lg) { .responsive-visibility(); @@ -85,48 +121,84 @@ } .hidden-xs { - .responsive-invisibility(); - @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { - .responsive-visibility(); + .responsive-visibility(); + @media (max-width: @screen-xs-max) { + .responsive-invisibility(); } - @media (min-width: @screen-md) and (max-width: @screen-md-max) { - .responsive-visibility(); + &.hidden-sm { + @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { + .responsive-invisibility(); + } } - @media (min-width: @screen-lg) { - .responsive-visibility(); + &.hidden-md { + @media (min-width: @screen-md) and (max-width: @screen-md-max) { + .responsive-invisibility(); + } + } + &.hidden-lg { + @media (min-width: @screen-lg) { + .responsive-invisibility(); + } } } .hidden-sm { .responsive-visibility(); + &.hidden-xs { + @media (max-width: @screen-xs-max) { + .responsive-invisibility(); + } + } @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { .responsive-invisibility(); } - @media (min-width: @screen-md) and (max-width: @screen-md-max) { - .responsive-visibility(); + &.hidden-md { + @media (min-width: @screen-md) and (max-width: @screen-md-max) { + .responsive-invisibility(); + } } - @media (min-width: @screen-lg) { - .responsive-visibility(); + &.hidden-lg { + @media (min-width: @screen-lg) { + .responsive-invisibility(); + } } } .hidden-md { .responsive-visibility(); - @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { - .responsive-visibility(); + &.hidden-xs { + @media (max-width: @screen-xs-max) { + .responsive-invisibility(); + } + } + &.hidden-sm { + @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { + .responsive-invisibility(); + } } @media (min-width: @screen-md) and (max-width: @screen-md-max) { .responsive-invisibility(); } - @media (min-width: @screen-lg) { - .responsive-visibility(); + &.hidden-lg { + @media (min-width: @screen-lg) { + .responsive-invisibility(); + } } } .hidden-lg { .responsive-visibility(); - @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { - .responsive-visibility(); + &.hidden-xs { + @media (max-width: @screen-xs-max) { + .responsive-invisibility(); + } } - @media (min-width: @screen-md) and (max-width: @screen-md-max) { - .responsive-visibility(); + &.hidden-sm { + @media (min-width: @screen-sm) and (max-width: @screen-sm-max) { + .responsive-invisibility(); + } + } + &.hidden-md { + @media (min-width: @screen-md) and (max-width: @screen-md-max) { + .responsive-invisibility(); + } } @media (min-width: @screen-lg) { .responsive-invisibility();