CSS Functions
What are CSS Functions?
CSS functions perform calculations and transformations. They make your CSS dynamic and responsive!
calc() Function
calc() performs mathematical calculations. Mix units like px,
%, rem, and more!
min() and max()
min() returns the smallest value, max()
returns the largest. Perfect for responsive sizing!
clamp() Function
clamp(min, preferred, max) creates responsive values
with minimum and maximum bounds. Game-changer for fluid typography!
Color Functions
rgb(), rgba(), hsl(),
hsla() create colors programmatically.
Transform Functions
Functions like rotate(), scale(),
translate() are used with the
transform property.
Practical Example: Responsive Card
Combine multiple functions for a fully responsive component.
clamp() for fluid typography
instead of media queries! It creates smooth,
responsive text that scales perfectly across all
screen sizes.
Summary
calc()- Mathematical calculationsmin()- Smallest value from listmax()- Largest value from listclamp(min, preferred, max)- Bounded responsive valuesrgb(),hsl()- Color functions- Transform functions: rotate(), scale(), translate()
Quick Quiz
Which function creates responsive values with min and max bounds?
Enjoying these tutorials?