CSS specifications define a fixed set of functions, such as linear-gradient(), translate(), or calc().
Browsers do not recognize any other function name, so a declaration that calls an unknown function is invalid and the browser discards the whole
declaration. The intended style never applies, and the element keeps the value from an earlier declaration, or its inherited or initial value.
An unknown function is usually a typo, a misremembered name, or a function from a preprocessor or build tool that was left in a plain CSS file. This rule raises an issue on the name of each function that no CSS specification defines. Replace it with the intended CSS function.
This rule applies only to plain CSS, including <style> blocks in HTML files and Vue single-file components. It does not raise
issues in SCSS, Sass, or Less files, or in <style> blocks written in those languages.
.banner {
background: linaer-gradient(to right, white, gray); /* Noncompliant: misspelled function */
transform: translateX(10px) rotation(45deg); /* Noncompliant: "rotation" is not a CSS function */
}
.banner {
background: linear-gradient(to right, white, gray);
transform: translateX(10px) rotate(45deg);
}
A preprocessor function has no meaning in a plain CSS file. Write the resulting value instead:
.button:hover {
background-color: darken(#3366ff, 10%); /* Noncompliant: Sass function in a CSS file */
}
.button:hover {
background-color: #0040ff;
}
This rule does not raise an issue for:
--fluid()ignoreFunctions parameter, which by default contains the Tailwind theme() function--shadow: elevation(2), which can hold arbitrary tokens until they are usedstyle() and supports() tests in if(), which can check for features that the browser
does not supportfilter values such as alpha(opacity=50) and
progid:DXImageTransform.Microsoft.gradient()constant(), the iOS 11.0 predecessor of env(), which is still written as a fallback before itv-bind() in Vue single-file components, which binds component state to style values@font-face, which {rule:css:S8775} checksNone of the following declarations raise an issue:
.card {
padding: --fluid(1rem, 2rem);
color: theme('colors.gray.400');
--shadow: elevation(2);
filter: alpha(opacity=50);
padding-top: constant(safe-area-inset-top);
padding-top: env(safe-area-inset-top);
}