refactor: remove class shortcuts#604
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
This was changed in npmx-dev#587
|
can I ask what the motivation is for this? does it improve performance or reduce the amount of emitted css or markup? |
…-shortcuts # Conflicts: # app/pages/[...package].vue
|
@danielroe This relates to your answer to my question Main benefits:
Currently I found it a bit hard to figure out, where some styles where coming from, and simplifying the ways components can be styled across the code base would improve DX imho. Like I said in the initial PR message: This isn't a complete change, there are some other shortcuts, that can also be moved into components, but I wanted to get the easy ones out of the way and would open individual PRs for the more complex cases. Should the mixture of atomic utility classes and shortcuts be a deliberate design decision, this PR can probably be closed. |
| @@ -0,0 +1,12 @@ | |||
| <!-- Vue component that only takes a class as prop and adds `bg-bg-elevated rounded animate-skeleton-pulse` to that class --> | |||
| <script setup lang="ts"> | |||
There was a problem hiding this comment.
fyi: you shouldn't create style or class bindings on vue components - vue handles it itself
There was a problem hiding this comment.
we should avoid single-named components as this can cause confusion with native html elements
There was a problem hiding this comment.
I was thinking about moving this to a folder like /Base. This would also solve the naming issue when importing it in /Packages/Card.vue.
There was a problem hiding this comment.
makes sense - either is good. 👍
we can do that once we start adding more base components
Co-authored-by: Daniel Roe <daniel@roe.dev>
This remove a few unnecessary UnoCSS shortcuts as follows:
Cardcomponent and removecardandcard-interactiveshortcutSkeletonInlineandSkeletonBlockcomponents and removeskeletonshortcutcode-blockinput-basedividersectionThere are some more Uno shortcuts that can be removed, but they need a little more care and probably their own PR. Those were the easy wins.