Skip to content

Instantly share code, notes, and snippets.

@Kcko
Created February 20, 2024 08:27
Show Gist options
  • Save Kcko/2c113ff8897f6f4e16ca17a3db00a05b to your computer and use it in GitHub Desktop.
Save Kcko/2c113ff8897f6f4e16ca17a3db00a05b to your computer and use it in GitHub Desktop.
<!--
- https://www.youtube.com/watch?v=sxxUK0l8jKE
- https://play.tailwindcss.com/4cuLPqCv05
-->
<div class="p-20 flex justify-center items-center gap-12">
<img class="avatar-sm" src="https://res.cloudinary.com/thirus/image/upload/v1705061543/images/avatar.png" alt="" />
<img class="avatar" src="https://res.cloudinary.com/thirus/image/upload/v1705061543/images/avatar.png" alt="" />
<img class="avatar-lg" src="https://res.cloudinary.com/thirus/image/upload/v1705061543/images/avatar.png" alt="" />
<img class="avatar-xl" src="https://res.cloudinary.com/thirus/image/upload/v1705061543/images/avatar.png" alt="" />
</div>
/** @type {import('tailwindcss').Config} */
const plugin = require('tailwindcss/plugin')
export default {
theme: {
extend: {
avatarSize: {
sm: '3rem',
DEFAULT: '5rem',
lg: '7rem',
xl: '10rem'
}
},
},
plugins: [
plugin(function({ matchComponents, theme }){
matchComponents(
{
avatar: (value) => ({
width: value,
height: value,
borderRadius: '9999px'
})
},
{
values: theme('avatarSize')
}
)
})
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment