pixel
The CSS absolute length unit px, defined as 1/96 of an inch and roughly one dot on a standard-density screen.
In more detail
A CSS pixel is not always one physical dot: high-density screens use several physical pixels per CSS pixel, a ratio called the device pixel ratio. Design tools usually give sizes in pixels, and token pipelines convert them to rem for the web. The same word also means one dot of an image, which is what visual regression tests compare.
Example
In the browser: A CSS pixel is a reference size, not always one physical dot: on a phone with a dense screen one CSS pixel may cover several device pixels. The rendering pipeline ends by painting and compositing pixels.Related terms
- rem — A CSS length unit equal to the font size of the root html element, which is 16 pixels unless the user or page changes it.
- device pixel ratio — How many physical screen pixels are used for one CSS pixel, such as 2 on many high-density phone and laptop screens.
- 8-point grid — A spacing rule where every margin, padding and component size is a multiple of 8 pixels, with 4 pixels allowed for tight spots.
- paint — The rendering stage that records how to fill in each box's pixels: text, colours, borders, shadows and images.
- rasterization — Turning drawing instructions, such as draw this text in this font, into an actual grid of coloured pixels.
- viewport — The visible area of a web page in the browser window or device screen.
Taught in
- Design Tokens: W3C Specs, Global, Semantic & Component Tokens — Design Systems & Component Engineering
- Token Transformation: Style Dictionary & Multi-Platform Outputs — Design Systems & Component Engineering
- Typography & Spatial Grids: Modular Scales & Fluid Typography — Design Systems & Component Engineering
- Visual Regression Testing: Playwright & Snapshot Differencing — Design Systems & Component Engineering
- CSS Parsing, The CSSOM And The Render Tree — Frontend Architecture & Web Platform
- Layout, Reflow, Paint And GPU Compositing Layers — Frontend Architecture & Web Platform
- Modern Box Model, Box Sizing, Display Types And Flow Layout — Frontend Architecture & Web Platform