Search

Nalezeno "variables": 61

State of CSS 2022 Survey Now Open


The State of CSS survey recently opened up. Last year, the survey confirmed everyone’s assumptions that TailwindCSS is super popular and CSS variables are mainstream. It also codified what many of us want from CSS, from Container Queries to … State of CSS 2022 Survey Now Open...

Named Element IDs Can Be Referenced as JavaScript Globals


Did you know that DOM elements with IDs are accessible in JavaScript as global variables? It’s one of those things that’s been around, like, forever but I’m really digging into it for the first time. If this is the first … Named Element IDs Can Be Referenced as JavaScript Globals originally...

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...

Quick and Dirty Bootstrap Overrides at Runtime


Oh, Bootstrap, that old standard web library that either you hate or you spend all your time defending as “it’s fine, it’s not that bad.” Regardless of what side you fall on, it’s a powerful UI framework that’s everywhere, … The post Quick and Dirty Bootstrap Overrides at Runtime appeared...

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...

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...

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

Flash of inAccurate coloR Theme (FART)


There is a lot to think about when implementing a dark mode theme on a website. We have a huge guide on it. There are some very clever quick wins out there, but there are also some quite tricky things … The post Flash of inAccurate coloR Theme (FART) appeared first on CSS-Tricks. You...

CSS is a Strongly Typed Language


One of the ways you can classify a programming language is by how strongly or weakly typed it is. Here, “typed” means if variables are known at compile time. An example of this would be a scenario where an integer … The post CSS is a Strongly Typed Language appeared first on CSS-Tricks. You...

Want to Write a Hover Effect With Inline CSS? Use CSS Variables.


The other day I was working on a blog where each post has a custom color attached to it for a little dose of personality. The author gets to pick that color in the CMS when they’re writing the post. … The post Want to Write a Hover Effect With Inline CSS? Use CSS Variables. appeared first...

Use CSS Variables instead of React Context


Turns out you can use several different libraries to pass color information around components. Or, you could use custom properties, built right into CSS, have no decline in your own developer experience, and deliver a faster experience to your users. … The post Use CSS Variables instead...

Give your Eleventy Site Superpowers with Environment Variables


Eleventy is increasing in popularity because it allows us to create nice, simple websites, but also — because it’s so developer-friendly. We can build large-scale, complex projects with it, too. In this tutorial we’re going to demonstrate that expansive capability … The post Give your...

The CSS Custom Property Toggle Trick


Back in July 2020, I got an email from James0x57 (I always try to refer to people by their name, but I think I get the sense they prefer to go by screen name) that says: The entire world of branching conditional logic and bulk feature toggling for custom CSS properties is possible and only exists...

Collective #626


With Code * CSS Grid full-bleed layout tutorial * Why Tailwind CSS * CSS Variables 101 The post Collective #626 appeared first on Codrops

The Cicada Principle, revisited with CSS variables


Lea Verou digging up the CSS trickery classic and applying it to clip the backgrounds of some code blocks: The main idea is simple: You write your main rule using CSS variables, and then use :nth-of-*() rules to set these variables to something different every N items. If you use enough...

Global and Component Style Settings with CSS Variables


The title of this Sara Soueidan article speaks to me. I’m a big fan of the idea that some CSS is best applied globally, and some CSS is best applied scoped to a component. I’m less interested in how that is done and more interested in just seeing that conceptual approach used in some...

When Sass and New CSS Features Collide


Recently, CSS has added a lot of new cool features such as custom properties and new functions. While these things can make our lives a lot easier, they can also end up interacting with preprocessors, like Sass, in funny ways. So this is going to be a post about the issues I’ve encountered...

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