fix: use html classes instead of :global() for input modality styles

The :global() pseudo-class in Vue scoped SFC styles was being mangled
by the Vue compiler, producing broken CSS that applied properties like
z-index and opacity directly to the <html> element and dropped the
intended component selectors entirely.

Replace the html[data-mouse-active] / html[data-pointer-visible] data
attribute approach with plain CSS classes (mouse-active, pointer-visible)
toggled on document.documentElement. In Vue scoped styles, prefixing a
selector with html.mouse-active or html:not(.mouse-active) compiles
correctly — the html part stays global while the component selector
receives the scoped attribute — avoiding :global() entirely.

This keeps all component styles inside <style scoped> and fixes the
layout breakage caused by the original commit.
This commit is contained in:
2026-05-23 21:57:59 +00:00
parent 79dc1b25cc
commit 2f83193ff4
7 changed files with 48 additions and 49 deletions
+9 -9
View File
@@ -605,8 +605,8 @@ function handleItemClick(item: MediaItem, index: number) {
pointer-events: none;
}
:global(html[data-mouse-active="true"]) .collage-item:hover,
:global(html[data-mouse-active="false"]) .collage-item.nav-focused {
html.mouse-active .collage-item:hover,
html:not(.mouse-active) .collage-item.nav-focused {
z-index: 10;
}
@@ -630,8 +630,8 @@ function handleItemClick(item: MediaItem, index: number) {
}
/* Show outline on hover and focus */
:global(html[data-mouse-active="true"]) .collage-item:hover .hex-focus-outline,
:global(html[data-mouse-active="false"]) .collage-item.nav-focused .hex-focus-outline {
html.mouse-active .collage-item:hover .hex-focus-outline,
html:not(.mouse-active) .collage-item.nav-focused .hex-focus-outline {
opacity: 1;
}
@@ -646,15 +646,15 @@ function handleItemClick(item: MediaItem, index: number) {
}
/* Brighter outline for keyboard focus */
:global(html[data-mouse-active="false"]) .collage-item.nav-focused .hex-focus-outline polygon {
html:not(.mouse-active) .collage-item.nav-focused .hex-focus-outline polygon {
stroke: #ffffff;
stroke-width: 5;
filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}
/* Blinking effect on hover/focus */
:global(html[data-mouse-active="true"]) .collage-item:hover .hex-focus-outline,
:global(html[data-mouse-active="false"]) .collage-item.nav-focused .hex-focus-outline {
html.mouse-active .collage-item:hover .hex-focus-outline,
html:not(.mouse-active) .collage-item.nav-focused .hex-focus-outline {
animation: hex-outline-blink 1s ease-in-out infinite;
}
@@ -1035,8 +1035,8 @@ function handleItemClick(item: MediaItem, index: number) {
white-space: nowrap;
}
:global(html[data-mouse-active="true"]) .collage-item:not(.collage-featured):hover .collage-item-hover,
:global(html[data-mouse-active="false"]) .collage-item:not(.collage-featured).nav-focused .collage-item-hover {
html.mouse-active .collage-item:not(.collage-featured):hover .collage-item-hover,
html:not(.mouse-active) .collage-item:not(.collage-featured).nav-focused .collage-item-hover {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
+3 -3
View File
@@ -211,13 +211,13 @@ const matchedPeople = computed(() => {
object-fit: cover;
}
:global(html[data-mouse-active="true"]) .media-card:hover .card-focus-outline,
:global(html[data-mouse-active="false"]) .media-card.nav-focused .card-focus-outline {
html.mouse-active .media-card:hover .card-focus-outline,
html:not(.mouse-active) .media-card.nav-focused .card-focus-outline {
opacity: 1;
animation: card-outline-blink 1s ease-in-out infinite;
}
:global(html[data-mouse-active="false"]) .media-card.nav-focused .card-focus-outline rect {
html:not(.mouse-active) .media-card.nav-focused .card-focus-outline rect {
stroke: #ffffff;
stroke-width: 5;
filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
+6 -6
View File
@@ -813,12 +813,12 @@ function handleCastSelect(castName: string) {
}
.cast-card:focus-visible,
:global(html[data-mouse-active="false"]) .cast-card.nav-focused {
html:not(.mouse-active) .cast-card.nav-focused {
outline: none;
}
.cast-card:focus-visible::after,
:global(html[data-mouse-active="false"]) .cast-card.nav-focused::after {
html:not(.mouse-active) .cast-card.nav-focused::after {
border-width: 2px;
}
@@ -943,7 +943,7 @@ function handleCastSelect(castName: string) {
cursor: pointer;
}
:global(html[data-mouse-active="true"]) .showreel-image:hover {
html.mouse-active .showreel-image:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
@@ -978,7 +978,7 @@ function handleCastSelect(castName: string) {
transition: background 0.2s, border-color 0.2s;
}
:global(html[data-mouse-active="true"]) .version-item:hover {
html.mouse-active .version-item:hover {
background: rgba(255, 255, 255, 0.08);
}
@@ -1176,7 +1176,7 @@ function handleCastSelect(castName: string) {
overflow: hidden;
}
:global(html[data-mouse-active="true"]) .episode-item:hover {
html.mouse-active .episode-item:hover {
background: rgba(255, 255, 255, 0.08);
}
@@ -1291,7 +1291,7 @@ function handleCastSelect(castName: string) {
border: 1px solid transparent;
}
:global(html[data-mouse-active="true"]) .release-item:hover {
html.mouse-active .release-item:hover {
background: rgba(255, 255, 255, 0.06);
}
@@ -312,7 +312,7 @@ function handleActivate(event: MouseEvent | KeyboardEvent) {
grid-template-columns: minmax(0, 1fr) max-content max-content;
}
:global(html[data-mouse-active="true"]) .version-row:hover {
html.mouse-active .version-row:hover {
background: rgba(10, 14, 22, 0.28);
border-color: rgba(255, 255, 255, 0.2);
}
@@ -322,7 +322,7 @@ function handleActivate(event: MouseEvent | KeyboardEvent) {
background: rgba(10, 14, 22, 0.2);
}
:global(html[data-mouse-active="true"]) .version-row.version-best:hover {
html.mouse-active .version-row.version-best:hover {
background: rgba(10, 14, 22, 0.28);
border-color: rgba(255, 255, 255, 0.2);
}
@@ -533,8 +533,8 @@ function handleActivate(event: MouseEvent | KeyboardEvent) {
cursor: pointer;
}
:global(html[data-mouse-active="true"]) .ctx-btn:hover:not(:disabled),
:global(html[data-mouse-active="false"]) .ctx-btn.nav-focused:not(:disabled),
html.mouse-active .ctx-btn:hover:not(:disabled),
html:not(.mouse-active) .ctx-btn.nav-focused:not(:disabled),
.ctx-btn:focus-visible:not(:disabled) {
background: rgba(255, 255, 255, 0.16);
border-color: rgba(255, 255, 255, 0.35);
+8 -8
View File
@@ -806,8 +806,8 @@ onUnmounted(() => {
outline: none;
}
:global(html[data-mouse-active="true"]) .episode-tile:hover,
:global(html[data-mouse-active="false"]) .episode-tile.nav-focused {
html.mouse-active .episode-tile:hover,
html:not(.mouse-active) .episode-tile.nav-focused {
z-index: 20;
transition: z-index 0s;
}
@@ -850,14 +850,14 @@ onUnmounted(() => {
}
/* Show outline on hover and focus */
:global(html[data-mouse-active="true"]) .episode-tile:hover .tile-focus-outline,
:global(html[data-mouse-active="false"]) .episode-tile.nav-focused .tile-focus-outline {
html.mouse-active .episode-tile:hover .tile-focus-outline,
html:not(.mouse-active) .episode-tile.nav-focused .tile-focus-outline {
opacity: 1;
animation: tile-outline-blink 1s ease-in-out infinite;
}
/* Brighter outline for keyboard focus */
:global(html[data-mouse-active="false"]) .episode-tile.nav-focused .tile-focus-outline rect {
html:not(.mouse-active) .episode-tile.nav-focused .tile-focus-outline rect {
stroke: #ffffff;
stroke-width: 5;
filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
@@ -884,7 +884,7 @@ onUnmounted(() => {
display: none;
}
:global(html[data-mouse-active="true"]) .episode-tile:hover .tile-overlay {
html.mouse-active .episode-tile:hover .tile-overlay {
opacity: 0.4;
}
@@ -945,7 +945,7 @@ onUnmounted(() => {
text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}
:global(html[data-mouse-active="true"]) .episode-tile:hover .tile-play {
html.mouse-active .episode-tile:hover .tile-play {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
@@ -1081,7 +1081,7 @@ onUnmounted(() => {
cursor: pointer;
}
:global(html[data-mouse-active="true"]) .version-action-item:hover:not(:disabled),
html.mouse-active .version-action-item:hover:not(:disabled),
.version-action-item:focus-visible:not(:disabled) {
background: rgba(255, 255, 255, 0.12);
outline: none;