forked from trent_larson/crowd-funder-for-time-pwa
Fix: re-organized dialog and notification z-indices
- Notifications and toasts now appear higher than dialogs when appearing together - Standardized dialog z-index - Added documentation for z-index guide
This commit is contained in:
69
doc/z-index-guide.md
Normal file
69
doc/z-index-guide.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Z-Index Guide — TimeSafari
|
||||
|
||||
**Author**: Development Team
|
||||
**Date**: 2025-08-25T19:38:09-08:00
|
||||
**Status**: 🎯 **ACTIVE** - Z-index layering standards
|
||||
|
||||
## Objective
|
||||
Establish consistent z-index values across the TimeSafari application to ensure proper layering of UI elements.
|
||||
|
||||
## Result
|
||||
This document defines the z-index hierarchy for all UI components.
|
||||
|
||||
## Use/Run
|
||||
Reference these values when implementing new components or modifying existing ones to maintain consistent layering.
|
||||
|
||||
## Z-Index Hierarchy
|
||||
|
||||
| Component | Z-Index | Usage |
|
||||
|-----------|---------|-------|
|
||||
| **Map** | `40` | Base map layer and map-related overlays |
|
||||
| **QuickNav** | `50` | Quick navigation bottom bar |
|
||||
| **Dialogs and Modals** | `100` | Modal dialogs, popups, and overlay content |
|
||||
| **Notifications and Toasts** | `120` | System notifications, alerts, and toast messages |
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Never exceed 120** - Keep the highest z-index reserved for critical notifications
|
||||
2. **Use increments of 10** - Leave room for future additions between layers
|
||||
3. **Document exceptions** - If you need a z-index outside this range, document the reason
|
||||
4. **Test layering** - Verify z-index behavior across different screen sizes and devices
|
||||
|
||||
## Common Pitfalls
|
||||
|
||||
- **Avoid arbitrary values** - Don't use random z-index numbers
|
||||
- **Don't nest high z-index** - Keep child elements within their parent's z-index range
|
||||
- **Consider stacking context** - Remember that `position: relative` creates new stacking contexts
|
||||
|
||||
## Next Steps
|
||||
|
||||
| Owner | Task | Exit Criteria | Target Date |
|
||||
|-------|------|---------------|-------------|
|
||||
| Dev Team | Apply z-index classes to existing components | All components use defined z-index values | 2025-09-01 |
|
||||
|
||||
## Competence Hooks
|
||||
|
||||
- **Why this works**: Creates predictable layering hierarchy that prevents UI conflicts
|
||||
- **Common pitfalls**: Using arbitrary z-index values or exceeding the defined range
|
||||
- **Next skill unlock**: Learn about CSS stacking contexts and their impact on z-index
|
||||
- **Teach-back**: Explain the z-index hierarchy to a team member without referencing this guide
|
||||
|
||||
## Collaboration Hooks
|
||||
|
||||
- **Reviewers**: Frontend team, UI/UX designers
|
||||
- **Sign-off checklist**:
|
||||
- [ ] All new components follow z-index guidelines
|
||||
- [ ] Existing components updated to use defined values
|
||||
- [ ] Cross-browser testing completed
|
||||
- [ ] Mobile responsiveness verified
|
||||
|
||||
## Assumptions & Limits
|
||||
|
||||
- Assumes modern browser support for z-index
|
||||
- Limited to 4 defined layers (expandable if needed)
|
||||
- Requires team discipline to maintain consistency
|
||||
|
||||
## References
|
||||
|
||||
- [MDN Z-Index Documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/z-index)
|
||||
- [CSS Stacking Context Guide](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context)
|
||||
@@ -4,7 +4,7 @@
|
||||
<!-- Messages in the upper-right - https://github.com/emmanuelsw/notiwind -->
|
||||
<NotificationGroup group="alert">
|
||||
<div
|
||||
class="fixed z-[90] top-[max(1rem,env(safe-area-inset-top))] right-4 left-4 sm:left-auto sm:w-full sm:max-w-sm flex flex-col items-start justify-end"
|
||||
class="fixed z-[120] top-[max(1rem,env(safe-area-inset-top))] right-4 left-4 sm:left-auto sm:w-full sm:max-w-sm flex flex-col items-start justify-end"
|
||||
>
|
||||
<Notification
|
||||
v-slot="{ notifications, close }"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
|
||||
.dialog-overlay {
|
||||
@apply z-50 fixed inset-0 bg-black/50 flex justify-center items-center p-6;
|
||||
@apply z-[100] fixed inset-0 bg-black/50 flex justify-center items-center p-6;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
|
||||
@@ -213,7 +213,6 @@ export default class FeedFilters extends Vue {
|
||||
|
||||
<style>
|
||||
#dialogFeedFilters.dialog-overlay {
|
||||
z-index: 100;
|
||||
overflow: scroll;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="isOpen"
|
||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
||||
>
|
||||
<div class="bg-white rounded-lg p-6 max-w-2xl w-full mx-4">
|
||||
<div v-if="isOpen" class="dialog-overlay">
|
||||
<div class="dialog">
|
||||
<!-- Header -->
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h2 class="text-xl font-bold capitalize">{{ roleName }} Details</h2>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="visible" class="dialog-overlay z-[60]">
|
||||
<div v-if="visible" class="dialog-overlay">
|
||||
<div class="dialog relative">
|
||||
<div class="text-lg text-center font-bold relative">
|
||||
<h1 id="ViewHeading" class="text-center font-bold">
|
||||
|
||||
@@ -10,7 +10,7 @@ Comprehensive error handling * * @author Matthew Raymer * @version 1.0.0 * @file
|
||||
PhotoDialog.vue */
|
||||
|
||||
<template>
|
||||
<div v-if="visible" class="dialog-overlay z-[60]">
|
||||
<div v-if="visible" class="dialog-overlay>
|
||||
<div class="dialog relative">
|
||||
<div class="text-lg text-center font-light relative z-50">
|
||||
<div id="ViewHeading" :class="headingClasses">
|
||||
|
||||
Reference in New Issue
Block a user