<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx" -->

---
title: Comparing Values With CSS progress() – Master.dev Blog
description: The new CSS progress() function maps a value against a lower and upper bound, returning a clamped number between 0 and 1 (or unclamped with the no-clamp...
canonical: https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Comparing Values With CSS progress() – Master.dev Blog | daily.dev
og:description: The new CSS progress() function maps a value against a lower and upper bound, returning a clamped number between 0 and 1 (or unclamped with the no-clamp...
og:url: https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx
og:image: https://api.daily.dev/og/posts/gcbixLDQX.png
og:image:alt: Comparing Values With CSS progress() – Master.dev Blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Comparing Values With CSS progress() – Master.dev Blog

**[Frontend Masters](https://daily.dev/sources/frontendmasters)** · 6 min read · 0 upvotes · 0 comments

## Summary

The new CSS progress() function maps a value against a lower and upper bound, returning a clamped number between 0 and 1 (or unclamped with the no-clamp keyword, currently Firefox-only). Beyond scaling use cases like fluid typography and responsive layouts, it can express boolean-like logic: a worked example shows using progress() with registered custom properties and container style queries to conditionally show badges once a movie count reaches certain thresholds, without JavaScript comparisons or loops.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.master.dev/comparing-values-with-css-progress>

## Questions this post answers

### What does the CSS progress() function do and how is it calculated?

The CSS progress() function maps a current value against a range defined by a lower and upper bound, returning a proportional number between 0 and 1 using the formula (current value - lower bound) / (upper bound - lower bound). Values at or below the lower bound clamp to 0, and values at or above the upper bound clamp to 1, unless overridden with the no-clamp keyword.

_Developers exploring modern CSS functions like progress() can track browser support changes on daily.dev._

### How can I use CSS progress() to conditionally show or hide elements without JavaScript comparisons?

Set a registered custom property (via @property) to the result of progress(currentValue, 0, threshold), which returns exactly 1 once the current value reaches or exceeds the threshold. Then use a container style query like @container style(--flag: 1) to apply styles such as visibility: visible, letting CSS alone express boolean-like unlock logic across multiple threshold levels.

_Anyone building threshold-based UI logic in CSS can find patterns like this useful when weighing CSS versus JavaScript approaches, a comparison daily.dev surfaces often._

### Does the no-clamp keyword in CSS progress() work in all browsers?

No, the no-clamp keyword, which overrides the default clamping so progress() can return values outside the 0 to 1 range (for example progress(no-clamp 10, 20, 60) returns -0.25 instead of 0), is supported in Firefox at the time of writing, not universally across browsers.

_Developers relying on newer CSS functions like progress() can watch cross-browser support shifts through daily.dev._

## Similar posts on daily.dev

- [Fallbacks for CSS \`progress\(\)\` – Master.dev Blog](https://daily.dev/posts/fallbacks-for-css-progress-master-dev-blog-uogyas7vh) · Frontend Masters · 4 upvotes · 0 comments
- [Fluid Typography with progress\(\) – Master.dev Blog](https://daily.dev/posts/fluid-typography-with-progress-master-dev-blog-qhlmfwxbe) · Frontend Masters · 10 upvotes · 1 comments

---

Tags: [#css](https://daily.dev/tags/css), [#ui-design](https://daily.dev/tags/ui-design)

[View this post on daily.dev](https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Comparing Values With CSS progress() – Master.dev Blog","url":"https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx"},"datePublished":"2026-09-14T17:34:28.433Z","dateModified":"2026-09-14T17:58:05.894Z","description":"The new CSS progress() function maps a value against a lower and upper bound, returning a clamped number between 0 and 1 (or unclamped with the no-clamp...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1ba63efaa932185b328852ff045f070d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1ba63efaa932185b328852ff045f070d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Frontend Masters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Frontend Masters","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/d34dd87208f24090bfb0917307fcf89f","url":"https://daily.dev/sources/frontendmasters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css,ui-design","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Frontend Masters","item":"https://daily.dev/sources/frontendmasters"},{"@type":"ListItem","position":3,"name":"Comparing Values With CSS progress() – Master.dev Blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/comparing-values-with-css-progress-master-dev-blog-gcbixldqx#faq","mainEntity":[{"@type":"Question","name":"What does the CSS progress() function do and how is it calculated?","acceptedAnswer":{"@type":"Answer","text":"The CSS progress() function maps a current value against a range defined by a lower and upper bound, returning a proportional number between 0 and 1 using the formula (current value - lower bound) / (upper bound - lower bound). Values at or below the lower bound clamp to 0, and values at or above the upper bound clamp to 1, unless overridden with the no-clamp keyword. Developers exploring modern CSS functions like progress() can track browser support changes on daily.dev."}},{"@type":"Question","name":"How can I use CSS progress() to conditionally show or hide elements without JavaScript comparisons?","acceptedAnswer":{"@type":"Answer","text":"Set a registered custom property (via @property) to the result of progress(currentValue, 0, threshold), which returns exactly 1 once the current value reaches or exceeds the threshold. Then use a container style query like @container style(--flag: 1) to apply styles such as visibility: visible, letting CSS alone express boolean-like unlock logic across multiple threshold levels. Anyone building threshold-based UI logic in CSS can find patterns like this useful when weighing CSS versus JavaScript approaches, a comparison daily.dev surfaces often."}},{"@type":"Question","name":"Does the no-clamp keyword in CSS progress() work in all browsers?","acceptedAnswer":{"@type":"Answer","text":"No, the no-clamp keyword, which overrides the default clamping so progress() can return values outside the 0 to 1 range (for example progress(no-clamp 10, 20, 60) returns -0.25 instead of 0), is supported in Firefox at the time of writing, not universally across browsers. Developers relying on newer CSS functions like progress() can watch cross-browser support shifts through daily.dev."}}]}
```

