Search

Nalezeno "css-tricks": 2942

CUBE CSS


A CSS methodology from Andy Bell: The most important part of this methodology is the language itself: CSS. It’s key to note its existence in the name because some alternative approaches, such as BEM—which I have enjoyed for many years—can veer very far away from Cascading Style Sheets. I love CSS...

On Adding IDs to Headers


Here’s a two-second review. If an element has an ID, you can link to it with natural browser behavior. It’s great if headings have them, because it’s often useful to link directly to a specific section of content. <h3 id="step-2"Step 2</a Should I be so inclined, I could...

How to Reverse CSS Custom Counters


I needed a numbered list of blog posts to be listed with the last/high first and going down from there. Like this: 5. Post Title 4. Post Title 3. Post Title 2. Post Title 1. Post Title But the above is just text. I wanted to do this with a semantic <ol> element. The easy way This can...

Creative Background Patterns Using Gradients, CSS Shapes, and Even Emojis


You can create stripes in CSS. That’s all I thought about in terms of CSS background patterns for a long time. There’s nothing wrong with stripes; stripes are cool. They can be customized into wide and narrow bands, criss-crossed into a checked pattern, and played with in other ways using the idea...

CSS :is() and :where() are coming to browsers


Šime Vidas with the lowdown on what these pseudo-selectors are and why they will be useful: :is() is to reduce repetition¹ of parts of comma-separated selectors. :where() is the same, but nothing inside it affects specificity. The example of wrapping :where(:not()) is really great, as now there...

Cool Little CSS Grid Tricks for Your Blog


I discovered CSS about a decade ago while trying to modify the look of a blog I had created. Pretty soon, I was able to code cool things with more mathematical and, therefore, easier-to-understand features like transforms. However, other areas of CSS, such as layout, have remained a constant source...

Making My Netlify Build Run Sass


Let’s say you wanted to build a site with Eleventy as the generator. Popular choice these days! Eleventy doesn’t have some particularly blessed way of preprocessing your CSS, if that’s something you want to do. There are a variety of ways to do it and perhaps that freedom is part...

5 Myths About Jamstack


Jamstack isn’t necessarily new. The term was officially coined in 2016, but the technologies and architecture it describes have been around well before that. Jamstack has received a massive dose of attention recently, with articles about it appearing in major sites and publications and...

The Trickery it Takes to Create eBook-Like Text Columns


There’s some interesting CSS trickery in Jason Pamental’s latest Web Fonts & Typography News. Jason wanted to bring swipeable columns to his digital book experience on mobile. Which brings up an interesting question right away… how do you set full-width columns that...

How to Get All Custom Properties on a Page in JavaScript


We can use JavaScript to get the value of a CSS custom property. Robin wrote up a detailed explanation about this in Get a CSS Custom Property Value with JavaScript. To review, let’s say we’ve declared a single custom property on the HTML element: html {   --color-accent: #00eb9b; } In JavaScript...

Analyzing Notion app performance


Here’s a fantastic case study where Ivan Akulov looks at the rather popular writing app Notion and how the team might improve the performance in a variety of ways; through code splitting, removing unused vendor code, module concatenation, and deferring JavaScript execution. Not so long ago, we made...

Diverse Illustration


Hey gang, #BlackLivesMatter. One tiny way I thought we could help here on this site, aside from our efforts as individuals, is to highlight some design resources that are both excellent and feature Black people. Representation matters. Here’s one. You know Pablo Stanley? Pablo is a wonderful...

A/B Testing Instant.Page With Netlify and Speedcurve


Instant.Page does one special thing to make sites faster: it preloads the next page when it’s pretty sure you’re going to click a link (either by hovering over 65ms or mousedown on desktop, or touchstart on mobile), so when you do complete the click (probably a few hundred milliseconds...

A Primer on Display Advertising for Web Designers


A lot of websites (this one included) rely on advertising as an important revenue source. Those ad placements directly impact the interfaces we build and interact with every day. Building layouts with ads in them is a dance of handling them in fluid environments, and also balancing the need...

The Best Design System Tool is Slack


There’s a series questions I have struggled with for as long as I can remember. The questions have to do with how design systems work: Where should we document things? Do we make a separate app? Do we use a third-party tool to document our components? How should that tie into Figma or Sketch?...

Adding CSS to a Page via HTTP Headers


Only Firefox supports it, but if you return a request with a header like this: Header add Link "<style.css;rel=stylesheet;media=all" …that will link to that stylesheet without you having to do it in the HTML. Louis Lazaris digs into it: […] the only thing I can think of that could...

Jumping Into Webmentions With NextJS (or Not)


Webmention is a W3C recommendation last published on January 12, 2017. And what exactly is a Webmention? It’s described as… […] a simple way to notify any URL when you mention it on your site. From the receiver’s perspective, it’s a way to request notifications when other sites...

On fixed elements and backgrounds


After just playing with apsect-ratio and being pleasantly surprised at how intuitive it is, here’s an example of CSS acting unintuitively: If you have a fixed element on your page, which means it doesn’t move when you scroll, you might realise that it no longer acts fixed if you apply a...

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