{"id":20999791,"url":"https://github.com/webdevluke/styled-components-sass-mq","last_synced_at":"2026-07-03T05:32:36.093Z","repository":{"id":57152444,"uuid":"124426552","full_name":"WebDevLuke/styled-components-sass-mq","owner":"WebDevLuke","description":"A port of sass-mq for styled-components to help you compose media queries in an elegant way.","archived":false,"fork":false,"pushed_at":"2018-03-09T09:00:47.000Z","size":95,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T18:03:41.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/WebDevLuke.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}},"created_at":"2018-03-08T17:38:27.000Z","updated_at":"2019-02-25T01:39:30.000Z","dependencies_parsed_at":"2022-08-27T16:20:47.106Z","dependency_job_id":null,"html_url":"https://github.com/WebDevLuke/styled-components-sass-mq","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevLuke%2Fstyled-components-sass-mq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevLuke%2Fstyled-components-sass-mq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevLuke%2Fstyled-components-sass-mq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDevLuke%2Fstyled-components-sass-mq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDevLuke","download_url":"https://codeload.github.com/WebDevLuke/styled-components-sass-mq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243417317,"owners_count":20287611,"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":[],"created_at":"2024-11-19T08:08:18.491Z","updated_at":"2026-07-03T05:32:36.047Z","avatar_url":"https://github.com/WebDevLuke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n\u003cimg src='https://cdn.rawgit.com/WebDevLuke/styled-components-mq/master/logos.png' height='150px'\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eA port of \u003ca href='https://github.com/sass-mq/sass-mq'\u003esass-mq\u003c/a\u003e for \u003ca href='https://github.com/styled-components/styled-components'\u003estyled-components\u003c/a\u003e to help you compose media queries in an elegant way.\u003c/strong\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\n## Install\n\nInstall `styled-components-sass-mq` using npm:\n\n```\nnpm install --save styled-components-sass-mq\n```\n\n## Usage\nRefer to [sass-mq](https://github.com/sass-mq/sass-mq) docs for a full list of options. `styled-components-sass-mq` provides feature parity with [sass-mq](https://github.com/sass-mq/sass-mq), with exception to its `show-breakpoint` and `add-breakpoint` functions.\n\nHere's a basic example:\n\n```JSX\nimport React from 'react';\n\nimport styled from 'styled-components';\nimport createMediaQueries from 'styled-components-mq';\n\n// Use sass-mq default breakpoints, or like below, create your own\nconst breakpoints = {\n  \"sm\": 370,\n  \"md\": 768,\n  \"lg\": 1024,\n  \"xlg\": 1440\n}\n\n// Inject your custom breakpoints into the mq function\nconst mq = createMediaQueries(breakpoints);\n\n// Use like below\nconst Title = styled.h1`\n  font-size: 2.5em;\n  text-align: center;\n  color: palevioletred;\n  ${mq({from: 'md'})`\n  \tfont-size: 5em;\n  `}\n`;\n\n// A more advanced example\nconst Wrapper = styled.section`\n  padding: 4em;\n  background: papayawhip;\n  ${mq({from: 'md', until: 'xlg', and: '(orientation: landscape)', mediaType: 'only screen'})`\n  \tbackground: red;\n  `}\n`;\n\n\u003cWrapper\u003e\n  \u003cTitle\u003eHello World, this is my first styled component, with easy to use media queries!\u003c/Title\u003e\n\u003c/Wrapper\u003e\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevluke%2Fstyled-components-sass-mq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdevluke%2Fstyled-components-sass-mq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdevluke%2Fstyled-components-sass-mq/lists"}