{"id":24914342,"url":"https://github.com/jeslage/adaptive-modular-scale","last_synced_at":"2026-01-28T01:35:24.628Z","repository":{"id":44011978,"uuid":"234742654","full_name":"jeslage/adaptive-modular-scale","owner":"jeslage","description":"A small javascript helper to get adaptive modular scale font sizes string","archived":false,"fork":false,"pushed_at":"2023-01-05T07:59:41.000Z","size":378,"stargazers_count":3,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-19T11:11:55.077Z","etag":null,"topics":["breakpoints","css-in-js","fluid","interpolation","modular-scales","typography"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jeslage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-01-18T13:57:50.000Z","updated_at":"2020-04-30T09:16:26.000Z","dependencies_parsed_at":"2023-02-03T19:31:51.926Z","dependency_job_id":null,"html_url":"https://github.com/jeslage/adaptive-modular-scale","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jeslage/adaptive-modular-scale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslage%2Fadaptive-modular-scale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslage%2Fadaptive-modular-scale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslage%2Fadaptive-modular-scale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslage%2Fadaptive-modular-scale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeslage","download_url":"https://codeload.github.com/jeslage/adaptive-modular-scale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslage%2Fadaptive-modular-scale/sbom","scorecard":{"id":516304,"data":{"date":"2025-08-11","repo":{"name":"github.com/jeslage/adaptive-modular-scale","commit":"69582a02932e762fd8e0668d777ced9938281555"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"35 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T01:55:04.942Z","repository_id":44011978,"created_at":"2025-08-20T01:55:04.943Z","updated_at":"2025-08-20T01:55:04.943Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","css-in-js","fluid","interpolation","modular-scales","typography"],"created_at":"2025-02-02T06:17:49.160Z","updated_at":"2026-01-28T01:35:24.612Z","avatar_url":"https://github.com/jeslage.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adaptive Modular Scale\n\n[![npm version](https://badge.fury.io/js/adaptive-modular-scale.svg)](https://www.npmjs.com/package/adaptive-modular-scale)\n[![Codecov Coverage](https://img.shields.io/codecov/c/github/jeslage/adaptive-modular-scale.svg?style=shield)](https://codecov.io/gh/jeslage/adaptive-modular-scale/)\n[![CircleCI](https://circleci.com/gh/jeslage/adaptive-modular-scale.svg?style=shield)](https://circleci.com/gh/jeslage/adaptive-modular-scale)\n\nA small javascript helper to get an adaptive modular scale font-size css string. It will interpolate between two modular scales and breakpoints and will return you sizes based on the given modular scales. This package is inspired by this [tool](https://codepen.io/tol-is/pen/mQVLPY) by Florian Schulz.\n\n```bash\nyarn add adaptive-modular-scale\n\nnpm install adaptive-modular-scale\n```\n\n## Usage\n\n```js\nimport styled from 'styled-components';\nimport adaptiveModularScale from 'adaptive-modular-scale';\n\nconst Headline = styled.h1`\n  ${adaptiveModularScale(3, {\n    // Minimum and maximum base\n    base: [14, 16],\n    // Minimum and maximum ratio\n    ratio: [1.2, 1.78],\n    // Two screen widths to interpolate between\n    width: [320, 960],\n    // Number of breakpoints between two widths\n    breakpoints?: 8,\n    // Optional corrections for steps\n    corrections?: {\n      // Correct minimal and maximum size for step. The below example\n      // will correct the minimal step by -1px and the maximum step by +2px\n      3: [-1, 2]\n    },\n    lineHeights?: {\n      // Add minimal and maximum lineHeights for step.\n      3: [1.2, 1.5]\n    }\n  })}\n`;\n```\n\nThe above example will return the following css.\n\n```css\n.sc-bZQynM {\n  font-size: 1.45rem;\n  line-height: 1.2;\n\n  @media (min-width: 25rem) {\n    font-size: 1.989rem;\n    line-height: 1.2375;\n  }\n  @media (min-width: 30rem) {\n    font-size: 2.528rem;\n    line-height: 1.275;\n  }\n  @media (min-width: 35rem) {\n    font-size: 3.068rem;\n    line-height: 1.3125;\n  }\n  @media (min-width: 40rem) {\n    font-size: 3.607rem;\n    line-height: 1.35;\n  }\n  @media (min-width: 45rem) {\n    font-size: 4.147rem;\n    line-height: 1.3875;\n  }\n  @media (min-width: 50rem) {\n    font-size: 4.686rem;\n    line-height: 1.425;\n  }\n  @media (min-width: 55rem) {\n    font-size: 5.225rem;\n    line-height: 1.4625;\n  }\n  @media (min-width: 60rem) {\n    font-size: 5.765rem;\n    line-height: 1.5;\n  }\n}\n```\n\n## ThemeProvider\n\nYou can also add an `adaptiveModularScale` key to the theme object of your ThemeProvider.\n\n**Example**\n\n```js\nimport styled, { ThemeProvider } from 'styled-components';\nimport adaptiveModularScale from 'adaptive-modular-scale';\n\nconst theme = {\n  adaptiveModularScale: {\n    base: [14, 16],\n    ratio: [1.2, 1.78],\n    width: [320, 960],\n    breakpoints: 8\n  }\n};\n\n// If you added the modular scale values to the ThemeProvider\n// you dont have to pass it down every time\nconst Headline = styled.h1`\n  ${adaptiveModularScale(5)}\n`;\n\nconst App = () =\u003e (\n  \u003cThemeProvider theme={theme}\u003e\n    \u003cHeadline\u003eAn adaptive modular scale sized headline\u003c/Headline\u003e\n  \u003c/ThemeProvider\u003e\n);\n```\n\n## Custom css property\n\nBy default `adaptive-modular-scale` uses `font-size` as the css property. But you can also change the property by adding a property key to your config object.\n\n**Example**\n\n```js\nimport styled, { ThemeProvider } from 'styled-components';\nimport adaptiveModularScale from 'adaptive-modular-scale';\n\nconst Headline = styled.h1`\n  ${adaptiveModularScale(5, { property: 'margin-bottom' })}\n`;\n```\n\n## Options\n\n### `step`\n\n`number` | required\n\nThe step on the modular scale\n\n### `config`\n\n`object` | required\n\n### `config.base`\n\n`[number, number]` | required\n\nArray of minimum and maximum base size of modular scale.\n\n### `config.ratio`\n\n`[number, number]` | required\n\nArray of minimum and maximum ratio of modular scale.\n\n### `config.width`\n\n`[number, number]` | required\n\nArray of two screen widths in px. Between these values the modular scale will interpolate between both scales based on screen width.\n\n### `config.breakpoints`\n\n`number` | required\n\nNumber of breakpoints between the two given screen widths which will be rendered to the css string.\n\n### `config.corrections`\n\n`{ [step]: [number, number] }` | optional\n\nAdd optional corrections array with steps as keys.\n\n```js\nconst corrections = {\n  // This will correct the minimal size of step \"0\" by -2px\n  // and the maximum size by +1px\n  0: [-2, 1]\n};\n```\n\n### `config.lineHeights`\n\n`{ [step]: [number, number] }` | optional\n\nAdd optional lineHeights array with steps as keys.\n\n### `config.property`\n\n`string` | optional | default: \"font-size\"\n\nAdd optional css property if you want to use adaptive modular scale for another property than font-size.\n\n## Additional methods\n\n`adaptive-modular-scale` also exports a default modular scale method.\n\n```js\nimport styled from 'styled-components';\nimport { modularScale } from 'adaptive-modular-scale';\n\nconst base = 16;\nconst ratio = 1.6;\n\nconst Headline = styled.h1`\n  font-size: ${modularScale(5, base, ratio)}px;\n`;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeslage%2Fadaptive-modular-scale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeslage%2Fadaptive-modular-scale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeslage%2Fadaptive-modular-scale/lists"}