{"id":19653033,"url":"https://github.com/csstools/postcss-transform-shortcut","last_synced_at":"2025-04-28T17:31:13.114Z","repository":{"id":35105718,"uuid":"39284118","full_name":"csstools/postcss-transform-shortcut","owner":"csstools","description":"Use shorthand transform properties in CSS","archived":true,"fork":false,"pushed_at":"2016-12-14T18:14:52.000Z","size":20,"stargazers_count":49,"open_issues_count":5,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-21T21:40:16.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/jonathantneal/postcss-transform-shortcut","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-07-18T02:45:34.000Z","updated_at":"2024-12-28T18:59:09.000Z","dependencies_parsed_at":"2022-08-18T01:55:42.080Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-transform-shortcut","commit_stats":null,"previous_names":["jonathantneal/postcss-transform-shortcut"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-transform-shortcut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-transform-shortcut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-transform-shortcut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-transform-shortcut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-transform-shortcut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219414,"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:58.135Z","updated_at":"2025-04-28T17:31:13.095Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Transform Shortcut \u003ca href=\"https://github.com/postcss/postcss\"\u003e\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\"\u003e\u003c/a\u003e\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Licensing][lic-image]][lic-url]\n[![Changelog][log-image]][log-url]\n[![Gitter Chat][git-image]][git-url]\n\n[Transform Shortcut] lets you use shorthand transform properties in CSS, following the [CSS Transform Module Level 2 Specification].\n\n```css\n/* before */\n\n.transform {\n\ttransform: skewX(25deg);\n\trotate: 180deg;\n\tscale: 2 2;\n\ttranslate: 10px 10px;\n}\n\n/* after */\n\n.transform {\n\ttransform: skewX(25deg) rotate3d(180deg,0,1) scale3d(2,2,1) translate3d(10px,10px,0px);\n}\n\n```\n\nThe `translate`, `rotate`, and `scale` properties allow authors to specify simple transforms independently, in a way that maps to typical user interface usage, rather than having to remember the order in transform that keeps the actions of `transform()`, `rotate()` and `scale()` independent and acting in screen coordinates.\n\nThe `rotate` property accepts an angle to rotate an element, and optionally an axis to rotate it around, specified as the X, Y, and Z lengths of an origin-anchored vector. If the axis is unspecified, it defaults to `0 0 1`, causing a \"2d rotation\" in the plane of the screen.\n\nThe `scale` property accepts 1-3 values, each specifying a scale along one axis, in order X, Y, then Z. Unspecified scales default to `1`.\n\nThe `translate` property accepts 1-3 values, each specifying a translation against one axis, in the order X, Y, then Z. Unspecified translations default to `0px`.\n\n## Caveat\n\nOnce these new properties are supported natively, you can also use them to style transforms across multiple rules without overwriting a previous rule’s transforms. Unfortunately, I cannot predict how your CSS rules will be inherited without also knowing your DOM. Therefore, this particularly useful feature cannot be simulated at this time.\n\n```css\n.button {\n\trotate: 45deg;\n}\n\n.button--warn {\n\tscale: 2;\n}\n```\n\n## Usage\n\nAdd [Transform Shortcut] to your build tool:\n\n```bash\nnpm install jonathantneal/postcss-transform-shortcut --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-transform-shortcut').process(YOUR_CSS, { /* options */ });\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [Transform Shortcut] as a PostCSS plugin:\n\n```js\npostcss([\n\trequire('postcss-transform-shortcut')({ /* options */ })\n]).process(YOUR_CSS, /* options */);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [Transform Shortcut] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n\treturn gulp.src('./src/*.css').pipe(\n\t\tpostcss([\n\t\t\trequire('postcss-transform-shortcut')({ /* options */ })\n\t\t])\n\t).pipe(\n\t\tgulp.dest('.')\n\t);\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [Transform Shortcut] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n\tpostcss: {\n\t\toptions: {\n\t\t\tuse: [\n\t\t\t\trequire('postcss-transform-shortcut')({ /* options */ })\n\t\t\t]\n\t\t},\n\t\tdist: {\n\t\t\tsrc: '*.css'\n\t\t}\n\t}\n});\n```\n\n[npm-url]: https://www.npmjs.com/package/postcss-transform-shortcut\n[npm-img]: https://img.shields.io/npm/v/postcss-transform-shortcut.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-transform-shortcut\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-transform-shortcut.svg\n[lic-url]: LICENSE.md\n[lic-image]: https://img.shields.io/npm/l/postcss-transform-shortcut.svg\n[log-url]: CHANGELOG.md\n[log-image]: https://img.shields.io/badge/changelog-md-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[git-image]: https://img.shields.io/badge/chat-gitter-blue.svg\n\n[Transform Shortcut]: https://github.com/jonathantneal/postcss-transform-shortcut\n[PostCSS]: https://github.com/postcss/postcss\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n\n[CSS Transform Module Level 2 Specification]: https://drafts.csswg.org/css-transforms-2/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-transform-shortcut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-transform-shortcut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-transform-shortcut/lists"}