Search

Nalezeno "QR code": 1615

Making a Realistic Glass Effect with SVG


I’m in love with SVG. Sure, the code can look dense and difficult at first, but you’ll see the beauty in the results when you get to know it. The bonus is that those results are in code, so it can be hooked up to a CMS. Your designers can rest easy knowing they don't have to reproduce an effect...

A More Accessible Portals Demo


The point of the <portal> element (behind a flag in Chrome Canary) is that you can preload another whole page (like <iframe>), but then have APIs to animate it to the current page. So "Single Page App"-like functionality (SPA), but natively. I think that's pretty cool. I'm a fan...

How much specificity do @rules have, like @keyframes and @media?


I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant? To prove that, we can use the same selector inside and outside of an at-rule and see if it seems to affect specificity. body { background:...

Intrinsically Responsive CSS Grid with minmax() and min()


The most famous line of code to have come out of CSS grid so far is: grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); Without any media queries, that will set up a grid container that has a flexible number of columns. The columns will stretch a little, until there is enough room...

The Simplest Way to Load CSS Asynchronously


Scott Jehl: One of the most impactful things we can do to improve page performance and resilience is to load CSS in a way that does not delay page rendering. That’s because by default, browsers will load external CSS synchronously—halting all page rendering while the CSS is downloaded...

Run useEffect Only Once


React has a built-in hook called useEffect. Hooks are used in function components. The Class component comparison to useEffect are the methods componentDidMount, componentDidUpdate, and componentWillUnmount. useEffect will run when the component renders, which might be more times than you think....

Datalist is for suggesting values without enforcing values


Have you ever had a form that needed to accept a short, arbitrary bit of text? Like a name or whatever. That's exactly what <input type="text"> is for. There are lots of different input types (and modes!), and picking the right one is a great idea. But this little story is about something...

Responsive Iframes


Say you wanted to put the CSS-Tricks website in an <iframe>. You'd do that like this: <iframe src="https://css-tricks.com"></iframe> Without any other styling, you'd get a rectangle that is 300x150 pixels in size. That's not even in the User Agent stylesheet, it's just some...

Don’t comma-separate :focus-within if you need deep browser support


I really like :focus-within. It's a super useful selector that allows you to essentially select a parent element when any of its children are in focus. Say you wanted to reveal some extra stuff when a <div> is hovered... div:hover { .extra-stuff { /* reveal it */ } } That's...

Pseudo Code


Yonatan Doron wrote a post on Medium not long ago called "Art of Code — Why you should write more Pseudo Code." Love that title, as a fan of pseudo code myself. That is, writing "code" that describes something you want to do or communicate, but that isn't of any particular language and doesn't...

Zoom, CORS, and the Web


It's sorta sad by funny that that big Zoom vulnerability thing was ultimately related to web technology and not really the app itself. There is this idea of custom protocols or "URL schemes." So, like gittower:// or dropbox:// or whatever. A native app can register them, then URLs that hit them...

Code Formatting with Prettier in Visual Studio Code


Formatting code consistently is a pain, especially when working on a team. The beauty of modern day web development is that the tooling has gotten so much better! In this article, we will look at s

CSS :not() with Multiple Classes


Say you want to select an element when it doesn't have a certain class. That's what the :not() selector is for. body:not(.home) { } But what if there are multiple classes you want to avoid? There are no logical combinators with :not(), like and or or, but you can chain them, which...

Bitcoin Cash Milestones: Delivered Code, Upgrades and Platform Development


Bitcoin Cash (BCH) platform and protocol development have seen a lot of delivered code and projects over the last two years. The upgrades will help Bitcoin Cash scale to the masses, and many of the added features are protocol developments that are unique to BCH. Also read: Indian Government Breaks...

How I Created a Code Beautifier in Two Days


I recently drew up a wireframe for a code beautifier. The next day, I decided to turn it into a real tool. The whole project took less than two days to complete. I'd been thinking about building a new code beautifier for a while. The idea isn't unique, but every time I use someone else's tool,...

Collective #533


Is postMessage slow? * Reduced Motion Auto-Play Video * Repo Lovers * Think in Math. Write in Code. Collective #533 was written by Pedro Botelho and published on Codrops

Multi-Line Truncation with Pure CSS


Truncating a single line of text if is fairly straightforward. Truncating multiple lines is a bit harder. Using just CSS (no JavaScript or server-side dancing) is nice for the simplicity. It's gotten a little easier lately since Firefox (since version 68) has started supporting the ultra-bizarre...

Micro Frontends


One random day not long ago, I started hearing joke after joke about "micro frontends" — sort of how I first learned about Toast. I didn't understand the source until asking around, which uncovered this article from Cam Jackson. In this article we'll describe a recent trend of breaking...

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