FIND YOUR NEXT FEW LINES

Results for “condition”

Small, practical examples. Search by task or narrow things down below.

102 snippets foundClear filters
C++Tasks & synchronization

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
CSSResponsive conditions & sizing

Adapt a component to its own container width

CSS: Container queries respond to a selected ancestor rather than the full viewport.

CSS✓ Tested
CSSResponsive conditions & sizing

Adapt a layout to viewport orientation

CSS: The orientation query compares viewport dimensions rather than detecting a physical device type.

CSS✓ Tested
CSSResponsive conditions & sizing

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
CSSResponsive conditions & sizing

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
PowerShellFunctions & control

Choose an action with switch

Map a small command value to a result.

switch✓ Tested
ReactGetting Started

Choose between two render branches

Choose between two render branches with a small React component and explicit browser behavior.

React✓ Tested
CSSResponsive conditions & sizing

Choose the smaller of a fixed and viewport-relative size

CSS: Min selects whichever supplied length is smaller at the current viewport.

CSS✓ Tested
CSSResponsive conditions & sizing

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
CSSResponsive conditions & sizing

Hide interface controls in print layout

CSS: A print media query can retain article content while removing interactive controls.

CSS✓ Tested
CSSResponsive conditions & sizing

Keep a viewport-relative size above a minimum

CSS: Max selects the larger of the candidate lengths.

CSS✓ Tested
SQLExpressions & aggregates

Label rows with CASE

Derive a readable label from a condition.

CASE✓ Tested