feat: add element hover label and refactor to use CSS classes
Add visual feedback for hovered elements: - Display element selector label (e.g., "p", "h1.title") on hover - Label positioned at top-left of element with 30% opacity Refactor all hover/selection styles to use CSS classes instead of inline styles: - .page-hovered, .page-selected for page states - .element-hovered, .element-selected for element states - .element-hover-label for the floating label This improves maintainability and separation of concerns by moving styling logic to CSS files instead of JavaScript. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c523b4e335
commit
f9e9e65712
2 changed files with 89 additions and 11 deletions
|
|
@ -144,6 +144,38 @@
|
|||
/*--------------------------------------------------------------------------------------*/
|
||||
}
|
||||
|
||||
/* Hover and selection states for pages and elements */
|
||||
.page-hovered {
|
||||
outline: 2px solid #ff8a5050 !important;
|
||||
}
|
||||
|
||||
.page-selected {
|
||||
outline: 2px solid #ff8a50 !important;
|
||||
}
|
||||
|
||||
.element-hovered {
|
||||
outline: 2px solid #7136ff50 !important;
|
||||
}
|
||||
|
||||
.element-selected {
|
||||
outline: 2px dashed #7136ff !important;
|
||||
background-color: #7136ff1a !important;
|
||||
}
|
||||
|
||||
.element-hover-label {
|
||||
position: absolute;
|
||||
background: #7136ff;
|
||||
color: white;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
opacity: 0.3;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
/* Marks (to delete when merge in paged.js) */
|
||||
|
||||
.pagedjs_marks-crop {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue