Skip to content
Sign inJoin waitlist

Design — Balancee HTML

Balancee’s HTML pages are styled with Tailwind CSS classes and a few colour, font and breakpoint tokens; a new colour or font needs a CSS rebuild.

The pages are styled with Tailwind CSS classes written in the HTML (class="flex flex-col gap-2.5 text-grey"). assets/css/style.css contains exactly the classes the pages use, generated from src/css/style.css.

That means two kinds of change:

Change Rebuild the stylesheet?
Move, copy or delete elements; use classes that already appear somewhere in the site No
Change a colour, a font, a breakpoint; use a class that appears nowhere yet (say mt-7) Yes

Once, install the tools (needs Node.js 20 or newer):

Terminal window
npm install

Then, after a change:

Terminal window
npm run build:css # one build
npm run watch:css # rebuilds on every save while you work

Both write assets/css/style.css. The build scans the .html files in the root folder and one folder down (service/, portfolio/, blog/, legal/), and assets/js/main.js, so a class you add there is picked up. Upload the new style.css with your pages.

In src/css/style.css:

@theme {
--color-ink: #121512; /* headings, the dark buttons, the active menu pill, the dark sections */
--color-text: #222222; /* the menu's links */
--color-grey: #5a5a5a; /* secondary text, meta */
--color-line: #e5e5e5; /* dividers, light fills */
--color-soft: #f5f5f5; /* the clients section, the blog cards, field fills */
--color-white: #ffffff; /* the page, text over dark */
--color-black: #000000; /* the footer */
--color-error: #d92d20; /* a form field that failed its check */
--color-danger: #ff2244; /* the Submit button when sending failed (a 15 % fill with this label) */
--color-field-line: rgb(136 136 136 / 0.1); /* the hairline of a form field */
--color-focus: #0099ff; /* the hairline of a focused text field */
--color-placeholder: rgb(47 47 47 / 0.5); /* a field's placeholder */
--color-dim: rgb(47 47 47 / 0.5); /* the year pills of the About timeline on black */
}

Each name becomes a class (bg-ink, text-grey, border-line). Change the values, rebuild, and the pages follow. The palette is Ink on White with Soft grey panels: keep text on its background at 4.5 : 1 or more, so it stays readable.

Colours that sit outside the tokens:

