<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Css on Commentary of Takao</title><link>https://takao.blog/en/tags/css/</link><description>Recent content in Css on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Commentary of Takao</copyright><lastBuildDate>Sat, 13 Jun 2026 23:11:50 +0900</lastBuildDate><atom:link href="https://takao.blog/en/tags/css/index.xml" rel="self" type="application/rss+xml"/><item><title>Optimizing Web Font Loading: Preventing FOUT and FOIT</title><link>https://takao.blog/en/web/performance-fonts-loading-optimization/</link><pubDate>Sun, 15 Mar 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/performance-fonts-loading-optimization/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Optimizing Web Font Loading: Preventing FOUT and FOIT" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Web fonts enhance design but come at a cost. While a custom font loads, browsers must decide: show invisible text (&lt;strong&gt;FOIT&lt;/strong&gt; — Flash of Invisible Text) or show a fallback font (&lt;strong&gt;FOUT&lt;/strong&gt; — Flash of Unstyled Text). Either choice impacts &lt;strong&gt;CLS (Cumulative Layout Shift)&lt;/strong&gt; and user experience. This article covers strategies to load fonts reliably while minimizing layout shifts.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-font-display-descriptor"&gt;The font-display Descriptor
&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;font-display&lt;/code&gt; property in &lt;code&gt;@font-face&lt;/code&gt; controls how a font is displayed during loading:&lt;/p&gt;</description></item><item><title>Creative CSS Recipes with Parent Selector :has()</title><link>https://takao.blog/en/web/css-has-pseudo-selector-recipes/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-has-pseudo-selector-recipes/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Creative CSS Recipes with Parent Selector :has()" /&gt;&lt;h2 id="creative-css-recipes-with-parent-selector-has"&gt;Creative CSS Recipes with Parent Selector &lt;code&gt;:has()&lt;/code&gt;
&lt;/h2&gt;&lt;p&gt;For years, CSS developers dreamed of a &lt;strong&gt;parent selector&lt;/strong&gt; — a way to style an element based on its children. JavaScript and extra class names were the only workarounds. Then came &lt;code&gt;:has()&lt;/code&gt;, the CSS pseudo-class that finally makes &amp;ldquo;if this element contains X, style it accordingly&amp;rdquo; a native reality.&lt;/p&gt;
&lt;p&gt;As of 2026, &lt;code&gt;:has()&lt;/code&gt; is supported in all major browsers, opening a world of markup simplification and creative styling without touching JavaScript.&lt;/p&gt;</description></item><item><title>Tailwind CSS v4.0 Release and Pure CSS Configuration</title><link>https://takao.blog/en/web/tailwind-css-v4-release-changes/</link><pubDate>Thu, 05 Feb 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/tailwind-css-v4-release-changes/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Tailwind CSS v4.0 Release and Pure CSS Configuration" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Tailwind CSS v4.0 marks a paradigm shift from JavaScript-based configuration to a &lt;strong&gt;CSS-first architecture&lt;/strong&gt;. The &lt;code&gt;tailwind.config.js&lt;/code&gt; file is gone; design tokens are now defined directly in CSS using &lt;code&gt;@theme&lt;/code&gt;. This release also integrates &lt;strong&gt;Lightning CSS&lt;/strong&gt; for blazing-fast builds, adopts modern CSS features like CSS nesting and &lt;code&gt;@layer&lt;/code&gt;, and ships a completely rewritten engine. This article breaks down the key changes and provides a practical migration guide from v3.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="css-first-configuration-with-theme"&gt;CSS-First Configuration with &lt;code&gt;@theme&lt;/code&gt;
&lt;/h2&gt;&lt;p&gt;In v3, customizing design tokens required JavaScript:&lt;/p&gt;</description></item><item><title>Preventing Cumulative Layout Shift with CSS aspect-ratio</title><link>https://takao.blog/en/web/css-aspect-ratio-cumulative-layout-shift/</link><pubDate>Wed, 10 Dec 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-aspect-ratio-cumulative-layout-shift/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Preventing Cumulative Layout Shift with CSS aspect-ratio" /&gt;&lt;h2 id="understanding-cumulative-layout-shift"&gt;Understanding Cumulative Layout Shift
&lt;/h2&gt;&lt;p&gt;Cumulative Layout Shift (CLS) is one of Google&amp;rsquo;s &lt;strong&gt;Core Web Vitals&lt;/strong&gt; metrics that measures visual stability. It quantifies how often users experience unexpected layout shifts. A high CLS score harms user experience and SEO rankings. The primary cause? Media elements (images, videos, iframes) loading without reserved space.&lt;/p&gt;
&lt;h2 id="how-css-aspect-ratio-works"&gt;How CSS aspect-ratio Works
&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;aspect-ratio&lt;/code&gt; CSS property lets you declare the ratio of width to height for any element. The browser reserves space accordingly, preventing the layout from jumping when content loads.&lt;/p&gt;</description></item><item><title>Implementing Simple Dark Mode with CSS light-dark()</title><link>https://takao.blog/en/web/css-light-dark-color-scheme/</link><pubDate>Fri, 10 Oct 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-light-dark-color-scheme/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Implementing Simple Dark Mode with CSS light-dark()" /&gt;&lt;h2 id="the-problem-with-traditional-dark-mode"&gt;The Problem with Traditional Dark Mode
&lt;/h2&gt;&lt;p&gt;Implementing dark mode traditionally required duplicate CSS rules wrapped in &lt;code&gt;@media (prefers-color-scheme: dark)&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-css" data-lang="css"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;:&lt;span style="color:#a6e22e"&gt;root&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --bg: &lt;span style="color:#ae81ff"&gt;#ffffff&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --text: &lt;span style="color:#ae81ff"&gt;#111111&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@&lt;span style="color:#66d9ef"&gt;media&lt;/span&gt; &lt;span style="color:#f92672"&gt;(&lt;/span&gt;&lt;span style="color:#f92672"&gt;prefers-color-scheme&lt;/span&gt;&lt;span style="color:#f92672"&gt;:&lt;/span&gt; &lt;span style="color:#f92672"&gt;dark&lt;/span&gt;&lt;span style="color:#f92672"&gt;)&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; :&lt;span style="color:#a6e22e"&gt;root&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --bg: &lt;span style="color:#ae81ff"&gt;#1a1a2e&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; --text: &lt;span style="color:#ae81ff"&gt;#e0e0e0&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This works but creates maintenance overhead, especially when managing multiple color properties across large stylesheets. The &lt;code&gt;light-dark()&lt;/code&gt; CSS function eliminates this duplication entirely.&lt;/p&gt;
&lt;h2 id="the-light-dark-function"&gt;The light-dark() Function
&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;light-dark()&lt;/code&gt; function accepts two color values and automatically returns the one matching the user&amp;rsquo;s current color scheme:&lt;/p&gt;</description></item><item><title>Standard Syntax of CSS Nesting without Preprocessors</title><link>https://takao.blog/en/web/css-nesting-standard-syntax/</link><pubDate>Fri, 15 Aug 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-nesting-standard-syntax/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Standard Syntax of CSS Nesting without Preprocessors" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Historically, writing nested CSS rules required preprocessing tools like Sass (SCSS), Less, or PostCSS.&lt;/p&gt;
&lt;p&gt;However, browser vendors have standardized the &lt;strong&gt;CSS Nesting specification&lt;/strong&gt;. Today, you can write nested selectors directly in plain CSS files and run them natively in all modern web browsers.&lt;/p&gt;
&lt;p&gt;This article reviews the standard syntax of native CSS nesting and explains how its behavior differs from Sass compilations.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-the-basics-of-native-css-nesting"&gt;1. The Basics of Native CSS Nesting
&lt;/h2&gt;&lt;p&gt;Standard CSS Nesting looks very similar to the nested structures used in Sass.&lt;/p&gt;</description></item><item><title>Designing Modular layouts with CSS Container Queries</title><link>https://takao.blog/en/web/css-container-queries-vs-media-queries/</link><pubDate>Thu, 10 Jul 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-container-queries-vs-media-queries/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Designing Modular layouts with CSS Container Queries" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;For years, &lt;strong&gt;Media Queries (&lt;code&gt;@media&lt;/code&gt;)&lt;/strong&gt; have been the foundation of responsive web design.&lt;/p&gt;
&lt;p&gt;Media queries trigger layout changes based on the viewport width of the browser window. However, in modern component-driven development (using React, Vue, or Web Components), styling components based on the viewport has notable limitations.&lt;/p&gt;
&lt;p&gt;For example, if you want to reuse a card component in both a wide main column and a narrow sidebar, media queries cannot detect the space available to the component, causing the layout to break.&lt;/p&gt;</description></item><item><title>Perfect Alignment with CSS Grid Subgrid</title><link>https://takao.blog/en/web/css-subgrid-grid-nesting/</link><pubDate>Sat, 10 May 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-subgrid-grid-nesting/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Perfect Alignment with CSS Grid Subgrid" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Aligning nested components across columns in card layouts is a common layout challenge in responsive web design.&lt;/p&gt;
&lt;p&gt;While CSS Grid and Flexbox make it easy to equalise the height of sibling card containers, aligning the internal elements (such as headers, body copy, and CTA buttons) remains difficult. If one card has a multi-line title and another has a single line, the following elements will misalign, resulting in an inconsistent UI.&lt;/p&gt;</description></item><item><title>Smooth Page Transitions with View Transitions API</title><link>https://takao.blog/en/web/css-view-transitions-single-page-api/</link><pubDate>Sat, 05 Apr 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-view-transitions-single-page-api/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Smooth Page Transitions with View Transitions API" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Providing dynamic page transitions is a key factor in elevating the overall user experience (UX) of modern web applications.&lt;/p&gt;
&lt;p&gt;Historically, to morph or fade elements smoothly between page navigations, developers had to import heavy JavaScript libraries like Framer Motion or GSAP. These libraries require deep hooks into rendering lifecycles to delay unmounting while animating old DOM nodes.&lt;/p&gt;
&lt;p&gt;The introduction of the W3C standard &lt;strong&gt;View Transitions API&lt;/strong&gt; simplifies this. It allows browsers to natively capture states and interpolate page layout updates with minimal CSS and JavaScript.&lt;/p&gt;</description></item><item><title>Introduction to CSS Anchor Positioning and Examples</title><link>https://takao.blog/en/web/css-anchor-positioning-guide/</link><pubDate>Mon, 10 Feb 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-anchor-positioning-guide/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Introduction to CSS Anchor Positioning and Examples" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;In web development, positioning floating elements—such as tooltips, popovers, dropdown menus, and hover cards—relative to a specific reference element (the anchor) has historically been a complex challenge.&lt;/p&gt;
&lt;p&gt;To make floating elements follow anchor points on window resizing or page scrolling, developers traditionally relied on continuous JavaScript coordinate calculations (using &lt;code&gt;getBoundingClientRect()&lt;/code&gt;) to dynamically alter inline styles. Libraries like Popper.js or Floating UI became industry standards for this reason. However, executing script loops on the main thread during scroll events frequently caused rendering lag and jank, especially on mobile devices.&lt;/p&gt;</description></item><item><title>CSS Scoped Styles: @scope and Encapsulation Strategies</title><link>https://takao.blog/en/web/css-scoped-styles/</link><pubDate>Sun, 15 Dec 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-scoped-styles/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Scoped Styles: @scope and Encapsulation Strategies" /&gt;&lt;p&gt;CSS scoping has always been a challenge. Styles cascade globally by default, meaning a selector in one component can unintentionally affect elements in another. Over the years, developers have adopted naming conventions, build-time tools, and full DOM isolation to solve this. The newest addition to this toolkit is the CSS &lt;code&gt;@scope&lt;/code&gt; at-rule, which introduces proximity-based cascade control. This article compares all major scoping strategies and helps you choose the right one.&lt;/p&gt;</description></item><item><title>CSS Trigonometric Functions: Math in Your Stylesheets</title><link>https://takao.blog/en/web/css-trig-functions/</link><pubDate>Tue, 05 Nov 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-trig-functions/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Trigonometric Functions: Math in Your Stylesheets" /&gt;&lt;p&gt;CSS has evolved from a simple styling language into a powerful computation engine. The introduction of trigonometric functions in CSS Values and Units Module Level 4 &amp;ndash; shipping in Chrome 111+, Firefox 108+, and Safari 15.4+ &amp;ndash; marks a paradigm shift. Developers can now perform geometric calculations directly in stylesheets without preprocessors or JavaScript.&lt;/p&gt;
&lt;h2 id="function-reference-and-syntax"&gt;Function Reference and Syntax
&lt;/h2&gt;&lt;p&gt;Six trigonometric functions are now available in CSS:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Function&lt;/th&gt;
					&lt;th&gt;Input&lt;/th&gt;
					&lt;th&gt;Output&lt;/th&gt;
					&lt;th&gt;Description&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sin(angle)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;angle&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; [-1, 1]&lt;/td&gt;
					&lt;td&gt;Sine of an angle&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;cos(angle)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;angle&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; [-1, 1]&lt;/td&gt;
					&lt;td&gt;Cosine of an angle&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;tan(angle)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;angle&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Tangent of an angle&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;atan2(y, x)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Arctangent of y/x (full 360°)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;asin(value)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; [-1, 1]&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Arcsine&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;acos(value)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; [-1, 1]&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Arccosine&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Angle units include &lt;code&gt;deg&lt;/code&gt;, &lt;code&gt;rad&lt;/code&gt;, &lt;code&gt;grad&lt;/code&gt;, and &lt;code&gt;turn&lt;/code&gt;. Common pitfalls include forgetting units, division by zero in &lt;code&gt;atan2&lt;/code&gt;, and domain errors with &lt;code&gt;asin&lt;/code&gt;/&lt;code&gt;acos&lt;/code&gt; inputs outside [-1, 1].&lt;/p&gt;</description></item><item><title>CSS Popover API: Native Overlays Without JavaScript</title><link>https://takao.blog/en/web/css-popover-api/</link><pubDate>Tue, 20 Aug 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-popover-api/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Popover API: Native Overlays Without JavaScript" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;Building overlays like tooltips, dropdown menus, and modals has traditionally required a significant amount of JavaScript. Developers have relied on CSS &lt;code&gt;position: absolute&lt;/code&gt; with manual coordinate calculations, ARIA attributes for accessibility, and framework-specific solutions such as React portals or Floating UI. The CSS Popover API changes this by providing a native, declarative way to create overlays that handle positioning, show/hide toggling, focus management, and light dismiss without any JavaScript.&lt;/p&gt;</description></item><item><title>CSS Scroll-Driven Animations: The Future of Scroll-Based Effects</title><link>https://takao.blog/en/web/css-scroll-driven-animations/</link><pubDate>Tue, 25 Jun 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-scroll-driven-animations/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Scroll-Driven Animations: The Future of Scroll-Based Effects" /&gt;&lt;h2 id="the-problem-with-javascript-scroll-events"&gt;The Problem with JavaScript Scroll Events
