Izmir Customisation: Borders, Captions and CSS Properties

An Izmir card has several independent parts: the photograph, the border, the overlay and the caption. Style them separately. That makes a deliberate composition easier to build and a broken one easier to diagnose.

This reference extends the installation guide and the working examples. Class names and properties below were checked against the preserved Izmir stylesheet and its original documentation. The library is Ciaran Walsh’s work; this is an independent guide to using it.

Put the class on the element it controls

Start with c4-izmir on the figure. Border, image and gradient classes belong there too. Caption-position classes belong on figcaption. Text animations and their delays belong on the individual caption item or its wrapper. Moving every class to the outer figure loses those distinctions.

<figure class="c4-izmir c4-border-corners-1
               c4-image-zoom-in c4-gradient-bottom"
        tabindex="0">
  <img src="workshop.webp" width="800" height="600"
       alt="A workbench with timber samples and drawings">
  <figcaption class="c4-layout-bottom-left">
    <div class="c4-reveal-up">
      <h3>Inside the workshop</h3>
    </div>
    <div class="c4-fade-up c4-delay-200">
      <p>From the first sketch to a full-size prototype.</p>
    </div>
  </figcaption>
</figure>

The example is a focusable demonstration, not a navigation control. If the card should open a project, provide an actual link with a clear destination. Keep the essential project name available without discovering an animation.

Border: decide what deserves emphasis

The border family includes c4-border-center, c4-border-vert, c4-border-horiz, directional edges such as c4-border-bottom, corner combinations and c4-border-fade. Try one border style at a time. Several competing border classes on the same figure make the result dependent on stylesheet order.

A corner treatment can frame a photograph without drawing a complete rectangle over it. A full border is more assertive. Compare the effect with the image at rest: if the frame cuts across a face, diagram label or product detail, changing the inset may help more than changing the animation.

Image: motion changes the crop

The image options are zoom in, zoom out, pan up/down/left/right, rotate left/right and blur, using the c4-image- prefix. They transform the image inside a clipped figure. A zoom or pan can therefore hide information even though the file itself has not changed.

Use a photograph with some space around its subject for a zoom treatment. For a screenshot whose edge contains an important button, a stationary image with an animated border is often clearer. Test the narrow card, not just the generous desktop version.

Caption motion: give the words a readable order

Izmir provides reveal and fade treatments in four directions, plus four rotating treatments. For example, c4-reveal-up moves a caption item into view; c4-fade-left combines a directional treatment with fading. Place the class on the text wrapper when its heading and paragraph should move together.

Delay is separate from duration

The actual stylesheet uses c4-delay-100 through c4-delay-1000 in steps of 100 milliseconds. The prefix matters: the abbreviated delay-200 in some old prose is not the selector in this file. A delay postpones the start; --transition-duration controls how long the transition takes.

In the example, the descriptive line starts 200 milliseconds after the heading. That is an illustrative choice, not a readability standard. Remove the delay if it makes users wait for information they need to choose a link.

Overlay and caption position

Gradient classes include top, bottom, left, right and the four corners, such as c4-gradient-bottom and c4-gradient-top-left. They use the primary and secondary colour properties. A gradient’s presence does not establish sufficient text contrast: inspect the lightest part of the real photograph behind the words.

Caption layout defaults to the centre. Add c4-layout-bottom-left, for example, to figcaption. The other named positions cover top-left, top-centre, top-right, centre-left, centre-right, bottom-centre and bottom-right. Their class names use center, even in British English text.

Custom properties: make a local adjustment

.project-card.c4-izmir {
  --primary-color: #172f46;
  --secondary-color: #315a72;
  --text-color: #ffffff;
  --image-opacity: .2;
  --padding: 1.25rem;
  --border-margin: 12px;
  --border-width: 2px;
  --border-color: #ffffff;
  --border-radius: 4px;
  --transition-duration: 300ms;
}

Add project-card to the figure and load the rule after the library. These are sample design values. Check the result with your own image and copy rather than treating the colour pair or opacity as an accessibility guarantee.

The preserved Izmir file uses --image-opacity. Its older sibling Turin documented --overlay-opacity; the similar names should not be swapped blindly. The Turin reference keeps those older conventions separate.

Check the state that a mouse demonstration misses

Test keyboard focus, a touch screen, the longest caption and a reduced-motion preference. Disabling transition duration alone still permits an instant change of crop; decide whether the transform itself should be removed. MDN explains how the reduced-motion media query exposes that preference.

Hover content also needs predictable behaviour. The W3C guidance on content shown by hover or focus explains dismissal, pointer access and persistence, with specific exceptions. An animation library does not assess the complete card against those requirements.

Finish by removing one treatment and comparing the two versions. If the quieter card communicates the project just as well, keep it. The useful result is a readable card with a working action, not the largest possible collection of effects.

Code and historical documentation

See the original repository and MIT licence, the preserved stylesheet and the archived delay documentation. The example above is newly written; it does not depend on the old remote demonstration images.