{"id":19653025,"url":"https://github.com/csstools/postcss-short-spacing","last_synced_at":"2025-04-28T17:31:09.755Z","repository":{"id":57328505,"uuid":"42800441","full_name":"csstools/postcss-short-spacing","owner":"csstools","description":"Omit sides within margin and padding properties in CSS","archived":true,"fork":false,"pushed_at":"2018-10-09T22:13:46.000Z","size":22,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-24T06:24:04.242Z","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-20T04:43:18.000Z","updated_at":"2024-10-18T11:26:52.000Z","dependencies_parsed_at":"2022-09-21T01:52:13.820Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-short-spacing","commit_stats":null,"previous_names":["jonathantneal/postcss-short-spacing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-spacing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-spacing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-spacing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-spacing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-short-spacing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251337134,"owners_count":21573312,"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:56.969Z","updated_at":"2025-04-28T17:31:09.735Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Short Spacing [\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 Spacing] lets you omit sides within `margin` and `padding`\nproperties in CSS.\n\n```pcss\nsection {\n  margin: 1em *;\n}\n\n/* becomes */\n\nsection {\n  margin-top: 1em;\n  margin-bottom: 1em;\n}\n```\n\nSupported properties include `margin`, `margin-block`, `margin-inline`,\n`margin-start`, `margin-end`, `padding`, `padding-block`, `padding-inline`,\n`padding-start`, and `padding-end`.\n\n## Usage\n\nAdd [PostCSS Short Spacing] to your project:\n\n```bash\nnpm install postcss-short-spacing --save-dev\n```\n\nUse [PostCSS Short Spacing] to process your CSS:\n\n```js\nconst postcssShortSpacing = require('postcss-short-spacing');\n\npostcssShortSpacing.process(YOUR_CSS /*, processOptions, pluginOptions */);\n```\n\nOr use it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssShortSpacing = require('postcss-short-spacing');\n\npostcss([\n  postcssShortSpacing(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Short Spacing] 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\npostcssShortSpacing({ prefix: 'x' });\n```\n\n```pcss\nbody {\n  -x-margin: 1em *;\n}\n\n/* becomes */\n\nsection {\n  margin-top: 1em;\n  margin-bottom: 1em;\n}\n```\n\n#### skip\n\nThe `skip` option defines the skip token used to ignore portions of the\nshorthand.\n\n```js\npostcssShortSpacing({ skip: '-' });\n```\n\n```pcss\nbody {\n  -x-margin: 1em -;\n}\n\n/* becomes */\n\nsection {\n  margin-top: 1em;\n  margin-bottom: 1em;\n}\n```\n\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-short-spacing.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-short-spacing\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-spacing.svg\n[npm-url]: https://www.npmjs.com/package/postcss-short-spacing\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Short Spacing]: https://github.com/jonathantneal/postcss-short-spacing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short-spacing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-short-spacing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short-spacing/lists"}