Giter Site home page Giter Site logo

rheehot / css-in-js-media Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brew-brew/css-in-js-media

0.0 1.0 0.0 165 KB

:art: Minified and Simplified include-media with CSS-in-JS (styled-components,emotion.js)

Home Page: https://www.npmjs.com/package/css-in-js-media

License: MIT License

JavaScript 100.00%

css-in-js-media's Introduction

css-in-js-media 🎨

Minified and Simplified include-media with CSS-in-JS

when you style with css-in-js (emotion, styled-component) you can perfectly and easily deal with responsive design with this css-in-js-media which is similar with include-media

❓ how-to-use

npm install css-in-js-media
import media from "css-in-js-media";

πŸŽ’ size

image

πŸ“ example

media-query break-point

smallPhone: 320
phone: 375
tablet: 768
desktop: 1024
largeDesktop: 1440

with css-in-js library (ex: emotion.js , styled-component)

  • example with emotion.js
import media from "css-in-js-media";

export const exampleClass = css`
  color: red;
  ${media(">desktop")} {
    font-size: 15px;
  }
  ${media("<=desktop", ">tablet")} {
    font-size: 20px;
  }
  ${media("<=tablet", ">phone")} {
    font-size: 25px;
  }
  ${media("<=phone")} {
    font-size: 30px;
  }
`;
  • example with styled-component
import media from "css-in-js-media";

const exampleClass = styled.h1`
  color: red;
  ${media(">desktop")} {
    font-size: 15px;
  }
  ${media("<=desktop", ">tablet")} {
    font-size: 20px;
  }
  ${media("<=tablet", ">phone")} {
    font-size: 25px;
  }
  ${media("<=phone")} {
    font-size: 30px;
  }
`;

❀️ THANKS

πŸ› Bug reporting

Issue

License

MIT

comment

λ¦¬μ•‘νŠΈ κ°œλ°œμ„ ν•˜λ©΄μ„œ styled-componentsλ‚˜ emotion.js같은 css-in-js 기법을 ν™œμš©ν•΄ λ°˜μ‘ν˜• λŒ€μ‘μ„ ν• λ•Œ λΆˆνŽΈν•œ 적이 λ§Žμ•˜λŠ”λ°μš”, scssλ₯Ό ν™œμš©ν• λ•ŒλŠ” include-media 같은 라이브러리λ₯Ό 톡해 μ§κ΄€μ μœΌλ‘œ λ°˜μ‘ν˜•λŒ€μ‘μ„ ν•  수 μžˆμ—ˆλ˜ μ μ—μ„œ μ°©μ•ˆν•΄ 이λ₯Ό css-in-js 기법듀(styled-component, emotion.js) μ—μ„œλ„ μ‚¬μš©ν•  수 μžˆλ„λ‘ λ§Œλ“  라이브러리 μž…λ‹ˆλ‹€.

css-in-js-media's People

Contributors

brew-brew avatar dependabot[bot] avatar rheehot avatar

Watchers

 avatar

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.