Skip to content

Instantly share code, notes, and snippets.

View dragontheory's full-sized avatar
Could tell you, but then I'd have to, well... you know.

D7460N dragontheory

Could tell you, but then I'd have to, well... you know.
View GitHub Profile

🖌️ Modern CSS Transitioning of display, opacity, and scale for SVG Overlays

📌 Overview

With modern CSS, display can now be transitioned using transition-behavior: allow-discrete;. This allows smooth transitions for display, along with opacity and scale. This guide applies these principles to an SVG overlay effect using ::after.


🎨 HTML Structure

Advantages of Using Native Web Technologies

1. Introduction

By building this app with native JavaScript, modern CSS (:has(), container queries), and the Fetch API, we achieve several advantages that enhance performance, security, maintainability, and scalability.


2. Performance & Efficiency 🚀

No Virtual DOM Overhead → Native browser rendering is optimized for handling UI updates efficiently.

Benefits of Separation of Concerns in Web Development

1. Introduction 🌍✨

Separation of Concerns (SoC) is a fundamental principle in software development that promotes modularity, maintainability, security, and scalability by ensuring that different aspects of an application are handled independently. These principles are universal and apply to all websites and applications, offering immediate benefits to both end-users and developers alike in terms of performance, accessibility, security, and long-term maintainability.

By leveraging modern HTML and CSS capabilities that all major browsers now support, SoC allows GUI logic (presentation) and data/business logic to be developed in parallel, enabling faster development cycles while ensuring each layer remains maintainable and scalable. This approach allows front-end and back-end teams to work independently, reducing bottlenecks and improving efficiency.

Modern CSS features like :has() and container/style queries

Benefits of Semantic HTML

1. Introduction 🌍✨

Semantic HTML is a foundational principle in web development that enhances accessibility, usability, maintainability, and SEO by using HTML elements that accurately convey their meaning and function. Unlike generic <div> and <span> elements, semantic elements like <header>, <nav>, <section>, and <article> improve both human readability and machine interpretation of a webpage’s content.

By adhering to semantic HTML best practices, developers create websites and applications that are easier to navigate, more accessible to assistive technologies, and optimized for search engines. These benefits extend to screen readers, browser rendering engines, and automated testing tools.


🚀 What is a Progressive Web App (PWA)?

A Progressive Web App (PWA) is a modern website that works like an app. It combines the best features of websites and apps, offering a smooth and reliable experience without requiring downloads from an app store.

✅ Why Should You Approve a PWA Project?

PWAs provide significant benefits without the costs and complexity of traditional desktop software. They offer a low-cost, low-risk way to improve user engagement, productivity, and system longevity while requiring minimal maintenance. Since most users will be on desktop, PWAs are optimized for this environment. Here’s why they matter:

🌟 Key Benefits

🚀 Future-Proofing Strategies for Websites

To keep your website from becoming obsolete, focus on browser-native, standards-compliant solutions. Here’s how:


1️⃣ Prioritize Progressive Enhancement

  • Start with clean, semantic HTML as the foundation.
  • Use modern CSS for styling and layouts.
  • Enhance functionality optionally with JavaScript (but don’t rely on it for core functionality).

🛠️ Web Components: A Native Alternative to Frameworks

For over a decade, developers relied on JavaScript frameworks like React, Angular, and Vue because browsers lacked the features needed for modular, reusable UI components. Frameworks emerged around 2010-2013 to solve this problem by providing:

  • 🏗️ Component-based architecture (before browsers had native modules).
  • Efficient state management (before ES6 class and import/export).
  • 🎨 Encapsulation & styling (before Shadow DOM and CSS variables).
  • 🚀 Virtual DOM & diffing (to optimize slow DOM updates).

However, modern browsers have caught up—and surpassed these needs. As of ES6 (2015) and beyond, JavaScript now natively supports modules, classes, and modern async patterns. Web Components leverage these advancements, meaning the browser itself is now the framework.

Web Components Part 2: Custom HTML Tags and Web Components Without Shadow DOM

🔖 Custom HTML Tags Are Standard

Custom HTML tags are a built-in browser feature and do not require JavaScript or Web Components. They improve readability and structure by making your HTML more semantic. Custom HTML tags do not need JavaScript registration; they can be used directly in HTML.

Custom elements must contain at least one hyphen (-) in their name, as per the HTML standard. This prevents conflicts with future built-in HTML elements.

Custom tags became part of the HTML standard in 2013 with the introduction of Web Components as part of the W3C specification.

CSS Nesting: A Comprehensive Overview

🚀 Introduction

CSS Nesting is a modern enhancement to CSS that allows developers to write more structured and readable styles by nesting selectors within one another, similar to preprocessor syntaxes like SCSS. This feature improves maintainability and reduces redundancy, making CSS easier to manage.

📜 History of CSS Nesting

CSS Nesting has long been a desired feature, inspired by preprocessors such as Sass and Less. However, it was only officially introduced in the CSS Specification as part of CSS Nesting Module Level 1.

Evolution of CSS Layout Techniques 🏗️

1. Table-Based Layouts (1990s - Early 2000s) 📊

Before CSS gained traction, web developers used HTML tables for layout. This method relied on nesting tables to achieve complex layouts.

Industry Standard:

  • 🏛️ Developers used <table>, <tr>, and <td> for structuring content.
  • 🎨 Inline styles and font tags controlled appearance.
  • 🚫 CSS was mostly ignored or used minimally.