{"id":17973852,"url":"https://github.com/csstools/postcss-font-weights","last_synced_at":"2025-03-30T11:31:34.862Z","repository":{"id":34072046,"uuid":"37862359","full_name":"csstools/postcss-font-weights","owner":"csstools","description":"Use common font weights in CSS","archived":true,"fork":false,"pushed_at":"2018-10-09T03:54:01.000Z","size":29,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T00:27:59.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-22T15:08:15.000Z","updated_at":"2024-12-09T02:14:05.000Z","dependencies_parsed_at":"2022-07-16T23:16:11.071Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-font-weights","commit_stats":null,"previous_names":["jonathantneal/postcss-font-weights"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-font-weights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-font-weights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-font-weights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-font-weights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-font-weights/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245979855,"owners_count":20704016,"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-10-29T17:03:52.624Z","updated_at":"2025-03-30T11:31:34.133Z","avatar_url":"https://github.com/csstools.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Font Weights [\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS\" width=\"90\" height=\"90\" align=\"right\"\u003e][postcss]\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Support Chat][git-img]][git-url]\n\n[PostCSS Font Weights] lets you do this in CSS.\n\n```pcss\nh1, h2, h3 {\n  font-weight: light;\n}\n\npre {\n   font: light 100% monospace;\n}\n\n/* becomes */\n\nh1, h2, h3 {\n  font-weight: 300;\n}\n\npre {\n   font: 300 100% monospace;\n}\n```\n\nCommon font weights are found in the Font Weight Numeric Values section of the\n[CSS Fonts Specification].\n\n| Common Weight | Numeric Value |\n| ------------- | ------------- |\n| thin          | 100           |\n| extralight    | 200           |\n| ultralight    | 200           |\n| light         | 300           |\n| book          | 400           |\n| normal        | 400           |\n| regular       | 400           |\n| roman         | 400           |\n| medium        | 500           |\n| semibold      | 600           |\n| demibold      | 600           |\n| bold          | 700           |\n| extrabold     | 800           |\n| ultrabold     | 800           |\n| black         | 900           |\n| heavy         | 900           |\n\nThese common font weights are converted to their numeric counterpart.\n\n## Usage\n\nAdd [PostCSS Font Weights] to your project:\n\n```bash\nnpm install postcss-font-weights --save-dev\n```\n\nUse [PostCSS Font Weights] to process your CSS:\n\n```js\nconst postcssFontWeights = require('postcss-font-weights');\n\npostcssFontWeights.process(YOUR_CSS /*, processOptions, pluginOptions */);\n```\n\nOr use it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssFontWeights = require('postcss-font-weights');\n\npostcss([\n  postcssFontWeights(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Font Weights] runs in all Node environments, with special instructions for:\n\n| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |\n| --- | --- | --- | --- | --- | --- |\n\n## Options\n\n#### prefix\n\nThe `prefix` option determines the prefix applied to properties being processed\n(e.g. `x` for `-x-font-weight`). Wrapping dashes (`-`) are automatically\napplied.\n\n### custom\n\nThe `custom` option determines additional font weight keywords and numeric\npairs (e.g. `custom: { lite: 300 }` for `font-weight: lite` to become\n`font-weight: 300`).\n\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-font-weights.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-font-weights\n[git-img]: https://img.shields.io/badge/support-chat-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[npm-img]: https://img.shields.io/npm/v/postcss-font-weights.svg\n[npm-url]: https://www.npmjs.com/package/postcss-font-weights\n\n[CSS Fonts Specification]: https://www.w3.org/TR/css-fonts-3/#font-weight-numeric-values\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Font Weights]: https://github.com/jonathantneal/postcss-font-weights\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-font-weights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-font-weights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-font-weights/lists"}