Colour Where
White and Black with an opacity (bg-white/30, placeholder:text-white/80, bg-black/80) The newsletter field, the veil over the Home hero’s video
The “B” icon’s Ink #121512 and White icon-light.svg, icon-dark.svg
The wordmark as files (logo.svg in #121512, logo-white.svg) assets/images/ (the pages write the wordmark as text; these are for use elsewhere)
The swatches of the style guide repeat the values as text style-guide.html

The wordmark is the word “Balancee” set in Inter semibold with a little letter spacing (font-semibold tracking-[0.04em]), not a picture. It is written in every page: twice in the header (a 30.3 px version from tablets up and a 24.2 px version on phones), once in the footer (36.2 px) and once, large, over the video in index.html. Each is a <span aria-hidden="true"> inside a link whose aria-label="Balancee" carries the name for screen readers. To change the name, replace the text in those spans (find and replace in files does every page: search for >Balancee</span) and the aria-label.

To use a logo of your own, replace the <span …>Balancee</span> in the header and the footer with an <img> or an inline <svg>, giving it the same height (h-[25px] and h-5 in the header, h-[30px] in the footer); keep the link and its aria-label. The wordmark’s width is set with its height (w-[139px], w-[111px], w-[166px]): change it to your artwork’s ratio.

icon-light.svg (white “B” on Ink) and icon-dark.svg (Ink “B” on white), both 64 × 64, are the icons in the browser tab, for light and dark browser themes; apple-icon.png (180 × 180) is the icon on a phone’s home screen. Replace the files, keeping the names.

The interface icons are inline SVG from Phosphor: the arrow of the buttons, the stars of the rating, the phone and the envelope of the footer, drawn on a 256 × 256 grid in the current text colour. To use another icon, open it on phosphoricons.com, copy its <path d="…"> and paste it in place of the old one. The “+” boxes of the case study rows are drawn with <span> bars in HTML. The LinkedIn icon is an image file in assets/images/ (icon-linkedin.svg); the other social links are text.

Inter ships in assets/fonts/ as one variable file, inter-variable.woff2 (weights 100 to 900, upright only), declared at the top of src/css/style.css:

@font-face{font-family:"Inter"; src:url("../fonts/inter-variable.woff2") format("woff2"); font-display:swap; unicode-range:…; font-weight:100 900; font-style:normal; }
:root{--font-inter:Inter,"Inter Fallback",sans-serif; }

Every page uses it through font-sans on the <body>. Text is set in weight 400, the headings, the buttons and the menu’s labels in 500, the wordmark in 600.

To use another font:

  1. Put its .woff2 files in assets/fonts/.
  2. Change the @font-face rule (font-family and src) and the first name in --font-inter. A font that isn’t variable needs one @font-face rule per weight file (400, 500 and 600).
  3. Rebuild the stylesheet.

The Inter Fallback rule sizes Arial like Inter while the font loads (so the page doesn’t jump when the font arrives); with another font, you can delete it and its name in --font-inter. The font file covers Western European languages (the rule’s unicode-range); for other alphabets, use files that include them and remove the unicode-range. Fonts from Google Fonts can be downloaded as files with https://gwfh.mranftl.com, so they are served from your own domain, which is faster and needs no consent banner.

Text sizes are classes with a phone value first and the tablet (md:) and desktop (lg:) values after: text-[30px] md:text-[36px] lg:text-[48px]. The style guide lists every text style:

Style Phone Tablet Desktop Used for
Heading 1 32 48 52 The page titles
Heading 2 30 36 48 Section titles
Heading 3 28 32 36 The headings in a post’s text, the figures
Heading 4 24 26 28 Card titles
Heading 5 20 22 24 Row titles, the clients’ title
Heading 6 18 19 20 Service names, the footer’s titles
Paragraph 16 16 16 Leads, descriptions, a post’s text, buttons (weight 500)
Small 14 14 14 Labels, meta
Tiny 12 12 12 The legal line under the form, tags
Eyebrow 13 13 13 The small upper-case labels over section titles (“WHAT WE OFFER”)

Headings have a line height of 1.2 and weight 500; paragraph, small and tiny 1.4.

Spacing uses Tailwind’s scale (4 px per step, so gap-5 is 20 px) or exact values in brackets (gap-[50px]). Content is at most 1440 px wide (max-w-[1440px]), with 15, 20 and 30 px at the sides; most sections have 60 / 80 / 100 px above and below. Corners are 10 px on cards and photos, 4 px on buttons’ fields and the form’s controls, and round on pills, avatars and the “+” boxes. There are no drop shadows.

Width Prefix
Phone below 810 px (none)
Tablet 810–1199 px md:
Desktop 1200 px and up lg:

max-md: and max-lg: apply below those widths.

style-guide.html shows the colours and text styles, the wordmark, the menu links and breadcrumbs, a page title, the service and step cards, the case study accordion, the testimonials with the video player, the figures, the timeline, the team cards, the client logo ticker, the forms with their button’s states, the newsletter box and the footer, each with its name. To reuse one, copy its markup from there or from the page that shows it.

Elements with data-… attributes are wired to the site script, so keep those attributes when you copy them: data-header, data-hamburger, data-close-menu, data-collapse, data-case-accordion, data-case-row, data-case-header, data-case-toggle, data-case-title, data-case-rule, data-plus-minus, data-form, data-field, data-field-error, data-submit, data-form-status, data-newsletter, data-newsletter-button, data-newsletter-status, data-load-on-scroll, data-load-item, data-load-spinner, data-logo-slides, data-logo-track, data-logo-step, data-video-player, data-video, data-video-play, data-current-year, …

Balancee’s motion is small: hovers, the menu, the rows, the loading spinner and the videos. There are no scroll effects and no load animations. A few settings are written in the HTML:

Effect Where
Buttons and links: the label rolls up to a second copy while the first blurs, and the arrow turns 45° group on the button, group-hover: classes on its parts, duration-200 ease-linear
The header’s links: a line grows under the link group-hover:w-full on a bar under the label, duration-400
Cards: the photo zooms; arrows move group-hover: classes with ease-spring or ease-card (--ease-card and --ease-spring in src/css/style.css)
The phone menu, the case study rows open with their height; the “+” turns into a minus data-collapse, data-case-accordion and data-hamburger (the script)
The client logos run in a loop that pauses on hover animate-marquee (78 s, --animate-marquee in src/css/style.css)
The loading ring turns animate-turn (--animate-turn, 1 s)

The springs of the script (a 0.4 s spring with no bounce) are at the top of assets/js/main.js (search for tokens/motion.ts).

With “reduce motion” switched on in the visitor’s system, the logo ticker and the loading ring stand still, the looping and the on-screen videos stay on their poster, and the script’s moves and size changes (the phone menu and the rows opening, the menu button’s lines) jump instead of gliding. Fades and colour changes stay.