Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
math

12 Articles
Direct link to the article The “Most Hated” CSS Feature: tan()
CSS functions math

The “Most Hated” CSS Feature: tan()

Last time, we discussed that, sadly, according to the State of CSS 2025 survey, trigonometric functions are deemed the “Most Hated” CSS feature.…

Juan Diego Rodríguez on Nov 3, 2025
Direct link to the article tan()
math

tan()

The CSS tan() function takes a calculation that resolves to either an <angle> or <tnumber> and returns the result's tangent, which ranges between -Infinity and Infinity.
Juan Diego Rodríguez on Nov 7, 2025
Direct link to the article calc()
math

calc()

The CSS calc() function performs math between values, whether that's addition, subtraction, division, or multiplication, along with any other math function.
Gabriel Shoyombo on Sep 25, 2025
Direct link to the article CSS Typed Arithmetic
animation CSS functions math

CSS Typed Arithmetic

Starting in Chrome 140, we'll be able to calculate numeric values with mixed data types. Sounds small, but Amit demonstrates how big a deal this is, calling it Computational CSS.
Amit Sheen on Sep 30, 2025
Direct link to the article The “Most Hated” CSS Feature: cos() and sin()
animations math

The “Most Hated” CSS Feature: cos() and sin()

I want to look at practical uses for CSS trigonometric functions. And we'll start with what may be the most popular functions of the "worst" feature: sin() and cos().
Juan Diego Rodríguez on Nov 3, 2025
Direct link to the article Creating a Clock with the New CSS sin() and cos() Trigonometry Functions
cos() math sin()

Creating a Clock with the New CSS sin() and cos() Trigonometry Functions

CSS trigonometry functions are here! Well, they are if you’re using the latest versions of Firefox and Safari, that is. Having this sort of mathematical power in CSS opens up a whole bunch of possibilities. In this tutorial, I thought …

Mads Stoumann on May 17, 2024
Direct link to the article Using Absolute Value, Sign, Rounding and Modulo in CSS Today
css variables custom properties functions houdini math

Using Absolute Value, Sign, Rounding and Modulo in CSS Today

For quite a while now, the CSS spec has included a lot of really useful mathematical functions, such as trigonometric functions (sin(), cos(), tan(), asin(), acos(), atan(), atan2()), exponential functions (…

Ana Tudor on Jul 28, 2021
Direct link to the article Lots of Ways to Use Math.random() in JavaScript
JavaScript math random

Lots of Ways to Use Math.random() in JavaScript

Math.random() is an API in JavaScript. It is a function that gives you a random number. The number returned will be between 0 (inclusive, as in, it’s possible for an actual 0 to be returned) and 1 (exclusive, as in, …

Jwahir Sundai on Nov 30, 2020
Direct link to the article The CSS Calculating Function Guide
calc math

The CSS Calculating Function Guide

CSS has a special calc() function for doing basic math. In this guide, let’s cover just about everything there is to know about this very useful function. …

Chris Coyier on Aug 12, 2024
  • 1
  • 2
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top