Skip to content

πŸ“ An include-media plugin to generate classes for hiding elements

Notifications You must be signed in to change notification settings

eduardoboucas/include-media-hidden-classes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

'At' sign

include-media β€” Hidden classes plugin

Get include-media here.

Introduction

This plugin generates a set of classes that allow elements to be hidden for specific breakpoints, as per this issue.

Example:

Class Hidden for
.hidden--for-phone Viewports on the "phone" breakpoint
.hidden--from-phone Viewports larger than the "phone" breakpoint (inclusive)
.hidden--to-phone Viewports smaller than the "phone" breakpoint (inclusive)

Generates:

@media (min-width: 320px) and (max-width: 767px) {
  .hidden--for-phone {
    display: none;
  }
}

@media (min-width: 320px) {
  .hidden--from-phone {
    display: none;
  }
}

@media (max-width: 319px) {
  .hidden--to-phone {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hidden--for-tablet {
    display: none;
  }
}

@media (min-width: 768px) {
  .hidden--from-tablet {
    display: none;
  }
}

@media (max-width: 767px) {
  .hidden--to-tablet {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hidden--for-desktop {
    display: none;
  }
}

@media (max-width: 1023px) {
  .hidden--to-desktop {
    display: none;
  }
}

Configuration

$im-hidden-class: The name of the generated classes (default: hidden)

$im-hidden-important: Whether to use add !important to the display value (default: false)

About

πŸ“ An include-media plugin to generate classes for hiding elements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages