1.1.0 • Published 6 years ago

media-helpers v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

Media Helpers

Introduction

A set of simple media query helpers based on Foundations breakpoints. Includes:

  • JSX render only breakpoint tags
  • Sass mixins
  • js media match helper functions

Code Samples

import { SmallOnly, MediumOnly, LargeOnly, MediumUp, matchMedia } from "media-helpers"

<SmallOnly><p>Small only visible</p></SmallOnly>
<MediumOnly><p>Medium only visible</p></MediumOnly>
<MediumUp><p>Medium Up visible</p></MediumUp>
<LargeOnly><p>Large only visible</p></LargeOnly>

console.log(matchMedia.isLargeOnly)
@import 'media-helpers/mixins';

@include breakpoint(medium-up) {
    background-color: green;
}
@include breakpoint(large-up) {
    background-color: blue;
}
@include breakpoint(x-large-up) {
    background-color: red;
}

Installation

yarn add or npm install 'media-helpers'

1.1.0

6 years ago

1.0.4

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.21

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago