presetAttributify的使用

unocss预设 - Attributify

vitesse-lite

clone 此项目快速使用特性。

# Attributify preset

场景:

平常在写原子化css的时候,写一个border,特别的麻烦。

因为border的声明比较多。

1
rounded border-2 border-blue-200 border-solid

border-radius,border-width,border-color border-style

1
2
3
4
5
6
7
8
9
<button  
  bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600"  
  text="sm white"  
  font="mono light"  
  p="y-2 x-4"  
  border="rounded 2 solid  blue-200"  
>  
  Button  
</button>

使用预设以后写css

1
border="rounded 2 solid  blue-200"  
Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy