🎨CSS & Modern Layout Master Reference

CSS Flexbox, Grid, Color Spaces & Specificity Sheet

A definitive reference for frontend engineers and web designers detailing CSS Flexbox and Grid layout properties, modern perceptually uniform color spaces (OKLCH), responsive media query breakpoints, and selector specificity calculations.

📅 Last Reviewed: 2026-11-07•📊 4 Reference Tables•📐 3 Core Formulas•Browse all CSS & Design Tools →

📐Core Mathematical & Algorithmic Formulas

Essential reference equations governing calculations in this domain.

CSS Specificity Calculation Formula

\text{Specificity} = (\text{Inline}, \text{IDs}, \text{Classes/Attrs/Pseudos}, \text{Elements/Pseudos})

Represented as a 4-part tuple (e.g. 0,1,2,1). Higher columns always override lower columns regardless of count.

REM to Pixel Conversion

\text{Pixels (px)} = \text{REM Value} \times \text{Root Font Size (Default 16px)}

Default 1rem equals 16px in all modern browsers unless changed on :root { font-size: ... }.

Fluid Typography clamp() Formula

\text{font-size} = \text{clamp}(\text{MIN},\ \text{VAL},\ \text{MAX})

Keeps font size fluidly responsive between min and max bounds without breakpoint jumps.

CSS Flexbox Layout Properties Reference

Complete container and item flexbox layout rules.

PropertyApplies ToCommon ValuesLayout Behavior Summary
display: flex | inline-flexContainerflex, inline-flexActivates flexbox context for all immediate direct children.
flex-directionContainerrow, row-reverse, column, column-reverseEstablishes main axis along which flex items are placed.
justify-contentContainerflex-start, center, flex-end, space-between, space-around, space-evenlyDistributes free space along the MAIN axis.
align-itemsContainerstretch, flex-start, center, flex-end, baselineControls item alignment across the CROSS axis.
flex-wrapContainernowrap, wrap, wrap-reverseControls whether items are forced into single line or can wrap.
gap / row-gap / column-gapContainer1rem, 16px, 1.5vwCreates gutter space strictly between flex items (no outer margin).
flex-growItem0 (default), 1, 2, ...Proportional ability for item to expand to fill remaining space.
flex-shrinkItem1 (default), 0 (prevents shrink)Ability for item to shrink when container space is constricted.
flex-basisItemauto, 0, 250px, 30%Default initial size before remaining space is distributed.
9 reference recordsCitation: CSS Flexbox, Grid, Color Spaces & Specificity Sheet • VeriToolkit

CSS Grid Layout Properties Reference

Two-dimensional grid layout container and track placement properties.

PropertyApplies ToSyntax ExampleDescription & Layout Impact
grid-template-columnsContainerrepeat(3, 1fr) / repeat(auto-fit, minmax(280px, 1fr))Defines column tracks using fixed, percentage, or fractional (fr) units.
grid-template-rowsContainerauto 1fr autoDefines row tracks (e.g. Header, Main Content, Footer layout).
grid-auto-flowContainerrow, column, denseControls automatic placement algorithm for items not explicitly positioned.
gapContainer1.5rem / 24pxSets horizontal and vertical grid gutters simultaneously.
grid-columnItemspan 2 / 1 / -1Shorthand for grid-column-start and grid-column-end.
grid-rowItemspan 3 / 2 / 4Shorthand for grid-row-start and grid-row-end.
6 reference recordsCitation: CSS Flexbox, Grid, Color Spaces & Specificity Sheet • VeriToolkit

Modern CSS Color Spaces Comparison

sRGB vs modern wide-gamut (Display P3) color models.

Color ModelSyntax ExampleGamut RangePerceptual UniformityModern Use Recommendation
OKLCHoklch(0.7 0.15 150)Wide Gamut (P3+)Excellent (Perceptually Uniform)Recommended for modern web palettes; predictable contrast.
HSLhsl(210 100% 50%)Standard sRGBPoor (Yellow appears brighter than blue at 50% L)Legacy familiar model, but lighting transitions are uneven.
Hexadecimal#3b82f6 / #3b82f6ccStandard sRGBNoneStandard compact code notation; poor for procedural color math.
RGB / RGBArgb(59 130 246 / 0.8)Standard sRGBNoneUniversal support; raw channel values.
Display P3color(display-p3 1 0 0)Wide Gamut (+50% colors)ModerateHigh-end displays (Apple, modern OLED) for ultra-vivid tones.
5 reference recordsCitation: CSS Flexbox, Grid, Color Spaces & Specificity Sheet • VeriToolkit

Standard Responsive Screen Breakpoints

Industry standard media query breakpoints across modern viewports.

BreakpointMin WidthTarget Device ClassesDesign Focus
sm640pxLarge smartphones (landscape), small phabletsExpanded single-column layout, compact cards
md768pxStandard tablets (portrait), iPad MiniTwo-column grids, collapsible sidebars, tablet nav
lg1024pxSmall laptops, iPad Pro (landscape), desktopFull desktop layout, sidebars visible, 3-column grids
xl1280pxStandard desktop monitors, MacBook ProMax container max-w-7xl, generous padding & gutters
2xl1536pxLarge widescreen monitors & 4K displaysUltra-wide viewing, 4-column cards, multi-column dashboard
5 reference recordsCitation: CSS Flexbox, Grid, Color Spaces & Specificity Sheet • VeriToolkit
⚡Wave-Safe Launchpad

Interactive CSS Flexbox, Grid, Color Spaces Tools

Interactive calculators and converters for this suite are being activated in upcoming rollout waves.

⏳

More tools in this suite launching soon

All 100 tools in this category have passed strict client-side verification and are scheduled for progressive rollout across upcoming waves.

Explore Currently Live Flagship Tools→

❓Frequently Asked Questions & Domain Insights

Clear technical and regulatory explanations regarding these parameters and formulas.

HSL has severe perceptual flaws: a pure yellow at lightness 50% looks blindingly bright, while a pure blue at lightness 50% looks dark. OKLCH fixes this with true perceptual uniformity: two colors with the same Lightness (L) in OKLCH have the exact same perceived brightness to human eyes, making accessible WCAG contrast calculation reliable across all hues.