Favorites

CSS <dashed-function> Data Type

<dashed-function>
CSS Data TypeThis data type is supported in some modern browsers, but not all.
Updated 21st November 2026

The <dashed-function> data type is the name of a custom function followed by an opening parenthesis, such as --fluid-size(, used with @function.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The <dashed-function> CSS data type represents the name of a custom function followed by an opening parenthesis, for example --fluid-size(. It is the token used both to define a function with the @function at-rule and to call it in a property value. Like a <dashed-ident>, the name must start with two dashes, which guarantees it can never clash with a built-in CSS function.

A call to a custom function looks just like a call to a built-in one: padding: --spacing(2);. The arguments are separated by commas and can be any valid CSS values, including custom properties and other function calls. The browser replaces the call with the value the function returns, using the element's own context, so the same function can produce different results on different elements.

Names are case-sensitive, so --Size() and --size() are different functions. If a dashed function is called but no matching @function rule exists, or the browser does not support custom functions, the declaration becomes invalid at computed-value time, so include a plain fallback declaration first.

Examples:

@function --negate(--value) {
  result: calc(-1 * var(--value));
}

@function --spacing(--step <number>: 1) {
  result: calc(var(--step) * 0.5rem);
}

.card {
  padding: 1.5rem;                 /* fallback */
  padding: --spacing(3);           /* dashed function call */
  margin-top: --negate(1rem);
}

Syntax

<dashed-function> = --<ident>(

Values

  • <dashed-function>A function name that starts with two dashes, followed immediately by an opening parenthesis, for example --brand-color(. The name is case-sensitive and must match a function defined with @function.

Example

<div class="wrap">
<h1>CSS &lt;dashed-function&gt; examples</h1>
<div class="card">
<div class="row"><span class="chip s1">Step 1</span><code>padding: --spacing(1)</code></div>
<div class="row"><span class="chip s2">Step 2</span><code>padding: --spacing(2)</code></div>
<div class="row"><span class="chip s3">Step 3</span><code>padding: --spacing(3)</code></div>
<div class="row"><span class="chip s4">Step 4</span><code>padding: --spacing(4)</code></div>
</div>
<p class="note">In browsers without @function support, every chip uses the 8px fallback padding.</p>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
@function --spacing(--step : 1) {
  result: calc(var(--step) * 8px);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.chip {
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  padding: 8px;                 /* fallback */
}

.s1 { padding: --spacing(1); }
.s2 { padding: --spacing(2); }
.s3 { padding: --spacing(3); }
.s4 { padding: --spacing(4); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS dashed-function data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.

This data type is supported in some modern browsers, but not all.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.