This media is not supported in your browser
VIEW IN TELEGRAM
🤯 Do you know this GitHub hack?
1️⃣ Open any GitHub repository
2️⃣ Replace .com with .dev
3️⃣ View the repository code in a VS Code instance!
And yes, you can just press the "." button on your keyboard.
1️⃣ Open any GitHub repository
2️⃣ Replace .com with .dev
3️⃣ View the repository code in a VS Code instance!
And yes, you can just press the "." button on your keyboard.
❤2
This media is not supported in your browser
VIEW IN TELEGRAM
⭐️CSS Tip!⭐️
To create an inverted :hover effect, you can use mix-blend-mode with custom :hover properties.
The cool thing is that using mix-blend-mode acts as a color inverter, which works well with monochrome controls.
As for how to move this code to JavaScript?
To create an inverted :hover effect, you can use mix-blend-mode with custom :hover properties.
button > span {
left: calc(var(--x, 0) * 1px);
top: calc(var(--y, 0) * 1px);
mix-blend-mode: difference;
}The cool thing is that using mix-blend-mode acts as a color inverter, which works well with monochrome controls.
As for how to move this code to 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))button:is(:hover, :focus-visible) {
--active: 1;
}
button span {
transform: translate(-50%, -50%) scale(calc(var(--active, 0) * 3);
transition: transform 0.25s;
}❤1
💡 You can use new CSS features and apply fallback styles in unsupported browsers using the supports rule. The same can be done in JavaScript.
❤1
This media is not supported in your browser
VIEW IN TELEGRAM
💡 How to Easily Create an Accordion Without JavaScript: A Note for Front-End Developers
❤1