Draw the plain tooltip without Tailwind
Plan step 36. <x-tooltip> renders data-md-tooltip and data-md-side on the bubble and data-md-tooltip-anchor on a standalone trigger's wrapper; tooltip.css draws PlainTooltipTokens' inverse-surface bubble, its anchor placement and flips per side, and the fade on the fast effects spring with @starting-style. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Opus 5
parent
6c7414d60e
commit
147dbcf041
@@ -9,8 +9,9 @@
|
||||
at once on a press or Escape; leaving or blurring lets it stand for M3's 1.5s. Only one
|
||||
tooltip is on screen at a time, as M3 asks. A phone has no hover, so a control there carries its
|
||||
words. The bubble is a `popover="manual"` in the top layer — never clipped by an
|
||||
`overflow-hidden` parent, never widening a scroll container — placed by CSS anchor
|
||||
`overflow: hidden` parent, never widening a scroll container — placed by CSS anchor
|
||||
positioning on `side` (`top`, `bottom`, `left`, `right`), flipping when there is no room.
|
||||
Drawn by resources/css/components/tooltip.css.
|
||||
|
||||
It is aria-hidden: an icon button takes the same words as its aria-label, and a labelled
|
||||
control would otherwise read them twice. --}}
|
||||
@@ -28,7 +29,7 @@
|
||||
@endphp
|
||||
|
||||
@if ($standalone)
|
||||
<span class="inline-flex" style="anchor-name: {{ $anchor }}">
|
||||
<span data-md-tooltip-anchor style="anchor-name: {{ $anchor }}">
|
||||
{{ $slot }}
|
||||
@endif
|
||||
|
||||
@@ -36,15 +37,9 @@
|
||||
popover="manual"
|
||||
aria-hidden="true"
|
||||
x-data="materialTooltip"
|
||||
data-md-tooltip
|
||||
data-md-side="{{ $side }}"
|
||||
style="position-anchor: {{ $anchor }}"
|
||||
@class([
|
||||
'pointer-events-none m-0 max-w-50 overflow-visible border-0 rounded-corner-xs bg-inverse-surface px-2 py-1 text-center whitespace-normal type-body-sm text-inverse-on-surface [inset:auto]',
|
||||
'opacity-0 transition-[opacity,display,overlay] transition-discrete duration-(--md-sys-motion-effects-fast-duration) ease-effects-fast open:opacity-100 starting:open:opacity-0',
|
||||
'my-1 [position-area:top] [position-try-fallbacks:flip-block]' => $side === 'top',
|
||||
'my-1 [position-area:bottom] [position-try-fallbacks:flip-block]' => $side === 'bottom',
|
||||
'mx-1 [position-area:left] [position-try-fallbacks:flip-inline]' => $side === 'left',
|
||||
'mx-1 [position-area:right] [position-try-fallbacks:flip-inline]' => $side === 'right',
|
||||
])
|
||||
>{{ $text }}</span>
|
||||
|
||||
@if ($standalone)
|
||||
|
||||
Reference in New Issue
Block a user