You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Changed
BREAKING (behaviour): tracking-* is now em, as in Tailwind, so letter spacing scales with the font size. It ships in 1.9.0, a minor release, as the behavioural break in 1.4.0 did, so a ^1.8 constraint picks it up on the next pub get. Every app that uses a tracking-* class renders differently, and a custom WindThemeData.tracking map is now read as em multipliers: a value written as pixels ('tight': -1) now means -1em, so convert it (-1px on 14px text is about -0.07). The defaults were -2/-1/0/1/2/4 logical pixels under comments that said -0.05em through 0.1em, and Flutter's TextStyle.letterSpacing is pixels, so tracking-tight was a flat -1px: -0.07em on 14px text, nearly three times Tailwind's -0.025em, and a 14px semibold title rendered with its letters colliding. The theme map now holds Tailwind's values (-0.05, -0.025, 0, 0.025, 0.05, 0.1). WindStyle.letterSpacing carries a new letterSpacingUnit (WindLetterSpacingUnit.em or .px) and toTextStyle({inheritedFontSize}) converts to pixels against the size the text renders at: the text-* size in the same className (responsive and state variants included), else the inherited DefaultTextStyle size, else kDefaultFontSize (14), the size unsized text paints at (the theme's base is not used, because no text paints at it unless a DefaultTextStyle sets it). The conversion happens at build in WText, WDiv, WButton and WInput, because the parser cannot know the inherited size and its cache key does not carry it; resolving to a fixed 16 in the parser was rejected for exactly that reason. WText resolves against a textStyle: font size when one is given. WDiv and WButton publish the resolved pixels to their children, which is how CSS inherits a computed letter-spacing. WInput with no text-* resolves against kDefaultFontSize (14), since EditableText reads no DefaultTextStyle. The new wInheritedFontSize(context) helper exposes the same fallback chain for custom widgets. The em is taken from the unscaled size: Flutter scales fontSize by the accessibility TextScaler and leaves letterSpacing as written. (lib/src/theme/defaults/tracking.dart, lib/src/theme/wind_theme_data.dart, lib/src/parser/wind_style.dart, lib/src/parser/parsers/text_parser.dart, lib/src/utils/wind_helpers.dart, lib/src/widgets/w_text.dart, lib/src/widgets/w_div.dart, lib/src/widgets/w_button.dart, lib/src/widgets/w_input.dart)
Fixed
WButton paints its opacity-*, so a disabled:opacity-50 button looks disabled. It built its box without the parsed opacity, so disabled:, loading: and hover: opacity classes parsed and painted nothing, and a disabled button looked enabled. It now wraps the box in an Opacity, or an AnimatedOpacity under a duration-*, as WDiv does. (lib/src/widgets/w_button.dart)
A ring-* is an outline, so a focused element with no background is no longer a solid block. Wind drew the ring as a spread BoxShadow. A browser clips a box-shadow to the outside of its element, so Tailwind's ring reads as an outline; Flutter does not clip it, and an element with no background filled with the ring colour. A host app's rail drew every keyboard-focused icon button as a solid blue block with the glyph lost inside it. WDiv now paints WindStyle.ringOutline, a stroke over the box on its own corner radius: outside the edge, inside it for ring-inset (which never showed over a background before), and moved out by ring-offset-* with the gap left unpainted (the offset used to be covered by the ring itself). The ring no longer joins the box shadows. A focused WInput paints the same outline instead of its ring shadow (it still promotes the ring to its border), so a transparent field no longer fills with the ring colour. The docs' ring-offset-white example is gone: Wind has no ring-offset colour and the class did nothing. (lib/src/parser/wind_style.dart, lib/src/widgets/w_div.dart, lib/src/widgets/w_input.dart, test/pixel/ring_outline_pixel_test.dart, test/widgets/w_input_test.dart, test/pixel/radius_ring_border_pixel_test.dart, doc/borders/ring.md)
WButton paints its ring-* and shadow-*. It built its box from the parsed decoration alone, so both parsed and painted nothing: a host app's dialog buttons showed no focus while Tab moved between them. It now folds boxShadow into the decoration and paints ringOutline over the box. (lib/src/widgets/w_button.dart, test/widgets/w_button_test.dart)
A WPopover opens from the keyboard and shows where focus is. Its trigger took focus on Tab and then answered nothing: Enter and Space did not open it, Escape did not close it, and no focus: class on the trigger could light, so a host app's notification bell was a Tab stop a keyboard user could neither see nor use. The trigger now answers ActivateIntent (Enter, Space, the Android TV D-pad centre), as WAnchor does, only where a tap would toggle; Escape closes an open popover from the trigger or from inside the panel, returns focus to the trigger and consumes the key, so a popover in a dialog closes alone; and the popover publishes its trigger's hover, focus and disabled state through WindAnchorStateProvider, so a plain WDiv trigger answers focus: and its own styling wrapper stops being a second Tab stop. Escape is a key handler on the focus tree, above the portal. In a host app's web walk it first went deaf: the browser drops the trigger's focus as the panel mounts, so after a keyboard open Escape reached nothing and the next Tab started over from the top of the page. The first focus change after a keyboard open, when it lands on a scope rather than a control, now hands focus back to the trigger, once. A HardwareKeyboard handler was rejected for Escape: returning true from one does not stop the key reaching the focus tree, so a popover open in a dialog closed together with the dialog. The trigger and the panel are one FocusTraversalGroup in widget order, so Tab goes from the trigger into the panel: reading order had ranked a control beside the trigger before the panel below it, and a panel flipped above its trigger before the trigger itself, so the walk measured a phone shell that never reached the panel and a rail bell whose panel was reachable only with Shift+Tab. A DismissIntent action was rejected because ShortcutManager asks only the nearest action for an intent, so a disabled one would have swallowed Escape on a closed popover and a dialog holding it would have stopped closing. A disabled popover is no longer a Tab stop. (lib/src/widgets/w_popover.dart, test/widgets/w_popover/keyboard_test.dart, doc/widgets/w-popover.md, skills/wind-ui/SKILL.md)
Arbitrary tracking-[...] honours its unit and its sign.tracking-[0.1em] stripped the unit and set 0.1 logical pixels, and a negative value such as tracking-[-0.02em] did not match the pattern at all, so it was dropped. An em value is now em, a px value or a bare number is logical pixels (as in leading-[24] and text-[20]), and both take a negative sign. (lib/src/parser/parsers/text_parser.dart, test/parser/parsers/text_parser_test.dart, doc/typography/letter-spacing.md)