Component Naming Conventions in React
6 min readIn the Browser
Three naming conventions for components that clash with your UI library — wrapping, naming by purpose, and prefixes — with the tradeoffs of each.
Category
JavaScript, CSS, HTML and DOM tutorials covering what really happens once your code reaches the browser, explained with practical examples.
6 min readIn the Browser
Three naming conventions for components that clash with your UI library — wrapping, naming by purpose, and prefixes — with the tradeoffs of each.
5 min readIn the Browser
Lay a gradient or solid tint over an image using a ::before pseudo-element. Four copy-ready overlays with before-and-after photos.
4 min readIn the Browser
Slice a photo into a nine-patch grid and wrap it around a box. What one, two, three and four border-image-slice values each do.
11 min readIn the Browser
Turn a plain border into a gradient with border-image and border-image-slice. Linear, radial and conic examples, no image files needed.
5 min readIn the Browser
Crop an element by pushing its sides in with clip-path: inset(). What one, two, three and four values do, plus the round keyword.
5 min readIn the Browser
Copy-ready clip-path: polygon() code for triangles — right, isosceles, acute and obtuse — all built by moving one corner of a square.
5 min readIn the Browser
Copy-ready clip-path: polygon() code for direction signs, arrows and pointers in all four directions, with a diagram for every shape.
4 min readIn the Browser
Copy-ready clip-path: polygon() code for pentagons, hexagons, heptagons, octagons, nonagons and decagons, with diagrams for each.
8 min readIn the Browser
Crop any element to a circle with clip-path: circle(). Radius, positioning with at, and how to isolate one face in a group photo.
6 min readIn the Browser
Spin a card forever with animation plus @keyframes — around X, around Y or both — and the rotation value that makes it snap back.
5 min readIn the Browser
Flip a card on hover with transform: rotateY() and a transition — around X, around Y or both, and how to make it flip back on hover-out.
2 min readIn the Browser
The HTML blink tag is obsolete and no longer works in any browser. Here is the CSS animation that recreates blinking text, ready to copy and paste.
3 min readIn the Browser
Five worked text-shadow examples — positive and negative offsets, stacked colors, and the blur value that ruins readability.
7 min readIn the Browser
Bend a line of text into a circle with one span per letter, absolute positioning and transform: rotate(). Full copy-ready coordinates.
2 min readIn the Browser
Style many elements at once with a single CSS class, then name it so it still makes sense in six months. With do and don't examples.
8 min readIn the Browser
Build a round push-button in CSS: inset shadows for the base, a gradient face, hover and active states, and a soft shadow underneath.
3 min readIn the Browser
The inset keyword draws a shadow inside the element instead of around it. Here is how to build a soft pressed-in effect with two shadows.
2 min readIn the Browser
What each box-shadow value actually does — offset, blur, spread and color — built up step by step on one simple box you can copy.
7 min readIn the Browser
Sit a glossy CSS water drop on top of a heading using border-radius, layered box-shadows and two pseudo-element highlights.
5 min readIn the Browser
Build a glowing neon sign with nothing but layered box-shadow and text-shadow — outer glow, inset glow and a matching text halo.
10 min readIn the Browser
Apply filter: grayscale() to text, backgrounds, photos, SVG, Font Awesome icons and emoji — with a before-and-after for every case.
12 min readIn the Browser
Sweep colors around a point with conic-gradient. Move the center, set the start angle, add color stops and build pie-chart style wedges.
5 min readIn the Browser
Draw a water drop in pure CSS: an uneven border-radius, four stacked box-shadows for volume, and two pseudo-elements for the highlights.
7 min readIn the Browser
Build a folded paper corner with clip-path and a ::before pseudo-element — no images, and a drop-shadow trick that clipped boxes allow.
9 min readIn the Browser
Build a @keyframes animation one layer at a time — color, shape, position, rotation and delay — on a single box, with the shorthand at the end.
5 min readIn the Browser
:last-child targets the final element inside its parent. Worked examples on lists and paragraphs, plus the :nth-last-child(1) equivalent.
4 min readIn the Browser
What the HTML span tag is for, how it differs from div, and how to style a single word — or a single letter — without breaking the line.
4 min readIn the Browser
Use filter: opacity() to fade an image into its background and filter: saturate() to dial its colors up or down. Side-by-side examples.
5 min readIn the Browser
Control light and dark in an image with filter: contrast() and filter: brightness(). What each percentage does, with side-by-side photos.
3 min readIn the Browser
How the CSS opacity property works from 0 to 1, how to fade it smoothly on hover, and why a parent background tints its children.
2 min readIn the Browser
word-spacing controls the gap between words. Three headings compared — normal, widened and negative — and the values worth avoiding.
2 min readIn the Browser
:nth-child() counts every sibling; :nth-of-type() counts only elements of that tag. The same markup styled both ways, side by side.
3 min readIn the Browser
Mirror any element with a single declaration: -webkit-box-reflect. Direction, distance, and a linear-gradient fade-out, with examples.
6 min readIn the Browser
CSS custom properties from scratch: declaring them in :root, global vs local scope, combining them, and how var() fallbacks really work.
4 min readIn the Browser
Ordered, unordered and description lists in HTML — nesting them, swapping the marker for an image or emoji, and going horizontal.
2 min readIn the Browser
Property names and keyword values in CSS are case-insensitive, so GREEN and green are the same. Class and id names are not — here is why.
2 min readIn the Browser
letter-spacing sets the gap between characters. Three headings compared side by side, plus the negative value that ruins legibility.
3 min readIn the Browser
:nth-of-type() counts elements by tag, not by position among siblings. Target one, target all with (n), or target several types at once.
4 min readIn the Browser
box-shadow follows an element's rectangle. filter: drop-shadow() follows its real shape. See both side by side on a CSS bee you can copy.
3 min readIn the Browser
Give photos an aged, brownish look with filter: sepia(). Worked example, before-and-after images, and how to stack it with grayscale.
2 min readIn the Browser
Turn a photo black and white with the CSS filter: grayscale() property. A short worked example comparing the original, 50% and 100%.
5 min readIn the Browser
Build a pair of blinking cartoon eyes in pure CSS — an eyelid pseudo-element animated by a @keyframes rule with a natural double blink.
3 min readIn the Browser
backdrop-filter: grayscale() desaturates what is behind an element, leaving its own content untouched. Worked example plus a value table.
2 min readIn the Browser
How line-height sets the space above and below a line of text, what normal actually resolves to, and why negative values are ignored.
12 min readIn the Browser
Every :nth-child() pattern worked out on the same seven elements — odd, even, 3n, n+3, -n+3, ranges and counting backwards.
5 min readIn the Browser
Build a frosted-glass panel with backdrop-filter: blur(), step by step — including the overflow: hidden fix for a blur that bleeds out.
6 min readIn the Browser
Build a transparent button in HTML and CSS: shadows instead of a background, plus hover and active states that swap the label text.
6 min readIn the Browser
Mirror a heading under itself using a ::before pseudo-element, rotate(180deg) scaleX(-1), and a gradient clipped to the text.
5 min readIn the Browser
Control linear-gradient direction with keywords or degrees, then use percentage color stops for soft blends or hard-edged stripes.
11 min readIn the Browser
Sweep a glossy highlight across an element: a skewed ::before pseudo-element, overflow: hidden, and a two-stop @keyframes animation.
6 min readIn the Browser
:first-child in CSS with five worked examples — lists, paragraphs, multiple parents, and :not(:first-child) — each with the Sass form.
9 min readIn the Browser
The Javascript array methods you’ll actually use — map, filter, reduce, find, some, every, slice, splice and more — each with a short, clear example.
11 min readIn the Browser
Build a two-sided card that flips on hover with transform-style: preserve-3d and backface-visibility: hidden — on the X or the Y axis.
3 min readIn the Browser
Make rainbow text in CSS with a linear-gradient, background-clip: text and color: transparent — three declarations, shown step by step.
5 min readIn the Browser
Content, border, padding and margin explained with one worked example — including how to add up an element's real width and height.
4 min readIn the Browser
!important overrides every other declaration for a property. Where the flag goes, a worked id/class/type example, and why to avoid it.
3 min readIn the Browser
Fill text with black and white stripes using a linear-gradient, background-clip: text and color: transparent. Three stripe directions.
4 min readIn the Browser
Build a mirror-like reflection under any block with a ::before pseudo-element, a fading linear-gradient and a touch of opacity.
6 min readIn the Browser
Blend colors outward from a point with radial-gradient. Circle vs ellipse, moving the center to a side or corner, and target-like rings.
12 min readIn the Browser
Grow or shrink an element on hover with transform: scale(). Eight examples covering both axes, scaleX and scaleY, plus a transition.
5 min readIn the Browser
Layer a gradient fill, a colored outline and a drop shadow onto the same heading, one declaration at a time, with a screenshot per step.
2 min readIn the Browser
Outline text and hollow out the middle with -webkit-text-stroke plus color: transparent. Step-by-step, with the split width/color form.
9 min readIn the Browser
Border style, width, color, the shorthand and border-radius, with worked examples for single sides, mixed sides and curved corners.
6 min readIn the Browser
Underline, overline and line-through in CSS: the line, style, color and thickness properties, how to mix them, and the shorthand.
4 min readIn the Browser
Why a 300px box ends up 350px wide, and how box-sizing: border-box fixes it. Both models compared with the maths written out.
8 min readIn the Browser
Four ways to centre an element in CSS — flexbox, grid, place-items and absolute positioning — compared on the same box, plus what to avoid.
7 min readIn the Browser
CSS color names, HEX, RGB and HSL side by side — what each value means and how to add an alpha channel to every one of them.
6 min readIn the Browser
Every CSS selector a beginner needs: universal, class, id, type, the four combinators, and the ::before, ::after and :hover pseudo-classes.
1 min readIn the Browser
Every CSS rule has four parts: selector, declaration block, property and value. Here is what each one is called and where it goes.
4 min readIn the Browser
Format text with HTML alone — b, strong, i, em, u, del, mark, sub and sup — plus when to reach for strong over b, with br and hr.
11 min readIn the Browser
A working reference for the HTML elements you actually use — head tags, body tags, lists, tables and images — with a snippet for each.