Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hendrikeng/tailwindcss-object-fit
https://github.com/hendrikeng/tailwindcss-object-fit
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hendrikeng/tailwindcss-object-fit
- Owner: hendrikeng
- License: mit
- Created: 2018-06-05T14:00:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-05T14:20:16.000Z (over 6 years ago)
- Last Synced: 2024-09-24T19:56:50.844Z (5 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Object-fit - TailwindCSS Plugin
This plugin generates classes for object-fit image properties.
## Installation
Pull it in through npm or yarn:
```bash
npm install tailwindcss-object-fit
``````bash
yarn add tailwindcss-object-fit
```## Usage
Just add it to the plugins array of your Tailwind config.
```js
plugins: [
// Other plugins
require('tailwindcss-object-fit')(['responsive']),
],
```By default the plugin generates the following classes:
```css
.object-contain: { objectFit: 'contain' }
.object-cover: { objectFit: 'cover' }
.object-fill: { objectFit: 'fill' }
.object-none: { objectFit: 'none' }
.object-scale: { objectFit: 'scale-down' }
```## License
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).