Results for “condition”
Small, practical examples. Search by task or narrow things down below.
Wait for shared state with a condition variable
C++: Use a predicate so spurious wakeups cannot allow the worker to continue before the state is ready.
C++✓ Tested
Adapt a component to its own container width
CSS: Container queries respond to a selected ancestor rather than the full viewport.
CSS✓ Tested
Adapt a layout to viewport orientation
CSS: The orientation query compares viewport dimensions rather than detecting a physical device type.
CSS✓ Tested
Add a clear boundary in forced-colors mode
CSS: Use a system color for a border when the user’s forced-color mode is active.
CSS✓ Tested
Apply an enhancement only when a feature is supported
CSS: A supports rule preserves the baseline outside browsers that understand the selected declaration.
CSS✓ Tested
Choose an action with switch
Map a small command value to a result.
switch✓ Tested
Choose between two render branches
Choose between two render branches with a small React component and explicit browser behavior.
React✓ Tested
Choose the smaller of a fixed and viewport-relative size
CSS: Min selects whichever supplied length is smaller at the current viewport.
CSS✓ Tested
Enhance a layout above a minimum viewport width
CSS: A mobile-first min-width query adds columns when enough horizontal space is available.
CSS✓ Tested
Hide interface controls in print layout
CSS: A print media query can retain article content while removing interactive controls.
CSS✓ Tested
Keep a viewport-relative size above a minimum
CSS: Max selects the larger of the candidate lengths.
CSS✓ Tested
Label rows with CASE
Derive a readable label from a condition.
CASE✓ Tested