5 tools for web developers
https://t.co/LqMCEhThIA - Open-source Figma alternative
https://t.co/QfIg7QXA2P - Full-stack hosting for modern web apps
https://t.co/nLLgFw8CNA - Hand-drawn style diagram
https://t.co/IXShvdg2Q6 - Smooth scrolling with parallax effects
https://t.co/quykQC3ztP - Animate SVG drawings in real-time
Introducing the new CLI.
Install anything from anywhere—add components, themes, hooks, functions, animations, and generated code to your apps.
This marks a major step forward in distributing code that both you and your LLMs can access and use.
Let’s take a look.
Shipped the new chart blocks.
I’ve also added more examples on how to build advanced tooltips with custom label, icons and formatters.
https://t.co/sLtIaPIC0O
Next up: dashboards and cli updates.
Next.js file-based Metadata: Favicons
🤏 Drop a `favicon.ico` file into the `/app` folder and Next.js will automatically generate the correct `<head>` metadata for you.
By the end of 2024, you’ll likely never need these APIs again:
• useMemo, useCallback, memo → React Compiler
• forwardRef → ref is a prop
• React.lazy → RSC, promise-as-child
• useContext → use(Context)
• throw promise → use(promise)
• <Context.Provider> → <Context>
Introducing Animations on the web
A course about how to craft animations that make people feel something.
It contains everything I know about motion on the web.
https://t.co/RP4FIdUZHG
CSS Tip! ⭐️
You can use mix-blend-mode with scoped custom properties to create this inverted :hover effect 🤙
button > span {
left: calc(var(--x, 0) * 1px);
top: calc(var(--y, 0) * 1px);
mix-blend-mode: difference; 👈
}
The cool trick is that using mix-blend-mode acts like a color inverter which works well with monochromatic controls 😍 Saves defining the :hover colors, etc. It works it out for you!
As for how to move that spot around? A teeny bit of JavaScript 🤏
const UPDATE = ({target, x, y }) => {
const bounds = target.getBoundingClientRect()
target.style.setProperty('--x', x - bounds.left)
target.style.setProperty('--y', y - bounds.top)
}
const BTNS = document.querySelectorAll('button')
BTNS.forEach(BTN => BTN.addEventListener('pointermove', UPDATE))
On :hover you can use a scoped custom property to change the size of the spot
button:is(:hover, :focus-visible) {
--active: 1;
}
button span {
transform: translate(-50%, -50%) scale(calc(var(--active, 0) * 3);
transition: transform 0.25s;
}
But, what about the bouncy easy? You can use linear() where supported to create a bouncy transition ✨
@supports (transition-timing-function: linear(0, 1)) {
button:is(:hover, :focus-visible) span {
transition-duration: 0.5s;
transition-timing-function: linear(
0, 0.5007 7.21%, 0.7803 12.29%,
...
);
}
}
That's it! Thanks for the challenge @alemalohe 🤙
@CodePen link below! 👇
Nifty CSS Trick 👇
You can create that little transitioning grid highlight effect by using a fixed pseudoelement on the body and focus-within
:root { --grid--accent: transparent; }
:root:focus-within { --grid-accent: white; }
Use focus-within like state and update the custom property that defines the color of that square 🤙
It's like using :has() creating a neat little highlight effect when anything is focussed ✨
(Uploaded the video again to see if the compression on this one doesn't butcher it 🤞)