Search

Nalezeno "Properties": 109

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

A Complete Guide to Custom Properties


Everything important and useful to know about CSS Custom Properties. Like that they are often referred to as "CSS Variables" but that's not their real name. The post A Complete Guide to Custom Properties appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter

Generating (and Solving!) Sudokus in CSS


I love to make CSS do stuff it shouldn’t. It’s the type of problem-solving brain training you’d get building a calculator in Minecraft, except you probably won’t get a job working with Minecraft Redstone no matter how good you … The post Generating (and Solving!) Sudokus in CSS appeared...

You want margin-inline-start


David Bushell in ”Changing CSS for Good“: I’m dropping “left“ and “right“ from my lexicon. The new CSS normal is all about Logical Properties and Values […] It can be as easy as replacing left/right … The post You want margin-inline-start appeared first on CSS-Tricks. You...

Image Fragmentation Effect With CSS Masks and Custom Properties


Geoff shared this idea of a checkerboard where the tiles disappear one-by-one to reveal an image. In it, an element has a background image, then a CSS Grid layout holds the “tiles” that go from a filled background color to … The post Image Fragmentation Effect With CSS Masks and Custom...

Exploring @property and its Animating Powers


Uh, what’s @property? It’s a new CSS feature! It gives you superpowers. No joke, there is stuff that @property can do that unlocks things in CSS we’ve never been able to do before. While everything about @property is exciting, … The post Exploring @property and its Animating Powers appeared...

How to Map Mouse Position in CSS


Let’s look at how to get the user’s mouse position and map it into CSS custom properties: --positionX and --positionY. We could do this in JavaScript. If we did, we could do things like make make an element … The post How to Map Mouse Position in CSS appeared first on CSS-Tricks. You...

A DRY Approach to Color Themes in CSS


The other day, Florens Verschelde asked about defining dark mode styles for both a class and a media query, without repeat CSS custom properties declarations. I had run into this issue in the past but hadn’t come up with a … The post A DRY Approach to Color Themes in CSS appeared first...

Clipping Scrollable Areas On The inline-start Side


On a default left-to-right web page, “hanging” an element off the right side of the page (e.g. position: absolute; right: -100px;) triggers a horizontal scrollbar that scrolls as far as needed to make that whole element visible. But if … The post Clipping Scrollable Areas On...

CSS Switch-Case Conditions


CSS is yet to have a switch rule or conditional if, aside from the specific nature of @media queries and some deep trickery with CSS custom properties. Let’s have a look at why it would be useful if we … The post CSS Switch-Case Conditions appeared first on CSS-Tricks. You can support...

useStateInCustomProperties


In my recent “Custom Properties as State” post, one of the things I mentioned was that theoretically, UI libraries, like React and Vue, could automatically map the state they manage over to CSS Custom Properties so we could use that state … The post...

How to Play and Pause CSS Animations with CSS Custom Properties


Let’s have a look CSS @keyframes animations, and specifically about how you can pause and otherwise control them. There is a CSS property specifically for it, that can be controlled with JavaScript, but there is plenty of nuance to get … The post How to Play and Pause CSS Animations with...

Custom Properties as State


Here’s a fun idea from James Stanley: a CSS file (that presumably updates daily) containing CSS custom properties for “seasonal” colors (e.g. spring is greens, fall is oranges). You’d then use the values to theme your site, knowing that those … The post Custom...

A Utility Class for Covering Elements


Big ol’ same to Michelle Barker here: Here’s something I find myself needing to do again and again in CSS: completely covering one element with another. It’s the same CSS every time: the first element (the one that needs to be covered) has position: relative applied to it....

Late to Logical


2020 brought another wave of logical property features to major browsers and I’ve thoroughly enjoyed my investment into logical, rather than physical, web styling. I feel like I’ve learned a new way to speak about the box model that results in less written code with more global coverage. p { ...

Color Theming with CSS Custom Properties and Tailwind


Custom properties not only enable us to make our code more efficient, but allow us to work some real magic with CSS too. One area where they have huge potential is theming. At Atomic Smash we use Tailwind CSS, a utility class framework, for writing our styles. In this article, we’ll look at...

Logical layout enhancements with flow-relative shorthands


Admission: I’ve never worked on a website that was in anything other than English. I have worked on websites that were translated by other teams, but I didn’t have much to do with it. I do, however, spend a lot of time thinking in terms of block-level and inline-level elements....

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