Search

Nalezeno "custom properties": 76

How I Made an Icon System Out of CSS Custom Properties


SVG is the best format for icons on a website, there is no doubt about that. It allows you to have sharp icons no matter the screen pixel density, you can change the styles of the SVG on hover … How I Made an Icon System Out of CSS Custom Properties originally published on CSS-Tricks, which...

Making a Real-Time Clock With a Conic Gradient Face


Gradients have been a part of the CSS spectrum for quite some time now. We see a lot of radial and linear gradients in a lot of projects, but there is one type of gradient that seems to be a … Making a Real-Time Clock With a Conic Gradient Face originally published on CSS-Tricks, which...

Interpolating Numeric CSS Variables


We can make variables in CSS pretty easily: :root { --scale: 1; } And we can declare them on any element: .thing { transform: scale(--scale); } Even better for an example like this is applying the variable on a user … Interpolating Numeric CSS Variables originally published...

Multi-Value CSS Properties With Optional Custom Property Values


Imagine you have an element with a multi-value CSS property, such as transform: optional custom property values: .el { transform: translate(100px) scale(1.5) skew(5deg); } Now imagine you don’t always want all the transform values to be applied, so some … Multi-Value CSS Properties With...

How to Make a Pure CSS 3D Package Toggle


You know how you can get cardboard boxes that come totally flat? You fold ‘em up and tape ‘em to make them into a useful box. Then when it’s time to recycle them, you cut them back apart to flatten … How to Make a Pure CSS 3D Package Toggle originally published on CSS-Tricks. You should...

Don’t Fight the Cascade, Control It!


If you’re disciplined and make use of the inheritance that the CSS cascade provides, you’ll end up writing less CSS. But because our styles often comes from all kinds of sources — and can be a pain to structure and … Don’t Fight the Cascade, Control It! originally published...

Parallax Powered by CSS Custom Properties


Good friend Kent C. Dodds has recently dropped his new website which had a lot of work go into it. I was fortunate enough that Kent reached out a while back and asked if I could come up with some … The post Parallax Powered by CSS Custom Properties appeared first on CSS-Tricks. You...

Different Degrees of Custom Property Usage


One way to work with Custom Properties is to think of them as design tokens. Colors, spacings, fonts, and whatnot. You set them at the root of the page and use them throughout your CSS. Very useful, and the classic … The post Different Degrees of Custom Property Usage appeared first...

The Big Gotcha With Custom Properties


I’ve seen this confuse more than a handful of people recently, including myself, so I’m making sure it’s written down. Let’s chuck a couple of custom properties into CSS: html { --color-1: red; --color-2: blue; } Let’s use them right … The post The...

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 (… The post Using Absolute Value, Sign, Rounding and Modulo in CSS Today appeared...

Of Course We Can Make a CSS-Only Clock That Tells the Current Time!


Let’s build a fully functioning and settable “analog” clock with CSS custom properties and the calc() function. Then we’ll convert it into a “digital” clock as well. All this with no JavaScript! Here’s a quick look at the clocks … The post Of Course We Can Make a CSS-Only Clock That Tells...

The Dilemma of Naming Font Size Variables


Normally, a project will have a set of pre-determined font sizes, usually as variables named in such a way that seeks some semblance of order and consistency. Any project of considerable size can use something like that. There are always … The post The Dilemma of Naming Font Size Variables...

Custom Property Brain Twisters


I am part of that 82% that got the answer to Lea Verou's quiz wrong. Stephen Shaw posted a similar quiz as well and it's a fun exercise sharpen your CSS chops. The post Custom Property Brain Twisters appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter

Are Custom Properties a “Menu of What Will Change”?


PPK laid out an interesting situation in “Two options for using custom properties” where he and Stefan Judis had two different approaches for doing the same thing with custom properties. In one approach, hover and focus styles for a … The post Are Custom Properties a “Menu...

JSON in CSS


Jonathan Neal tweeted a heck of a little CSS trick the other day, putting JSON inside CSS and plucking it out with JavaScript. Valid values for custom properties are quite liberal! So this looks for a CSS rule (e.g. a … The post JSON in CSS appeared first on CSS-Tricks. You can support...

Dynamic CSS Masks with Custom Properties and GSAP


Learn how to animate CSS masks based on the cursor position using GSAP and custom properties for a unique spotlight effect. The post Dynamic CSS Masks with Custom Properties and GSAP appeared first on Codrops

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