Search

Nalezeno "Tricks": 3051

Fast Static Sites with Netlify and AnyMod


In about 10 minutes, we'll set up a workflow that makes static sites dead simple. You'll get the following: Free https Free or cheap hosting Build sites quickly Edit with live reload Edit when you’ve forgotten everything in 6 months Start: signups We can get all this by using Netlify (really...

Logical Operations with CSS Variables


Very often, while using switch variables (a variable that's either 0 or 1, a concept that's explained in a greater detail in in this post), I wish I could perform logical operations on them. We don't have functions like not(var(--i)) or and(var(--i), var(--k)) in CSS, but we can emulate these...

Some HTML is “Optional”


There is a variety of HTML that you can just leave out of the source HTML and it's still valid markup. Doesn't this look weird? <p>Paragraph one. <p>Paragraph two. <p>Paragraph three. It does to me, but the closing </p> tags are optional. The browser will detect...

Caniuse and MDN compatibility data collaboration


Second only to "silly GIFs," I'd guess screenshots of caniuse are the most common slide graphic at web conferences. It's become the ultimate source for looking at web compatibility data in the hearts and minds of web developers. Can I use CSS filter in Firefox? Yes. Can I use the filter() function?...

Hamburger Menu with a Side of React Hooks and Styled Components


We all know what a hamburger menu is, right? When the pattern started making its way into web designs, it was both mocked and applauded for its minimalism that allows main menus to be tucked off screen, particularly on mobile where every pixel of space counts. CSS-Tricks is all about double...

“Off The Main Thread”


JavaScript is what they call "single-threaded." As Brian Barbour puts it: This means it has one call stack and one memory heap. We all feel a symptom of that regularly in the form of performance jank and non-interactivity on elements or entire sites. If we give JavaScript lots of jobs and it gets...

CSS Security Vulnerabilities


Don't read that headline and get worried. I don't think CSS is a particularly dangerous security concern and, for the most part, I don't think you need to worry about it. But every once in a while, articles tend to circulate and get some attention as to the possibilities of what CSS can do that...

How to Contribute to an Open Source Project


The following is going to get slightly opinionated and aims to guide someone on their journey into open source. As a prerequisite, you should have basic familiarity with the command line and Git. If you know the concepts and want to dive right into the step by step how-to guide, check out this part...

Various Methods for Expanding a Box While Preserving the Border Radius


I've recently noticed an interesting change on CodePen: on hovering the pens on the homepage, there's a rectangle with rounded corners expanding in the back. Expanding box effect on the CodePen homepage. Being the curious creature that I am, I had to check how this works! Turns out, the rectangle...

Using a PostCSS function to automate your responsive workflow


A little while back, you might have bumped into this CSS-Tricks article where I described how a mixin can be used to automate responsive font sizes using RFS. In its latest version, v9, RFS is capable of rescaling any value for value for any CSS property with px or rem units, like margin, padding...

Learn Design for Developers and SVG Animation with Sarah Drasner ✨????


(This is a sponsored post.) Hey, Marc here from Frontend Masters — excited to support CSS-Tricks ❤️! Have you checked out Sarah Drasner's courses yet? She has two awesome courses on Design for Developers and SVG! Plus another introducing Vue.js! Design for Developers In...

Multiline truncated text with “show more” button


Now that we've got cross-browser support for the line-clamp property, I expect we'll see a lot more of that around the web. And as we start to see it more in use, it’s worth the reminder that: Truncation is not a content strategy. We should at least offer a way to read that that truncated content...

Model-Based Testing in React with State Machines


Testing applications is crucially important to ensuring that the code is error-free and the logic requirements are met. However, writing tests manually is tedious and prone to human bias and error. Furthermore, maintenance can be a nightmare, especially when features are added or business logic...

Firefox blocks third-party tracking cookies and cryptominers


This is super interesting stuff from Mozilla: the most recent update of Firefox will now block cryptominers and third-party tracking scripts by default. In the press release they write: For today’s release, Enhanced Tracking Protection will automatically be turned on by default for all users...

Fast Software


There have been some wonderfully interconnected things about fast software lately. We talk a lot of performance on the web. We can make things a little faster here and there. We see rises in success metrics with rises in performance. I find those type of charts very satisfying. But perhaps even...

Recreating Netlify’s Neat-o Sliding Button Effect


Have you seen Netlify's press page? It's one of those places where you can snag a download of the company's logo. I was looking for it this morning because I needed the logo to use as a featured image for a post here on CSS-Tricks. Well, I noticed they have these pretty looking buttons to download...

Need to scroll to the top of the page?


Perhaps the easiest way to offer that to the user is a link that targets an ID on the <html> element. So like... <html id="top"> <body> <!-- the entire document --> <a href="#top">Jump to top of page</a> ...

Should a website work without JavaScript?


The JS Party podcast just had a fun episode where they debated this classic question by splitting into two groups of two. Each group was assigned a "side" of this debate, and then let loose to debate it. I don't think anybody can listen to a show like this and not be totally flooded with thoughts!...

Styling Links with Real Underlines


Before we come to how to style underlines, we should answer the question: should we underline? In graphic design, underlines are generally seen as unsophisticated. There are nicer ways to draw emphasis, to establish hierarchy, and to demarcate titles. That’s clear in this advice from Butterick’s...

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