Search

Nalezeno "functions": 152

Poking at the CSS if() Function a Little More: Conditional Color Theming


The CSS if() function enables us to use values conditionally, which we can already do with queries and other functions, so I’m sure you’re wondering: What exactly does if() do? Let's look at a possible real-world use case. Poking at the CSS if() Function a Little More: Conditional Color Theming...

Lightly Poking at the CSS if() Function in Chrome 137


The CSS if() function was recently implemented in Chrome 137, making it the first instance where we have it supported by a mainstream browser. Let's poke at it a bit at a very high level. Lightly Poking at the CSS if() Function in Chrome 137 originally published on CSS-Tricks, which is part of...

Color Everything in CSS


An introduction to "Color spaces", "Color models", "Color gamuts," and basically all of the "Color somethings" in CSS. Color Everything in CSS originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter

CSS Color Functions


CSS has a number of functions that can be used to set, translate, and manipulate colors. Learn what they are and how they are used with a bunch of examples to get you started. CSS Color Functions originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get...

Breaking Boundaries: Building a Tangram Puzzle With (S)CSS


We put it to the test and it turns out Sass can replace JavaScript, at least when it comes to low-level logic and puzzle behavior. With nothing but maps, mixins, functions, and a whole lot of math, we managed to bring our Tangram puzzle to life, no JavaScript required. Breaking Boundaries:...

Better CSS Shapes Using shape() — Part 3: Curves


This is the third article in a series about the CSS shape() function. We've covered drawing lines and arcs in previous articles and, this time, we look specifically at the curve command and how to use it for drawing complex shapes. Better CSS Shapes Using shape() — Part 3: Curves originally...

Exploring the CSS contrast-color() Function… a Second Time


The contrast-color() function doesn’t check color contrast, but rather it outright resolves to either black or white (whichever one contrasts the most with your chosen color). Safari Technology Preview recently implemented it and we explore its possible uses in this article. Exploring...

Better CSS Shapes Using shape() — Part 2: More on Arcs


This is the second part of a series that dives deep into the CSS shape() command, continuing with a more detailed look at the arc command. Better CSS Shapes Using shape() — Part 2: More on Arcs originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get...

Better CSS Shapes Using shape() — Part 1: Lines and Arcs


This is the first part of a series that dives deep into the shape function, starting with shapes that use lines and arcs. Better CSS Shapes Using shape() — Part 1: Lines and Arcs originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter

SVG to CSS Shape Converter


Shape master Temani Afif has what might be the largest collection of CSS shapes on the planet with all the tools to generate them on the fly. There’s a mix of clever techniques he’s typically used to make those shapes, … SVG to CSS Shape Converter originally published...

CSS shape() Commands


The CSS shape() function recently gained support in both Chromium and WebKit browsers. It's a way of drawing complex shapes when clipping elements with the clip-path property. CSS shape() Commands originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get...

Functions in CSS?!


Arguments?! Return values?! What's crazier, you can use functions right now in Chrome Canary! So, after reading and playing around, here are my key insights on what you need to know about CSS Functions. Functions in CSS?! originally published on CSS-Tricks, which is part of the DigitalOcean...

The What If Machine: Bringing the “Iffy” Future of CSS into the Present


My thesis for today's article offers further reassurance that inline conditionals are probably not the harbinger of the end of civilization: I reckon we can achieve the same functionality right now with style queries, which are gaining pretty good browser support. The What If Machine: Bringing...

Typecasting and Viewport Transitions in CSS With tan(atan2())


We’ve been able to get the length of the viewport in CSS since… checks notes… 2013! Surprisingly, that was more than a decade ago. Getting the viewport width is as easy these days as easy as writing 100vw, but … Typecasting and Viewport Transitions in...

How to Wait for the sibling-count() and sibling-index() Functions


Today, I want to look into one of those cases of impatient and how the community has waited for that feature, to be specific, two upcoming functions: sibling-count() and sibling-index(). How to Wait for the sibling-count() and sibling-index() Functions originally published on CSS-Tricks, which...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace