{"id":13564108,"url":"https://github.com/csstools/postcss-short","last_synced_at":"2025-04-28T17:31:20.312Z","repository":{"id":32801691,"uuid":"36394143","full_name":"csstools/postcss-short","owner":"csstools","description":"Use advanced shorthand properties in CSS","archived":false,"fork":false,"pushed_at":"2018-10-10T13:26:12.000Z","size":123,"stargazers_count":187,"open_issues_count":3,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-14T03:59:11.107Z","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":"react-navigation/react-navigation","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-05-27T20:33:47.000Z","updated_at":"2023-12-06T03:58:18.000Z","dependencies_parsed_at":"2022-09-21T02:30:53.715Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-short","commit_stats":null,"previous_names":["jonathantneal/postcss-short"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-short/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223040331,"owners_count":17078008,"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-08-01T13:01:26.622Z","updated_at":"2024-11-11T15:13:01.298Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","readme":"# PostCSS Short [\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] lets you use advanced shorthand properties in CSS.\n\n\u003e PostCSS Short has been featured in **[Smashing Magazine]**. I hope all of\n\u003e these shorthands are useful and clear to first-time lookers. I hope they\n\u003e improve the readability of your stylesheets and save you development time\n\u003e along the way. Thank you so much for your support.\n\n## Features\n\n### Size\n\nDeclare `width` and `height` together with `size`.\n\n```css\n/* before */\n\n.icon {\n  size: 48px;\n}\n\n/* after */\n\n.icon {\n  width: 48px;\n  height: 48px;\n}\n```\n\n### Margin and Padding\n\nAvoid clobbering previous `margin` or `padding` values with a skip token.\n\n```css\n/* before */\n\n.frame {\n  margin: * auto;\n}\n\n/* after */\n\n.frame {\n  margin-right: auto;\n  margin-left: auto;\n}\n```\n\n### Position\n\nDeclare `top`, `right`, `bottom`, and `left` values in `position`. Just like before, omit sides with a skip token.\n\n```css\n/* before */\n\n.banner {\n  position: fixed 0 0 *;\n}\n\n/* after */\n\n.banner {\n  position: fixed;\n  top: 0;\n  right: 0;\n  left: 0;\n}\n```\n\n### Color\n\nDeclare `color` and `background-color` together.\n\n```css\n/* before */\n\n.canvas {\n  color: #abccfc #212231;\n}\n\n/* after */\n\n.canvas {\n  color: #abccfc;\n  background-color: #212231;\n}\n```\n\n### Overflow\n\nDeclare individual `x` and `y` values in `overflow`. Omit sides with a skip\ntoken.\n\n```css\n/* before */\n\n.scrollable {\n  overflow: * auto;\n}\n\n/* after */\n\n.scrollable {\n  overflow-y: auto;\n}\n```\n\n### Border\n\nOmit sides within `border-` properties and fully define individual values on the `border` property.\n\n```css\n/* before */\n\n.container {\n  border: 1px 2px / * / #343434;\n}\n\n.container--variation {\n  border-width: * * 3px;\n}\n\n/* after */\n\n.container {\n  border-width: 1px 2px;\n  border-color: #343434;\n}\n\n.container--variation {\n  border-bottom-width: 3px;\n}\n```\n\n### Border Radius\n\nDeclare `border-radius` properties using the [clockwise syntax].\n\n```css\n/* before */\n\n.container {\n  border-bottom-radius: 10px;\n}\n\n/* after */\n\n.container {\n  border-bottom-left-radius: 10px;\n  border-bottom-right-radius: 10px;\n}\n```\n\n### Font Size\n\nDeclare `font-size` and `line-height` together.\n\n```css\n/* before */\n\n.heading {\n  font-size: 1.25em / 2;\n}\n\n/* after */\n\n.heading {\n  font-size: 1.25em;\n  line-height: 2;\n}\n```\n\n### Font Weight\n\nDeclare `font-weight` with common names.\n\n```css\n/* before */\n\np {\n  font-weight: light;\n}\n\n/* after */\n\np {\n  font-weight: 300;\n}\n```\n\n## Usage\n\nAdd [PostCSS Short] to your project:\n\n```bash\nnpm install postcss-short --save-dev\n```\n\nUse [PostCSS Short] to process your CSS:\n\n```js\nconst postcssShort = require('postcss-short');\n\npostcssShort.process(YOUR_CSS /*, processOptions, pluginOptions */);\n```\n\nOr use it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssShort = require('postcss-short');\n\npostcss([\n  postcssShort(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Short] 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## Plugins\n\n[PostCSS Short] is powered by the following plugins:\n\n- [PostCSS Short Border](https://github.com/jonathantneal/postcss-short-border)\n- [PostCSS Short Border Radius](https://github.com/jonathantneal/postcss-short-border-radius)\n- [PostCSS Short Color](https://github.com/jonathantneal/postcss-short-color)\n- [PostCSS Short Font-Size](https://github.com/jonathantneal/postcss-short-font-size)\n- [PostCSS Short Overflow](https://github.com/jonathantneal/postcss-short-overflow)\n- [PostCSS Short Position](https://github.com/jonathantneal/postcss-short-position)\n- [PostCSS Short Size](https://github.com/jonathantneal/postcss-short-size)\n- [PostCSS Short Spacing](https://github.com/jonathantneal/postcss-short-spacing)\n- [PostCSS Font Weights](https://github.com/jonathantneal/postcss-font-weights)\n\nSome of these plugins have more features than are described here.\n\n## Options\n\n### features\n\nEach plugin’s options may be configured by targeting the plugin’s namespace.\nAny plugin may be disabled by setting the plugin’s options as false.\n\n```js\npostcssShort({\n  features: {\n    'font-size': {\n      prefix: 'x'\n    },\n    'position': false\n  }\n});\n```\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-border`.\n\n```js\npostcssShort({ prefix: 'x' });\n```\n\n```pcss\n.example-1 {\n  -x-border-color: blue blue *;\n  -x-color: * #fafafa;\n}\n\n/* becomes */\n\n.example-1 {\n  border-top-color: blue;\n  border-right-color: blue;\n  border-left-color: blue;\n  background-color: #fafafa;\n}\n```\n\n#### skip\n\nThe `skip` option defines the skip token used to ignore portions of the\nshorthand.\n\n```js\npostcssShort({ skip: '-' });\n```\n\n```pcss\n.example-1 {\n  border-color: blue blue -;\n  color: - #fafafa;\n}\n\n/* becomes */\n\n.example-1 {\n  border-top-color: blue;\n  border-right-color: blue;\n  border-left-color: blue;\n  background-color: #fafafa;\n}\n```\n\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-short.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-short\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.svg\n[npm-url]: https://www.npmjs.com/package/postcss-short\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Short]: https://github.com/jonathantneal/postcss-short\n[clockwise syntax]: https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#Tricky_edge_cases\n[Smashing Magazine]: https://www.smashingmagazine.com/2015/12/introduction-to-postcss/#extendedshorthandpropertieswithpostcss-short\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-short","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short/lists"}