&lt;/h2&gt;&lt;p&gt;Scroll-based effects have traditionally relied on JavaScript scroll event listeners running on the main thread, which often causes jank, dropped frames, and poor user experience. Even with passive listeners and &lt;code&gt;requestAnimationFrame&lt;/code&gt; throttling, layout thrashing remains a persistent issue. CSS Scroll-Driven Animations solve this by moving scroll tracking to the compositor thread, enabling smooth 60fps effects without any JavaScript overhead.&lt;/p&gt;
&lt;h2 id="key-concepts"&gt;Key Concepts
&lt;/h2&gt;&lt;p&gt;Three core concepts power this feature. A &lt;strong&gt;scroll-timeline&lt;/strong&gt; links an animation to the scroll position of a scroll container. A &lt;strong&gt;view-timeline&lt;/strong&gt; ties an animation to an element&amp;rsquo;s visibility within a scroll container. The &lt;strong&gt;animation-timeline&lt;/strong&gt; property binds a named animation to either timeline type. Use &lt;code&gt;timeline-scope&lt;/code&gt; to share timelines across elements in the DOM tree.&lt;/p&gt;</description></item><item><title>CSS @layer: Managing Cascade with Layer Architecture</title><link>https://takao.blog/en/web/css-layer-architecture/</link><pubDate>Tue, 11 Jun 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-layer-architecture/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS @layer: Managing Cascade with Layer Architecture" /&gt;&lt;p&gt;If you have ever battled specificity wars in a large CSS project — overriding third-party styles, sprinkling &lt;code&gt;!important&lt;/code&gt; declarations, or restructuring HTML just to win the cascade — &lt;code&gt;@layer&lt;/code&gt; is the solution you have been waiting for. The CSS &lt;code&gt;@layer&lt;/code&gt; at-rule gives developers explicit control over the cascade order, independent of specificity or source order.&lt;/p&gt;
&lt;h2 id="the-cascade-problem-before-layer"&gt;The Cascade Problem Before @layer
&lt;/h2&gt;&lt;p&gt;Before &lt;code&gt;@layer&lt;/code&gt;, cascade management relied entirely on conventions: BEM naming, SMACSS categories, ITCSS architecture. These conventions worked, but they were not enforced by the browser. Third-party CSS could override carefully crafted component styles, and source-order fragility meant that a single &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag reorder could break an entire design system.&lt;/p&gt;</description></item><item><title>CSS Custom Properties: Strategic Patterns for Scalable Styles</title><link>https://takao.blog/en/web/css-custom-properties/</link><pubDate>Tue, 09 Apr 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-custom-properties/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Custom Properties: Strategic Patterns for Scalable Styles" /&gt;&lt;p&gt;CSS Custom Properties (also known as CSS variables) have fundamentally changed how we write and maintain stylesheets. Unlike preprocessor variables from Sass or Less, custom properties are live, dynamic, and participate in the cascade and inheritance. This article explores strategic patterns for using them in production applications — from design token management to runtime manipulation.&lt;/p&gt;
&lt;h2 id="design-token-management"&gt;Design Token Management
&lt;/h2&gt;&lt;p&gt;Custom properties are the ideal vehicle for design tokens — the atomic values that define a design system&amp;rsquo;s visual language. A well-organized token structure groups colors, spacing, typography, and shadows under a clear naming convention.&lt;/p&gt;</description></item><item><title>CSS Grid Advanced Patterns: Complex Layouts Made Simple</title><link>https://takao.blog/en/web/css-grid-advanced/</link><pubDate>Fri, 15 Dec 2023 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/css-grid-advanced/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post CSS Grid Advanced Patterns: Complex Layouts Made Simple" /&gt;&lt;p&gt;CSS Grid has transformed web layout design, but many developers only scratch the surface. Beyond the basic &lt;code&gt;grid-template-columns: 1fr 1fr 1fr&lt;/code&gt; lies a powerful set of features that handle complex, responsive layouts with minimal code. This article explores advanced Grid patterns that every professional front-end developer should know.&lt;/p&gt;
&lt;h2 id="named-grid-areas-for-semantic-layouts"&gt;Named Grid Areas for Semantic Layouts
&lt;/h2&gt;&lt;p&gt;Line-based placement works, but it becomes unreadable as layouts grow complex. Named grid areas let you define layouts that read like a wireframe directly in CSS.&lt;/p&gt;</description></item></channel></rss>