Code Reference

CSS Functions

CSS · Methods reference

CSS · Methods reference


📋 Overview

Common CSS functions used in property values.

🔧 Methods

Math & sizing

FunctionDescription
calc()Arithmetic with mixed units
min() / max() / clamp()Responsive bounds
minmax()Grid track min/max
repeat()Grid track repetition
fit-content()min(max-content, limit)

Other

FunctionDescription
var(--name, fallback?)Custom property reference
url() / image-set()Image sources
attr()Use HTML attribute value in CSS
counter() / counters()Generated content counters
env() / constant()Safe area insets (mobile)
blur() / brightness() / …Filter functions
translate() / rotate() / scale()Transform functions

💡 Examples

See parent topic notes for runnable snippets; this page is the complete method index.

⚠️ Pitfalls

  • Mutating methods return None in Python — do not chain sort() / reverse() expecting a new list.
  • Default JS sort() compares strings — pass (a,b) => a-b for numbers.
  • SQL function names differ by dialect — verify Postgres vs MySQL docs.
  • Django QuerySet.update() skips save() signals and auto auto_now fields on models.

On this page