{"id":14977462,"url":"https://github.com/pixelize/react-styled-mediaquery","last_synced_at":"2025-07-06T01:03:58.364Z","repository":{"id":57345865,"uuid":"212515140","full_name":"pixelize/react-styled-mediaquery","owner":"pixelize","description":"Simple and practical utility for managing media queries in react with styled components","archived":false,"fork":false,"pushed_at":"2023-06-10T00:12:44.000Z","size":830,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T02:13:44.535Z","etag":null,"topics":["breakpoints","custom-breakpoints","media","media-queries","mediaqueries","mediaquery","mobile","queries","query","react","responsive","rwd","styled-components","styledcomponents","tablet"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-03T06:55:30.000Z","updated_at":"2021-03-03T10:26:14.000Z","dependencies_parsed_at":"2024-09-18T21:35:26.643Z","dependency_job_id":"5e21d9a8-a410-42ce-8f96-ddb56ea46ee6","html_url":"https://github.com/pixelize/react-styled-mediaquery","commit_stats":{"total_commits":23,"total_committers":4,"mean_commits":5.75,"dds":"0.30434782608695654","last_synced_commit":"b4f1b0ebff1de174a0b2c0bb4219cbb66d95b353"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pixelize/react-styled-mediaquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelize%2Freact-styled-mediaquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelize%2Freact-styled-mediaquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelize%2Freact-styled-mediaquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelize%2Freact-styled-mediaquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelize","download_url":"https://codeload.github.com/pixelize/react-styled-mediaquery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelize%2Freact-styled-mediaquery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262003695,"owners_count":23243328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["breakpoints","custom-breakpoints","media","media-queries","mediaqueries","mediaquery","mobile","queries","query","react","responsive","rwd","styled-components","styledcomponents","tablet"],"created_at":"2024-09-24T13:55:43.229Z","updated_at":"2025-07-06T01:03:58.315Z","avatar_url":"https://github.com/pixelize.png","language":"JavaScript","readme":"﻿\n# react-styled-mediaquery\n\n## Description\n\n`react-styled-mediaquery` is a simple and practical function for managing media queries in react with styled components.\n\n### Demo\n\n[Github page](https://pixelize.github.io/react-styled-mediaquery/)\n\nAlso: See example folder in `gatsby/pages`. You can run it locally using [Gatsby](https://www.gatsbyjs.org/) just clone the repos and use `yarn start` in your CLI. Demo is running on `localhost:8000`\n\n## Installation\n\n| yarn | npm\n| -------------------- | -------------------------------------- |\n| yarn add react-styled-mediaquery   | npm add react-styled-mediaquery |\n\n## Usage\n\n```jsx\nimport React from \"react\";\nimport { mediaQuery } from \"react-styled-mediaquery\";\n\nconst  Card  =  styled.div`\n  background: red;\n\n  ${mediaQuery(\"\u003c\", \"tablet\")`\n    background: blue;\n  `}\n\n  ${mediaQuery(\"\u003e\", \"desktop\")`\n    background: yellow;\n  `}\n`\n\nconst App = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cCard\u003ehello world\u003c/Card\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\n## Conditions \u0026 default breakpoints\n\nYou can either use the default breakpoints shortcuts using the string `mobile | phablet | tablet | desktop`. Just mix your condition and breakpoints as you wish !\n\n### \u003e\nElement will be blue above the tablet breakpoint\n```jsx\n${mediaQuery(\"\u003e\", \"tablet\")`\n  background: blue;\n`}\n```\n\n### =\u003e\nElement will be blue above \u0026 including the mobile breakpoint\n\n```jsx\n${mediaQuery(\"=\u003e\", \"mobile\")`\n  background: blue;\n`}\n```\n\n### \u003c\nElement will be blue below desktop breakpoints\n\n```jsx\n${mediaQuery(\"\u003c\", \"desktop\")`\n  background: blue;\n`}\n```\n\n### \u003c=\nElement will be blue below \u0026 including the phablet breakpoint\n\n```jsx\n${mediaQuery(\"\u003c=\", \"phablet\")`\n  background: blue;\n`}\n```\n\n### between\nElement will be blue between the phablet and desktop breakpoint\n\n```jsx\n${mediaQuery(\"between\", \"phablet\", \"desktop\")`\n  background: blue;\n`}\n```\n\n## Custom Breakpoints\n\nThese are the default settings, you can overwrite with your own breakpoints\n\n```jsx\nconst devices = {\n  mobile: \"412px\",\n  phablet: \"600px\",\n  tablet: \"768px\",\n  desktop: \"1024px\"\n};\n```\n\nYou can also use the function with a custom declarative breakpoint in pixel i.e:\n```jsx\n${mediaQuery(\"\u003c\", \"638px\")`\n  background: blue;\n`}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelize%2Freact-styled-mediaquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelize%2Freact-styled-mediaquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelize%2Freact-styled-mediaquery/lists"}