Visibility Classes

Description

  • Foundation uses visibility classes to show or hide elements based upon device orientation (portrait and landscape) or screen size (small, medium, large or xlarge screen).
  • It allows a user to use elements based on the browsing environment.

The following table lists the visibility classes of Foundation, which control the elements based on their browsing environment −

Sr.No.Visibility Class & Description
1Show by Screen SizeIt shows the elements based on the device by using .show class.
2Hide by Screen SizeIt hides the elements based on the device by using .hide class.

Foundation supports some classes where you can hide the content by using the .hide and .invisible classes and displays nothing on the page.

Orientation Detection

The devices can determine different orientations by using landscape and portrait functionality. The hand held devices such as mobile phones specifies the different orientations when you rotate them. For desktop, the orientation will be landscape always.

Accessibility

The following table lists the accessibility techniques for screen readers which hides the content while making it readable by screen readers −

Sr.No.Accessibility Class & Description
1Show for Screen ReadersIt uses show-for-sr class to hide the content while preventing screen readers from reading it.
2Hide for Screen ReadersIt uses aria-hidden attribute which makes text visible but could not be read by a screen reader.
3Creating Skip LinksScreen reader will create a skip link to get the navigation to your site’s content.

Sass Reference

Foundation uses the following mixins to display CSS output, which allows building own class structure for your components −

Sr.No.Mixin & DescriptionParameterType
1show-forBy default, it hides an element and displays it above certain screen size.$sizeKeyword
2show-for-onlyBy default, it hides an element and displays it within breakpoint.$sizeKeyword
3hide-forBy default, it shows an element and hides it above a certain screen size.$sizeKeyword
4hide-for-onlyBy default, it shows an element and hides it above a certain screen size.$sizeKeyword

The default value of all these mixins will be set to none.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *