dvh/svh/lvh Viewport Variants Lookup

Explicit independently observed small/large/dynamic viewport sizes, units are percentages of corresponding heights; no inferred browser chrome or vh alias. Explicit supplied computed/layout context only; not a browser cascade/layout engine or cross-browser guarantee.

Description

Small, large and dynamic viewport heights describe different viewport-size bases.

Small, large and dynamic viewport heights describe different viewport-size bases.1

Percentage units resolve against the selected basis rather than one permanent screen height. Use dvh/svh/lvh Viewport Variants Lookup to evaluate the supplied inputs under the specific model below.

When to use dvh/svh/lvh Viewport Variants Lookup

Use dvh/svh/lvh Viewport Variants Lookup to evaluate the supplied inputs under the specific model below. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.

How to use dvh/svh/lvh Viewport Variants Lookup and understand its results

  1. Define the supplied layout, token or rendering scenario and establish the relevant units and browser context independently.
  2. Enter Small viewport height px, Large viewport height px, Dynamic viewport height px, Observed percent using the field table and validation rules below, then run the tool.
  3. Read Svh length px, Lvh length px, Dvh length px and interpret units, signs, ordering and placeholders as explained below.
  4. If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
Input fieldMeaningValue typeRequirement
smallViewportHeightPxSmall viewport height pxnumberRequired; constraints below
largeViewportHeightPxLarge viewport height pxnumberRequired; constraints below
dynamicViewportHeightPxDynamic viewport height pxnumberRequired; constraints below
observedPercentObserved percentnumberRequired; constraints below

Enter nonnegative small, dynamic and large viewport heights in px ordered small≤dynamic≤large, plus a nonnegative percentage. Return each height times percentage/100. Percentages above 100 are accepted; the calculation does not observe browser chrome or enforce live viewport updates.

svhPx = small×percent/100; dvhPx = dynamic×percent/100; lvhPx = large×percent/100

Field order, units and branch conditions follow the implementation explanation above.

Output fieldMeaningValue type
svhLengthPxSvh length pxnumber
lvhLengthPxLvh length pxnumber
dvhLengthPxDvh length pxnumber
json
{
  "input": {
    "smallViewportHeightPx": 600,
    "largeViewportHeightPx": 800,
    "dynamicViewportHeightPx": 700,
    "observedPercent": 50
  },
  "output": {
    "svhLengthPx": 300,
    "lvhLengthPx": 400,
    "dvhLengthPx": 350
  }
}

Limitations and assumptions

Percentage units resolve against the selected basis rather than one permanent screen height. Apply the exact scope and assumptions described above.

All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.

Alternative or Complementary methods

Use content-visibility:auto Render Skip Note for a related task: Content visibility can allow a browser to skip eligible rendering work.

Use Container Query Units cqi/cqw Reference for a related task: Container width and inline size can differ under vertical writing.

References

  1. dvh/svh/lvh Viewport Variants Lookup — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies