1.0.4 • Published 7 years ago

text-fit-component v1.0.4

Weekly downloads
2
License
WTFPL
Repository
github
Last release
7 years ago

text-fit-component

See the demo

Puts text inside of another element at just the right font size so that it perfectly fits the width of its container.

Uses get-text-fit-size.

Automatically adjust on window resize.

Doesn't work in IE or Edge yet.

Example

<body>
	<h1 id="header"></h1>
	<p>Aw yeah</p>
</body>
const TextFit = require('text-fit-component')

new TextFit({
	target: document.getElementById('header'),
	data: {
		text: 'This is a cool header'
	}
})

This module is also usable as a Svelte component.

<h1 id="header">
	<TextFit text="This is a cool header" />
</h1>
<p>Aw yeah</p>

<script>
	import TextFit from 'text-fit-component'

	export default {
		components: {
			TextFit
		}
	}
</script>

License

WTFPL

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago