Skip to content

Instantly share code, notes, and snippets.

@leny
Last active February 20, 2019 20:16
Show Gist options
  • Save leny/3dd8ab90500d2d7cef5d289b5e0ae34c to your computer and use it in GitHub Desktop.
Save leny/3dd8ab90500d2d7cef5d289b5e0ae34c to your computer and use it in GitHub Desktop.
Using media queries in react with emotion and koutla-swiss
import React from "react";
import {css} from "emotion";
import {mq} from "koutla-swiss";
const styles = {
text: css({
color: "black",
...mq("min-width: 480px", {
color: "red",
}),
...mq("min-width: 960px", {
color: "blue",
}),
}),
};
export default () => (
<p className={styles.text}>{"Hello, world!"}</p>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment