import { defineConfig, presetAttributify, presetMini } from 'unocss'
const breakpoints = {
'sm': '641px',
'md': '769px',
'lg': '1025px',
'xl': '1367px',
'2xl': '1441px',
'3xl': '1921px',
}
export default defineConfig({
presets: [
presetMini({
breakpoints,
}),
presetAttributify(),
],
variants: [
(matcher) => {
const match = matcher.match(/^max-([a-z0-9]+):/)
if (match) {
const bp = match[1] as keyof typeof breakpoints
const value = breakpoints[bp]
if (!value) {
return
}
return {
matcher: matcher.replace(`max-${bp}:`, ''),
parent: `@media (max-width: ${value})`,
}
}
},
],
theme: {
breakpoints,
},
shortcuts: {
'line-clamp-2': 'overflow-hidden text-ellipsis [-webkit-line-clamp:2] [-webkit-box-orient:vertical] [display:-webkit-box]',
},
safelist: [
'line-clamp-2',
],
})