<type>
Limited availability73% of usersExperimental
A generic keyword used in newer CSS specs (like Mixins and Functions) to denote a specific data type requirement for a variable or argument.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in Firefox or Safari yet, so not every major browser supports it.
The old way and the modern waySee the snippet: Reusable CSS logic without Sass mixins →
Old way 9 lines
// Sass / SCSS
@use "sass:math";
@function fluid($min, $max) {
@return clamp( /* [!code --] */
$min,
calc(#{$min} + #{math.div($max - $min, 1rem)} * ((100vw - 20rem) / 60)),
$max
);
}Modern 10 lines
@function --fluid( /* */
--min <length>, /* */
--max <length> /* */
) returns <length> {
result: clamp( /* [!code ++] */
var(--min), /* [!code ++] */
50vi, /* [!code ++] */
var(--max) /* [!code ++] */
);
}See how modern your own CSS is.Check your CSS →
Quick example
/* (Hypothetical usage in custom functions) */
@function --my-color(--clr <color>) {
/* Requires an argument that matches the <color> type */
}<type> browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage73%of people can use this27% use a browser without it.
Browsers
139+
139+Mobile
139+Android