All Projects → Brew-Brew → css-in-js-media

Brew-Brew / css-in-js-media

Licence: MIT license
🎨 Deal with responsive design simply when use CSS-in-JS (styled-components,emotion.js)

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to css-in-js-media

Next Postgres Sequelize
React 16.8.4 + NextJS 8.0.3 + Emotion + Sequelize 5/Postgres + Passport Local Auth + Google App Engine or Heroku Deployment
Stars: ✭ 176 (+28.47%)
Mutual labels:  emotion
Gatsby Starter Portfolio Emma
Minimalistic portfolio with full-width grid, page transitions, support for additional MDX pages, and a focus on large images. Especially designers and/or photographers will love this theme! Built with MDX and Theme UI.
Stars: ✭ 253 (+84.67%)
Mutual labels:  emotion
EmoticonsBoard
Function keyboard and emotions. Android表情键盘,可动态更新表情。
Stars: ✭ 31 (-77.37%)
Mutual labels:  emotion
Emotion
👩‍🎤 CSS-in-JS library designed for high performance style composition
Stars: ✭ 14,177 (+10248.18%)
Mutual labels:  emotion
Styled Ppx
Typed styled components in Reason, OCaml and ReScript
Stars: ✭ 236 (+72.26%)
Mutual labels:  emotion
recipes-next-hasura
A lightweight app to explore and create recipes - Built with Next.js, Hasura, and Chakra-UI
Stars: ✭ 30 (-78.1%)
Mutual labels:  emotion
Filbert Js
A lightweight(~1kb) css-in-js framework
Stars: ✭ 167 (+21.9%)
Mutual labels:  emotion
FacialEmotionRecognition
Using Extended Cohn-Kanade AU-Coded Facial Expression Database to classify basic human facial emotion expressions using ann
Stars: ✭ 28 (-79.56%)
Mutual labels:  emotion
Xwind
Tailwind CSS as a templating language in JS and CSS-in-JS
Stars: ✭ 249 (+81.75%)
Mutual labels:  emotion
WWW2021
Official repository to release the code and datasets in the paper "Mining Dual Emotion for Fake News Detection", WWW 2021.
Stars: ✭ 45 (-67.15%)
Mutual labels:  emotion
Emotion Classification From Audio Files
Understanding emotions from audio files using neural networks and multiple datasets.
Stars: ✭ 189 (+37.96%)
Mutual labels:  emotion
Styled Components Vs Emotion
a short doc comparing the popular CSS-in-JS libraries styled-components and emotion
Stars: ✭ 204 (+48.91%)
Mutual labels:  emotion
Personal-Emotional-Stylized-Dialog
A Paper List for Personalized, Emotional, and stylized Dialog
Stars: ✭ 112 (-18.25%)
Mutual labels:  emotion
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+1417.52%)
Mutual labels:  emotion
chronist
Long-term analysis of emotion, age, and sentiment using Lifeslice and text records.
Stars: ✭ 23 (-83.21%)
Mutual labels:  emotion
Vue Emotion
Seamlessly use emotion (CSS-in-JS) with Vue.js
Stars: ✭ 173 (+26.28%)
Mutual labels:  emotion
basis
Basis Design System
Stars: ✭ 55 (-59.85%)
Mutual labels:  emotion
Senti4SD
An emotion-polarity classifier specifically trained on developers' communication channels
Stars: ✭ 41 (-70.07%)
Mutual labels:  emotion
AffectiveTweets
A WEKA package for analyzing emotion and sentiment of tweets.
Stars: ✭ 74 (-45.99%)
Mutual labels:  emotion
spring-keyframes
✌️1.4kb library to generate css keyframes in css-in-js based on a spring algorithm, with emotion
Stars: ✭ 65 (-52.55%)
Mutual labels:  emotion

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 and support type system(ts)

If you think this library is helpful, Support by give

Migrate to Typescript at version V2 🎉

Introduced at


📖 documentation


🚀 install & default usage

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

media-query break-point (default breakpoint)

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


🎒 size

image


how-to-use

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;
  }
`;

set flexible breakpoints (optional)

⚠️ You should set this in entry point file (root file)

import { setBreakPoints } from "css-in-js-media";
setBreakPoints({ desktop: 1440, largeDesktop: 1500 });

// or string size
setBreakPoints({ desktop: "140rem", largeDesktop: "calc(30 * 50px)" });

get breakpoints (optional)

import { getBreakPoints } from "css-in-js-media";
getBreakPoints();
// default breakpoints
// {
//   smallPhone: 320;
//   phone: 375;
//   tablet: 768;
//   desktop: 1024;
//   largeDesktop: 1440;
// }

❤️ THANKS

🐛 Bug reporting

Issue

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].