Skip to content

Commit

Permalink
✨ unocss rules/shortcut of ion-popup #113
Browse files Browse the repository at this point in the history
  • Loading branch information
trydofor committed Dec 16, 2024
1 parent cbd7e1f commit df694fc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/smooth-crabs-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fessional/razor-mobile": patch
"@fessional/razor-common": patch
---

✨ unocss ion-fit-card, common bool convertor
20 changes: 20 additions & 0 deletions layers/mobile/uno.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'unocss';

export default defineConfig({
rules: [
['ion-var-fit', {
'--width': 'fix-context',
'--height': 'fit-content',
}],
// https://ionicframework.com/docs/api/card
['ion-var-card', {
'--border-radius': '4px',
'--box-shadow': 'rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px',
}],
],
shortcuts: [
{
'ion-fit-card': 'ion-var-fit ion-var-card',
},
],
});
33 changes: 33 additions & 0 deletions plays/3-play-h5m/pages/03-popup.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<IonPage>
<IonHeader>
<IonToolbar>
<IonButtons slot="start">
<IonBackButton />
</IonButtons>
<IonTitle>Popup</IonTitle>
<IonButtons slot="end">
<IonMenuButton />
</IonButtons>
</IonToolbar>
</IonHeader>
<IonContent>
<div class="p-4">
<IonButton id="popup-default" class="text-white">
Popup Fit Card
</IonButton>
<IonModal trigger="popup-default" class="ion-fit-card">
<div class="w-40 h-30 p-4">
box of w-40 h-30 p-4
</div>
</IonModal>
</div>
</IonContent>
</IonPage>
</template>

<script lang="ts" setup>
definePageMeta({
name: 'Ion Modal popup',
});
</script>

0 comments on commit df694fc

Please sign in to comment.