vue-line-fit
Version:
analytically fit single line text to box
52 lines (41 loc) • 1.13 kB
Markdown
# vue-line-fit
## Why
To make text automatically fit
## What
`vue-line-fit` is a small component which fits its content to its dimensions.
### [See it in action](https://vue-comps.github.io/vue-line-fit)
# Install
```sh
npm install --save-dev vue-line-fit
```
or include `build/bundle.js`
## Usage
```coffee
# link the components up
components:
"vc-line-fit": require "vue-line-fit"
# or:
"vc-line-fit": window.vueComps.vueLineFit
```
```jade
# in the template
vc-line-fit some text to fit
```
see `dev/` folder for examples
#### Props
| Name | type | default | description |
| ---:| --- | ---| --- |
| refit | Boolean | false | will refit on element resize |
| letterSpacing | Boolean | false | will use 'letter-spacing' to fill the whole box|
| valign | Boolean | false | will align text vertically in the box|
# Development
Clone repository
```sh
npm install
npm run dev
```
Browse to `http://localhost:8080/`
Best development experience in [atom](https://atom.io/) with [vue-autocompile](https://atom.io/packages/vue-autocompile).
## License
Copyright (c) 2016 Paul Pflugradt
Licensed under the MIT license.