---
title: "5 Useful CSS functions using the new @function rule"
url: https://daily.dev/posts/5-useful-css-functions-using-the-new-function-rule-ijvkvcagn
source_url: https://una.im/5-css-functions/
type: article
source: "Una Kravets"
published: 2025-08-13T18:41:19.951Z
updated: 2025-08-13T18:41:41.131Z
tags: ["webdev", "css", "ui-design", "google-chrome"]
reading_time: 8
upvotes: 20
comments: 3
language: 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.

# 5 Useful CSS functions using the new @function rule

**[Una Kravets](https://daily.dev/sources/una)** · 8 min read · 20 upvotes · 3 comments

## Summary

CSS custom functions using the new @function rule have landed in Chrome 139, enabling developers to write reusable logic that accepts arguments and returns computed values. The article demonstrates five practical examples: a negation function for inverting values, an opacity function for creating transparent color variants, a fluid typography function that scales text responsively, a conditional border radius function that removes rounded corners near viewport edges, and a layout sidebar function for responsive grid layouts. These functions make CSS more organized and dynamic, similar to utility functions in JavaScript, and represent a significant step toward more powerful CSS capabilities with upcoming @mixin and @apply rules.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://una.im/5-css-functions/>

## Community discussion

Top comments from developers on daily.dev.

**@noricode** · 0 upvotes

> only good use for these is to lighten or darken a color

**@stephenf** · 0 upvotes

> This is very cool, nested media queries within a function could potentially change how we write responsive CSS

**@yaireo** · 0 upvotes

> https://yaireo.github.io/css-utility-functions

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/5-useful-css-functions-using-the-new-function-rule-ijvkvcagn)
