{"id":19653017,"url":"https://github.com/csstools/postcss-short-size","last_synced_at":"2025-04-28T17:31:08.951Z","repository":{"id":57147291,"uuid":"42840820","full_name":"csstools/postcss-short-size","owner":"csstools","description":"Use size properties in CSS","archived":true,"fork":false,"pushed_at":"2018-10-10T03:24:40.000Z","size":24,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-21T21:40:07.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jonathantneal.github.io/postcss-short/","language":"JavaScript","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-09-21T03:04:02.000Z","updated_at":"2024-10-18T11:27:40.000Z","dependencies_parsed_at":"2022-09-05T16:50:16.439Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-short-size","commit_stats":null,"previous_names":["jonathantneal/postcss-short-size"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-short-size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219502,"owners_count":21554443,"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-11T15:12:55.652Z","updated_at":"2025-04-28T17:31:08.930Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Short Size [\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 Short Size] lets you use `size` properties to represent `width` and\n`height` in CSS, following the [1-to-2 syntax].\n\n```pcss\n.image {\n  size: 100px;\n}\n\n.video {\n  max-size: 400px 300px;\n}\n\n/* becomes */\n\n.image {\n  width: 100px;\n  height: 100px;\n}\n\n.video {\n  max-width: 400px;\n  max-height: 300px;\n}\n```\n\nThe supported properties are `size`, `min-size`, and `max-size`.\n\n## Usage\n\nAdd [PostCSS Short Size] to your project:\n\n```bash\nnpm install postcss-short-size --save-dev\n```\n\nUse [PostCSS Short Size] to process your CSS:\n\n```js\nconst postcssShortSize = require('postcss-short-size');\n\npostcssShortSize.process(YOUR_CSS /*, processOptions, pluginOptions */);\n```\n\nOr use it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssShortSize = require('postcss-short-size');\n\npostcss([\n  postcssShortSize(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Short Size] 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 defines a prefix required by properties being transformed.\nWrapping dashes are automatically applied, so that `x` would transform\n`-x-margin`.\n\n```js\npostcssShortSize({ prefix: 'x' });\n```\n\n```pcss\n.image {\n  x-size: 100px;\n}\n\n/* becomes */\n\n.image {\n  width: 100px;\n  height: 100px;\n}\n```\n\n#### skip\n\nThe `skip` option defines the skip token used to ignore portions of the\nshorthand.\n\n```js\npostcssShortSize({ skip: '-' });\n```\n\n```pcss\n.image {\n  size: - 100px;\n}\n\n/* becomes */\n\n.image {\n  height: 100px;\n}\n```\n\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-short-size.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-short-size\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-short-size.svg\n[npm-url]: https://www.npmjs.com/package/postcss-short-size\n\n[1-to-2 syntax]: https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#Tricky_edge_cases\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Short Size]: https://github.com/jonathantneal/postcss-short-size\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short-size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-short-size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short-size/lists"}