Code Reference

Color & Background Properties

CSS · Methods reference

CSS · Methods reference


📋 Overview

Color, gradients, and background layering.

🔧 Methods

Color

Property / functionDescription
colorText color
opacityElement + descendants alpha
color-mix()Mix two colors in oklab/srgb
oklch() / hsl() / rgb()Modern color functions
currentColorInherit text color keyword

Background

PropertyDescription
background-colorFill behind content
background-imageurl() or gradient
background-size / position / repeatImage layout
background-attachmentscroll
background-clip / originBorder-box vs padding-box
backgroundShorthand
linear-gradient() / radial-gradient()Gradient 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