Skip to content

function-name-case

Reports a function name with capitals (RGB()). Names such as translateX that are written in camel case in the specification keep theirs.

CSS reads function names without regard to case, so capitals add spellings of the same name. A file that writes them in lowercase only is easier to search and read.

Reported
...
width: calc(-1px + 2px);
...
width: CALC(1px + 2px);
...
background: linear-gradient(to top, red, blue);
background: linear-gradient(45deg, red, blue);
background: -webkit-linear-gradient(top, red, blue);
transform: translateX(1px) ROTATE(1deg);
}
css:
lint:
rules:
function-name-case: warn # off (default), warn, error
less:
lint:
rules:
function-name-case: warn # off (default), warn, error
scss:
lint:
rules:
function-name-case: warn # off (default), warn, error

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line function-name-case in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint function-name-case full