function

Progress() — CSS reference

Returns a clamped unitless progress ratio from the first calculation relative to the start and end calculations. Matching numeric types are required. It can be multiplied by a length in calc() to produce a size. Equal endpoints and reverse intervals need careful handling; this fixture uses a nonzero ascending interval.

Formal Syntax & Structure

css syntaxcss
opacity: progress(25px, 0px, 100px);

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>progress()</title><style>body{margin:16px;font:16px/1.5 system-ui;background:white;color:#172033} .demo{background:#dbeafe;box-sizing:border-box} button,select{font:inherit}#a{width:calc(progress(25px,0px,100px)*200px);opacity:progress(25px,0px,100px)}</style><body><div id="a" class="demo">Content</div></body></html>
CSS Reference