Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tolking/postcss-flex-alias
PostCSS plugin easily write flex
https://github.com/tolking/postcss-flex-alias
flex plugin postcss postcss-flex-alias
Last synced: 8 days ago
JSON representation
PostCSS plugin easily write flex
- Host: GitHub
- URL: https://github.com/tolking/postcss-flex-alias
- Owner: tolking
- License: mit
- Created: 2019-04-04T10:24:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T12:48:32.000Z (almost 5 years ago)
- Last Synced: 2024-10-12T00:23:38.062Z (about 1 month ago)
- Topics: flex, plugin, postcss, postcss-flex-alias
- Language: JavaScript
- Homepage:
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS flex-alias [![Build Status][ci-img]][ci]
[PostCSS] plugin easily write flex
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/tolking/postcss-flex-alias.svg
[ci]: https://travis-ci.org/tolking/postcss-flex-alias## [Documentation](https://ououe.com/lib/postcss-flex-alias.html)
Click on the Documentation to learn more## Explain
**display: flex-[`flex-flow`][`justify-content`][`align-items`][`align-content`]**
### flex-flow
- `x`: row nowrap
- `y`: column nowrap
- `w`: row wrap
- `m`: column warp### justify-content
- `s`: flex-start
- `a`: space-around
- `b`: space-between
- `c`: center
- `e`: flex-end### align-items
- `s`: flex-start
- `b`: baseline
- `c`: center
- `e`: flex-end
- `h`: stretch### align-content
- `s`: flex-start
- `a`: space-around
- `b`: space-between
- `c`: center
- `e`: flex-end## Example
``` css
/* input */
.foo {
display: flex-xcc;
}
```
``` css
/* output */
.foo {
display: flex;
justify-content: center;
align-items: center;
}
```
---``` css
/* input */
.foo {
display: flex-wbc;
}
```
``` css
/* output */
.foo {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
```## Usage
``` js
postcss([ require('postcss-flex-alias') ])// or postcss.config.js
plugins: {
'postcss-flex-alias': {}
}
```See [PostCSS] docs for examples for your environment.