386 private links
An explanation of the WAL of SQLite.
A web component for drawing patterns with CSS
The images are actually impressive
And some figures: https://yuanchuan.dev/polygon-shapes
Re-renders only affect the component that owns the state + its descendants (if any).
When a component re-renders, it tries to re-render all descendants, regardless of whether they're being passed a particular state variable through props or not. [... Because] it's hard for React to know, with 100% certainty, whether another component depends, directly or indirectly, on the updated state variable.
In an ideal world, React components would always be “pure”. A pure component is one that always produces the same UI when given the same props.
A tweak is to declare a component with React.memo. If the props have changed, React will re-use that current component rather than going through the trouble of generating a brand new one.
Some argue that rerender is cheap too.
SQLite is a great database, but builtin functions are limited.
only 7 builtin aggregate functions: avg, count, group_concat, min, total, max, and sum
Example of usage of conic-gradient
object-fit: cover; is the one mostly used because it preserves the ratio of the image and it fits the dimension of the container.
There is multiple use cases:
- user avatars
- logos list
- article thumbnail
- hero background
- displaying videos
background-size is for the background and has 3 values: auto, contain and cover.
Using AI to generate point'n'click games, then improve the quality and done :)
TL;DR;
apply every hover effect on devices that can not support the hover effect (smartphones, ...).
Use the @media (hover: hover) media query to target devices that have the :hover effect available, or @media (hover: none).
J'ai passé plusieurs décennies à écrire du C et du C++, voire même un peu d'ASM. Et franchement, je suis admiratif des quelques codeurs "safe".
C'est comme jongler avec des tronçonneuses: ce n'est pas parce-que certain y arrivent qu'il faut en faire une recommandation.
4kB en Assembleur, ou quelques octets pour les builtins de l'OS
An other ready-to-production framework with an opinionated tech stack. Powered by Vercel.
An interactive gallery that demonstrated what's possible with just CSS gradients.
CSS variables that provoke invalid CSS declarations (for example --foo: ;) are set to unset.
Space toggle for numerical value: calc(1.5 var(--toggle-value, - .4))
with toggle value:
:root {
--ON: initial
--OFF: ;
}
Use variables for pure data, not CSS values as CSS values are often bound with a unit.
Relative values inherit as syntax tokens unless the property is registered. Registering a property as
Again CSS properties:
.box {
padding: var(--py, 1rem) var(--px, 1rem);
}
.box--some-variant {
--px: 2rem;
}👍
- Think about the
:emptyselector, especially for message errors :) :targetto select the node targeted by an achor.:only-childand:only-of-typeselectors
The article element represents a complete, or self-contained, composition in a document, page, application, or site; that is, in principle, independently distributable or reusable, e.g., in syndication.
I gave my usual answer: think of
not just as a newspaper article or a blog post, but as an article of clothing — a discrete entity that can be reused in another context. [...] It means an article represents content that can be taken out of the document and away from the immediate surrounding content, dropped somewhere else, say on another page, and still make total sense as it is grouped. The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.
A general rule is that the section element is appropriate only if the element’s contents are listed explicitly in the document’s outline. [...] a section is a part of a larger group without which it may not necessarily stand to make complete sense alone
To provide more meaning to a section for assistive technology: the attribute aria-labelledby="an-id" or aria-label=" a meaning" can be used. A labelledby attribute can be bound to a title for example.
This example of meaningful semantic shows the usefulness: https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/ceca208c-154e-42f4-b769-b62c67f0c125/content-design-screenshot.png
A search engine for programmers