Giter VIP home page Giter VIP logo

mq's Introduction

mq

Create easily media queries when styling in any CSS-in-JS library.

Installation

Install mq with npm or yarn

  npm install @watfiree/mq
  yarn add @watfiree/mq

Usage/Examples

With default config

import styled from "styled-components";
import { mq } from "@watfiree/mq";

const ModalWrapper = styled.div`
  background: black;
  color: white;

  ${mq.from("xs")} {
    background: grey;
    color: darkgrey;
  }

  ${mq.between("sm", "xl")} {
    background: white;
    color: black;
  }
`;

With your custom config

import styled from "styled-components";
import { createMqEntity } from "@watfiree/mq";

type myNewBreakponts = "wd" | "ws"; // can be also enum

const mq = createMqEntity<myNewBreakponts>({ wd: "2000px", ws: "1200px" });

const ModalWrapper = styled.div`
  background: black;
  color: white;

  ${mq.from("wd")} {
    background: grey;
    color: darkgrey;
  }

  ${mq.between("ws", "wd")} {
    background: white;
    color: black;
  }
`;

mq's People

Contributors

watfiree avatar dawidbal avatar

Watchers

 avatar

Forkers

dawidbal

mq's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.