Skip to main content

28 docs tagged with "frontend"

View all tags

Box model — what "width" actually refers to

This chapter covers the CSS box model — the four regions of content, padding, border, and margin, and how box-sizing changes the interpretation of width. It walks through how far the background gets painted, when margin collapsing happens, and the idiom of applying border-box in a reset.

Composables — extracting logic into functions

Covers how to build composables that package state and logic for reuse. Explains the shape of return values and arguments, where to hand off cleanup of side effects, and the constraints on where they can be called, from how the implementation behaves.

Composables and server-side rendering — what breaks under SSR

Covers the ways composables break once placed in a setup that also renders on the server. Explains reading window at call time, side effects not confined to onMounted, and state in module scope leaking between requests, alongside the behaviour actually measured.

Core Web Vitals — narrowing causes from LCP / INP / CLS

This chapter covers the definitions and thresholds of the three Core Web Vitals (LCP, INP, CLS), and the procedure for narrowing down the cause from combinations of the readings. It explains why slow server responses are not the main cause of poor INP and how CLS worsens with unsized late-arriving content.

Declarative and imperative UI — deriving UI from state

This chapter contrasts declarative and imperative UI by writing the same screen both ways. It covers why declarative UI reduces the mismatch between state and rendering, where you still need to touch the DOM directly, and what price you pay for it.

Frontend

A hub for the domain that collects notes on frontend development, such as React, Vue, Tailwind CSS, shadcn/ui, and Base UI. It covers UI construction, styling, and component design.

Nuxt basics — directory conventions and server APIs

Covers the foundations of Nuxt 4. Confirms the directory conventions under app/, routing decided by file name, applying layouts, and the file-name conventions and method narrowing in server/api, all from actual behaviour.

Pinia — defining and splitting stores

Covers Pinia, which shares state across components. Measures the difference between option and setup stores, why storeToRefs becomes necessary, and the notification timing of $patch and $subscribe.

Reactivity — choosing between ref and reactive

Explains how a change to a value reaches the screen, starting from the difference between ref and reactive. Covers why reassignment loses reactivity, the conditions under which destructuring breaks, and what toRefs preserves.

Rendering patterns — CSR / SSR / SSG / ISR

This chapter organizes CSR, SSR, SSG, and ISR along a single axis — when and where the HTML gets built. It walks through each pattern's trade-offs in initial paint, freshness, SEO, and server load, and the procedure for choosing a pattern from requirements.

Selectors and cascade — combinators, pseudo-classes, and specificity

This chapter explains the kinds of CSS selectors, the difference between combinators, the distinction between pseudo-classes and pseudo-elements, and how to compute specificity. It covers the ordering between IDs and classes, the fact that the universal selector and combinators don't contribute to specificity, and what the cascade looks at beyond specificity.

Slots — letting the parent render part of a component

Covers slots, which insert the parent's markup inside a child component. Works through when the fallback appears, how to test whether a slot was passed, scoped slots that hand the child's data to the parent, and type declarations with defineSlots.

Teleport and Suspense — moving where things render, and waiting on async

Covers Teleport, which renders elements elsewhere in the DOM tree, and Suspense, which gathers what is shown until async work finishes into one place. Explains what is left behind at the original position, when the fallback appears, and why it does not come back on later renders, all from measured behaviour.

Transitions — declaring enter and leave animations

Covers the machinery for animating elements as they appear and disappear. Explains the order classes are applied in, how Vue decides an animation has ended, the condition for waiting on done in JavaScript hooks, and how list reordering is followed, all from measured behaviour.

Vue Guide

A guide that starts from the Composition API in Vue 3.5 and works through reactivity, component design, Vue Router, Pinia, and Nuxt 4 across 20 chapters. Written around script setup and TypeScript, it explains why each API ended up shaped the way it is.

Vue Router basics — mapping URLs to components

Covers route definitions that map URLs to components. Explains links and programmatic navigation, dynamic routes with parameters, nested routes that share a layout, and the current way to write lazy loading and code splitting, all from measured behaviour.