Files
livewire-material/resources/css/layout/pane.css
T
Andreas Reinhold / reiniandClaude Sonnet 5 58ef33dc95 Select on [dir='rtl'] now that no build rewrites :dir()
Plan step 39 (part 4). With Tailwind gone the Workbench's Vite build
still turns every `:dir(rtl)` into a long `:lang()` list (its own CSS
minifier, not Tailwind's doing — confirmed by rebuilding and grepping
the output). Every RTL mirror rule across the eleven stylesheets that
had one now selects `:is([dir='rtl'], [dir='rtl'] *)` instead, matching
`:dir(rtl)`'s own specificity (one pseudo-class) and its inherited
"this element or a descendant of one carrying the attribute" reach; the
built CSS now keeps the selector as written (no `:lang(` or `:dir(` left).

RTL browser tests drop the `lang="ar"` workaround the old rewrite
needed (ContainmentTest's side-sheet probe, LayoutTest's shared
layoutPage() helper) and set only dir="rtl"; CarouselTest's probe
already did. Feature tests asserting the selector's literal text
(Progress, Overlay, Menu, ListDetail, Icon, Carousel) updated to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
2026-09-15 06:54:16 +02:00

76 lines
3.0 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* <x-pane>: a content region, with M3's margins and, optionally, a top app bar of its own.
*
* M3 puts all content in panes (docs/reference/m3/foundations.md § Layout → Scaffold, "all content
* must live in a pane") and lets each carry its own app bar. The margin is the space between the
* window's edge and what is inside: 16px below medium and 24px from it (600px), from the
* per-breakpoint table in docs/reference/m3/foundations-supplement.md § Breakpoints, as
* `--md-sys-measurement-space200` and `space300`.
*
* The margin sits on the pane's body and its section navigation, not on the pane: the app bar is a
* direct child of the pane, so it spans the pane from edge to edge and its `position: sticky` holds
* for the pane's whole height (a sticky element never leaves its parent). A margin is drawn once:
* a region that already keeps its content off the window's edge — a pane's body, the canonical
* layouts, the scaffold's content region — sets `--md-layout-margin` to 0px for what is inside it,
* and a pane there draws none of its own, until an <x-surface> gives it a new edge to keep off.
*
* `data-md-width` caps the pane and centres it: `narrow` 40rem, M3's 4060 characters a line
* (§ Layout → Breakpoints, "keep text to 4060 characters per line"), in rem because it is a measure
* of text; `medium` 60rem and `wide` 80rem are the package's steps above it; `full` (the default)
* fills the room it has, M3's flexible pane. The back button of `data-md-pane-back` points the
* way it goes, so it mirrors in a right-to-left document (§ Layout → Bidirectionality / RTL).
*
* In `material.layout`; `hide-below`/`hide-from` come from visibility.css. Imports app-bar.css and
* button.css for the pane's own top app bar and its back button (plan step 36 carry-over).
*/
@layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility;
@import './visibility.css';
@import '../components/app-bar.css';
@import '../components/button.css';
@layer material.layout {
[data-md-pane] {
display: flex;
flex-direction: column;
inline-size: 100%;
min-inline-size: 0;
margin-inline: auto;
}
[data-md-pane][data-md-width='narrow'] {
max-inline-size: 40rem;
}
[data-md-pane][data-md-width='medium'] {
max-inline-size: 60rem;
}
[data-md-pane][data-md-width='wide'] {
max-inline-size: 80rem;
}
[data-md-pane-navigation],
[data-md-pane-body] {
padding-inline: var(--md-layout-margin, var(--md-sys-measurement-space200));
@media (width >= 600px) {
padding-inline: var(--md-layout-margin, var(--md-sys-measurement-space300));
}
}
[data-md-pane-body] {
flex: 1 1 auto;
min-inline-size: 0;
}
[data-md-pane-body] > * {
--md-layout-margin: 0px;
}
[data-md-pane-back] [data-md-icon]:is([dir='rtl'], [dir='rtl'] *) {
transform: scaleX(-1);
}
}