Skip to content

Instantly share code, notes, and snippets.

View manuelhe's full-sized avatar
🏕️
6 years quarantined

Manuel Herrera manuelhe

🏕️
6 years quarantined
View GitHub Profile
@manuelhe
manuelhe / css-features-2024.md
Last active April 17, 2024 17:02
Latest CSS features 2024

The latest CSS developments have brought forth exciting enhancements that empower web developers to create more expressive and flexible designs. Let's delve into some of the most impactful features:

  1. Container Queries:

    • These recently became stable across all modern browsers.
    • With container queries, you can query a parent element's size and style to determine the styles that should be applied to any of its children.
    • Unlike media queries, which work based on the viewport, container queries allow precise styling adjustments for individual components within layouts.
    • For instance, in an email inbox layout, the Primary Inbox and Favorites sidebar adjust their grid layout and display email timestamps based on available space¹.
  2. Style Queries:

  • Partially implemented in Chrome 111, style queries enable you to query the style values of a parent container using CSS custom properties.
@manuelhe
manuelhe / web-tools-links.md
Last active April 3, 2025 20:45
Web Dev Tools and Ideas
@manuelhe
manuelhe / javascript-concepts.md
Last active February 16, 2024 21:10
Learning concepts of Javascript
@manuelhe
manuelhe / downloadFile.ts
Created March 30, 2023 00:30
Helper function for Download file from memory
function downloadFile(content: BlobPart, mimeType: string, filename: string) {
const a = document.createElement('a'); // Create "a" element
const blob = new Blob([content], { type: mimeType }); // Create a blob (file-like object)
const url = URL.createObjectURL(blob); // Create an object URL from blob
a.setAttribute('href', url); // Set "a" element link
a.setAttribute('download', filename); // Set download filename
a.click(); // Start downloading
}
@manuelhe
manuelhe / randomparagraphgen.js
Created March 12, 2023 17:56
Random paragraph generator
const words = [
[
'bird',
'clock',
'boy',
'plastic',
'duck',
'teacher',
'old lady',
'professor',
@manuelhe
manuelhe / web-dev-ideas-tools.md
Last active August 3, 2022 14:17
Ideas, tools and technical documents for Web Development
@manuelhe
manuelhe / number_base_transform.js
Created April 5, 2021 20:49
Numbers base transformation in JavaScript
// Numeric base transformations in JavaScript
@manuelhe
manuelhe / spa-routing.js
Created March 9, 2021 23:06
Ultra Slim SPA Router 2021 by @_developit
// Based on source: https://twitter.com/_developit/status/1369397356098097154/photo/1
// links listener
addEventListener('click', e => {
let a = e.target;
// Loop avoids having to jump to `http://event.target.parentNode`
// when the target is a Text or other non-Element node.
// It's also a bit faster than closest() and supports IE11.
while (a.localName !== 'a' && (a = a.parentNode));
if (a && a.origin == location.origin && !a.target) {