Search

Nalezeno "QR code": 1615

Downsides of Smooth Scrolling


Smooth scrolling has gotten a lot easier. If you want it all the time on your page, and you are happy letting the browser deal with the duration for you, it's a single line of CSS: html { scroll-behavior: smooth; } I tried this on version 17 of this site, and it was the second most-hated thing...

Getting Started with Python in Visual Studio Code


Python is one of the most popular and easy to learn languages, which is why it is often one of the first languages you learn. Let's see how to work with and run Python inside of Visual Studio Code!

The Dark Side of the Grid


Manuel Matuzovic makes the point that in order to use CSS grid in some fairly simple markup scenarios, we might be tempted to flatten our HTML to make sure all the elements we need to can participate on the grid. What we need is subgrid and non-buggy display: contents;, so I'd like to think in...

Styling Based on Scroll Position


Rik Schennink documents a system for being able to write CSS selectors that style a page when it has scrolled to a certain point. If you're like me, you're already on the lookout for document.addEventListener('scroll' ... and being terrified about performance. Rik gets to that right away by both...

Using React Loadable for Code Splitting by Components and Routes


In a bid to have web applications serve needs for different types of users, it’s likely that more code is required than it would be for one type of user so the app can handle and adapt to different scenarios and use cases, which lead to new features and functionalities. When this happens, it’s...

CSS Triangles, Multiple Ways


I like Adam Laki's Quick Tip: CSS Triangles because it covers that ubiquitous fact about front-end techniques: there are always many ways to do the same thing. In this case, drawing a triangle can be done: with border and a collapsed element with clip-path: polygon() with transform: rotate()...

Mask Compositing: The Crash Course


At the start of 2018, as I was starting to go a bit deeper into CSS gradient masking in order to create interesting visuals one would think are impossible otherwise with just a single element and a tiny bit of CSS, I learned about a property that had previously been completely unknown to...

Should I Use Source Maps in Production?


It's a valid question. A "source map" is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to the original authored version. Say you've got a filed called _header.scss that gets imported into global.scss which is compiled to global.css. That final CSS file...

Writing Tests for React Applications Using Jest and Enzyme


While it is important to have a well-tested API, solid test coverage is a must for any React application. Tests increase confidence in the code and helps prevent shipping bugs to users. That’s why we’re going to focus on testing in this post, specifically for React applications. By the end, you’ll...

A Bit of Performance


Here’s a great post by Roman Komarov on what he learned by improving the performance of his personal website. There’s a couple of neat things he does to tackle font loading in particular, such as adding the <link rel="preload"> tags for fonts. This will encourage those font files...

Did you know that CSS Custom Properties can handle images too?


So you might be aware of CSS Custom Properties that let you set a variable, such as a theme color, and then apply it to multiple classes like this: :root { --theme: #777; } .alert { background: var(—-theme); } .button { background: var(—-theme); } Well, I had seen this pattern so often...

Text Wrapping & Inline Pseudo Elements


I love posts like this. It's just about adding a little icon to the end of certain links, but it ends up touching on a million things along the way. I think this is an example of why some people find front-end fun and some people rather dislike it. Things involved: Cool [attribute] selectors that...

Control Icons with Font Size


Here’s a nifty trick from Andy Bell that now seems a little obvious in hindsight: if you set an SVG to have a width and height of 1em then you can change the size of it with the font-size property. Try and change the font-size on the body element below to see the icon scale with the text: ...

Look Ma, No Media Queries! Responsive Layouts Using CSS Grid


Not only has CSS Grid reshaped the way we think and build layouts for the web, but it has also contributed to writing more resilient code, replacing "hacky" techniques we've used before, and in some cases, killing the need to rely on code for specific resolutions and viewports. What's so cool about...

Create Your First Visual Studio Code Extension


When Visual Studio Code doesn't do what you want it to, you install an extension. When you can't find an extension that does exactly what you need, you create your own! In this article, we will loo

iconsvg.xyz


There is a lot to like about Gaddafi Rusli's ICONSVG. It provides inline <svg>, which is the most generically useful way to deliver them, and probably how they should be used anyway. Each icon is a tiny amount of SVG and I'd bet they were all hand-golfed. They are all stroke-based, so they...

Dealing with overflow and position: sticky;


Any overflow value other than visible and no height is the enemy of child elements with position: sticky;. It's like that element is ready to stick when the parent scrolls, but it never does because the height is unconstrained. Adding a fixed height can solve the issue, but that's not always...

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