Skip to content

Commit

Permalink
feat: add unocss shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklin committed Jul 18, 2023
1 parent e0752da commit c8d91cb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/node/vite/src/plugins/unocss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,33 @@ export function createUnoCSSPluginConfig(): PluginOption {
warn: true,
}),
],
shortcuts: {
// position
"pr": "relative",
"pa": "absolute",
"pf": "fixed",
"ps": "sticky",

// position layout
"position-x-center": "absolute left-1/2 -translate-x-1/2",
"pxc": "position-x-center",
"position-y-center": "absolute top-1/2 -translate-y-1/2",
"pyc": "position-y-center",
"position-center": "position-x-center position-y-center",
"pc": "position-center",

// size
"size-0": "w-0 h-0",
"size-full": "w-full h-full",
"size-screen": "w-screen h-screen",
"size-1/2": "w-1/2 h-1/2",

// flex layout
"flex-center": "flex justify-center items-center",
"flex-col-center": "flex-center flex-col",
"flex-x-center": "flex justify-center",
"flex-y-center": "flex items-center",
},
transformers: [
transformerDirectives(),
transformerVariantGroup(),
Expand Down

2 comments on commit c8d91cb

@vercel
Copy link

@vercel vercel bot commented on c8d91cb Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

celeris-web-api – ./services/admin

celeris-web-api-git-master-kirklin.vercel.app
celeris-web-api.vercel.app
celeris-web-api-kirklin.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c8d91cb Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

celeris-web – ./apps/admin

celeris-web.vercel.app
celeris-web-git-master-kirklin.vercel.app
celeris-web-kirklin.vercel.app

Please sign in to comment.