New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@divyanshu013/media

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@divyanshu013/media

Simplify media queries for CSS in JS

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@divyanshu013/media 💃

@divyanshu013/media

Simplify media queries for CSS in JS

NpmVersion bundle size Maintainability codecov Build Status jest Downloads

Install

yarn add @divyanshu013/media

Usage

breakpoints

import { breakpoints } from '@divyanshu013/media';

// default breakpoints
console.log(breakpoints);
/*
{
  xsmall: 420,
  small: 576,
  medium: 768,
  large: 992,
  xlarge: 1200,
}
*/

min-width query

import { mediaMin } from '@divyanshu013/media';
import { css } from 'react-emotion';

const styles = css({
  [mediaMin.medium]: {
    fontSize: '1.2rem',
  },
});

max-width query

import { mediaMax } from '@divyanshu013/media';
import { css } from 'react-emotion';

const styles = css({
  [mediaMax.medium]: {
    fontSize: '0.9rem',
  },
});

create

import { create } from '@divyanshu013/media';

const breakpoints = {
  md: 768,
  xxl: 1600,
};

const mediaQMax = create(breakpoints, 'max');
const mediaQMin = create(breakpoints, 'min');

compose

Just like Object.assign. (Actually its just Object.assign 😛).

const media1 = {...};
const media2 = {...};

const mediaQ = compose(media1, media2);

// now use mediaQ

Inspiration

This library is inspired by emotion and facepaint.

Logo from EmojiOne.

FAQs

Package last updated on 19 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc