1.0.1 • Published 4 years ago

superior-mq v1.0.1

Weekly downloads
153
License
MIT
Repository
github
Last release
4 years ago

superior-mq

css-in-js media queries

screen.below Input:

@import screen from 'superior-mq'

screen.below('480px', `
  font-size: 1rem;
`)

screen.below Output:

@media screen and (max-width: 479px) {
  font-size: 12px;
}

screen.above Input:

@import screen from 'superior-mq'

screen.above('480px', `
  font-size: 1rem;
`)

screen.above Output:

@media screen and (min-width: 480px) {
  font-size: 12px;
}

screen.between Input:

@import screen from 'superior-mq'

screen.between('600px', '800px' `
  font-size: 1rem;
`)

screen.between Output:

@media screen and (min-width: 600px) and (max-width: 799px) {
  font-size: 1rem;
}

screen.belowHeight Input:

@import screen from 'superior-mq'

screen.belowHeight('480px', `
  font-size: 1rem;
`)

screen.belowHeight Output:

@media screen and (max-height: 479px) {
  font-size: 1rem;
}

screen.aboveHeight Input:

@import screen from 'superior-mq'

screen.aboveHeight('480px', `
  font-size: 1rem;
`)

screen.aboveHeight Output:

@media screen and (min-height: 480px) {
  font-size: 12px;
}

screen.betweenHeight Input:

@import screen from 'superior-mq'

screen.betweenHeight('600px', '800px' `
  font-size: 1rem;
`)

screen.betweenHeight Output:

@media screen and (min-height: 600px) and (max-height: 799px) {
  font-size: 1rem;
}

With styled-components

import styled from 'styled-components';
import screen from '@superior-media-query';

const PageHeading = styled.h1`
  font-size: 1.75rem;
  margin-bottom: .25rem;

  ${screenAbove('480px', `
    font-size: 2.5rem;
    margin-bottom: 1rem;
  `)}
`;
1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta-1

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1-beta-1

4 years ago

0.1.1-beta-2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.1.0-beta-3

4 years ago

0.1.0-beta-2

4 years ago

0.1.0-beta-1

4 years ago

0.0.3

4 years ago

0.0.2

5 years ago

0.0.2-beta

5 years ago

0.0.1

5 years ago