unocss / unocss

The instant on-demand atomic CSS engine.

Home Page:https://unocss.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set shortcuts with the same name as the class

NicolaSpadari opened this issue · comments

Just started using unocss in a nuxt project, I'm migrating my apply classes to unocss shortcuts, and I'd like the container to be centered by default, like bootstrap does

My issue:

shortcuts: [
  // ...
  ["container", "container mx-auto"],
  // ...
],

This doesn't work, the container still doesn't have the margin properties, it's intended or it's a bug?
For now I'm using another class, like .box for the alias.

This causes a circular reference and naming collision. It just won't work.

If you want to extend some utils, you could simply add

.container {
  @apply mx-auto;
}

in your CSS.