GuidePremium
Tokens, theming and the article layout in CoullWorks Blog for Laravel
Change colours, type and spacing through the --cw CSS variables, switch dark mode, and understand the article grid (rail 285, gap 60, body 672) that every front end shares.
Updated 16 November 2026Back to the package pageBuy
Every HTML front end (Blade with Tailwind or Bootstrap, Livewire and Inertia with React or Vue) is styled from one set of CSS custom properties, the --cw-* tokens, and one stylesheet, blog.css. Change a token and every page follows. You do not edit a view to re-colour the blog.
The files#
| File | What it is |
|---|---|
tokens.css | The only file with colour values, plus the type scale, spacing, radii, shadows, motion, breakpoints and the article measures. Light colours on :root, dark colours below them |
blog.css | The article grid, the rail, the cards, the listing, the blocks and the comments, all written from the tokens. It has no colour values of its own |
adapter-tailwind.css | Maps the tokens into your Tailwind 4 @theme so utilities such as bg-cw-accent resolve to var(--cw-accent) |
adapter-bootstrap.css | Lets Bootstrap's own --bs-* variables drive the tokens, so data-bs-theme="dark" works |
dist/blog-tailwind.css, dist/blog-bootstrap.css | The compiled stylesheets the default layout links: the view set's classes plus all four files above |
Publish the token file and blog.css with php artisan vendor:publish --tag=cwb-blade-tokens (to public/vendor/coullworks-blog/). Publish the adapters with --tag=cwb-blade-adapters. For Inertia the installer already puts the same files in resources/js/blog/styles.
Change a colour or a size#
- Run
php artisan vendor:publish --tag=cwb-blade-tokens. This writespublic/vendor/coullworks-blog/tokens.css. - Open that file and change the value you want, for example
--cw-accent: #BC3F0C;to your brand colour. - Reload the blog. When the compiled stylesheet is in use, the default layout links your published
tokens.cssafter it, so your values win. Whenblade.compiled_cssisfalse, the layout linkstokens.cssandblog.cssdirectly. - Change the dark value too: it is in the
@media (prefers-color-scheme: dark)block and the[data-theme="dark"]block of the same file. Edit both so automatic and forced dark mode agree.
Run vendor:publish again with --force only if you want to throw your edits away. After a package update, compare your file with the new one, because new tokens may have been added.

Every colour here (the pale grey ground, the dark text, the hairline borders of the contents box) comes from the tokens below, and every size from the type tokens.
Colour tokens#
| Token | Light | Dark | Used for |
|---|---|---|---|
--cw-ground | #F4F5F6 | #0E0E10 | The page background |
--cw-raised | #FFFFFF | #141417 | The header, footer and raised panels |
--cw-panel | #EAECEE | #1C1C21 | Quiet panels, hover fills, notices |
--cw-rule | #DADDE0 | #2B2B31 | Hairlines |
--cw-rule-strong | #7E868D | #6A6A72 | Input borders and stronger lines |
--cw-heading | #111417 | #F2F4F6 | Headings |
--cw-text | #1F2429 | #D5DADE | Body text |
--cw-muted | #5A636B | #9A9AA1 | Dates, captions, secondary text |
--cw-accent | #BC3F0C | #FF6A1F | Links and buttons |
--cw-accent-ink | #FFFFFF | #140800 | Text on an accent button |
--cw-focus | #BC3F0C | #FF6A1F | The keyboard focus ring |
--cw-good, --cw-warn, --cw-bad | #15703F, #8A5200, #B3261E | #4ADE80, #FBBF24, #F87171 | Success, warning and error text |
Type, spacing and shape tokens#
| Token | Default | Used for |
|---|---|---|
--cw-font-body, --cw-font-display, --cw-font-mono | system sans, the body font, system mono | Body, headings and code |
--cw-text-xs to --cw-text-3xl | 0.75rem, 0.875rem, 1rem, 1.125rem, 1.375rem, 1.75rem, 2.5rem | The general scale |
--cw-leading-body, --cw-leading-display | 1.75, 1.1 | Line heights |
--cw-text-reading | 1.0625rem (17px) | Article body text |
--cw-leading-reading | 1.7 | Article body line height |
--cw-font-reading | the body font | Set a serif here to change the article text without touching a view |
--cw-text-h1-article | clamp(2rem, 1rem + 3.2vw, 3.5rem) | The article title: 32px on a phone up to 56px |
--cw-weight-display | 700 | The weight of titles |
--cw-text-h2, --cw-weight-h2 | clamp(1.5rem, 1.25rem + 0.8vw, 2rem), 600 | Section headings in the text |
--cw-text-h3 | 1.25rem | Sub-headings |
--cw-text-dek | 1.25rem | The standfirst under the title |
--cw-flow | 1.125rem | The space between paragraphs |
--cw-space-1 to --cw-space-16 | 0.25rem to 4rem | Spacing |
--cw-radius-sm, -md, -lg, -full | 2px, 6px, 12px, 999px | Corner rounding |
--cw-shadow-sm, --cw-shadow-md | soft shadows | Cards and popovers |
--cw-duration-fast, --cw-duration-base, --cw-ease | 120ms, 200ms, ease-out | Motion. It is switched off for readers who ask for reduced motion |
--cw-bp-sm, -md, -lg, -xl | 640px, 768px, 1024px, 1280px | The breakpoints the layout uses |
--cw-target-min | 24px | The smallest tap target |
--cw-gutter | 1rem, 1.5rem from 640px | The side margin of the page |
Dark mode#
Dark mode needs no setting. The tokens switch in three ways.
- Automatic. The reader's system asks for dark (
prefers-color-scheme: dark), unless the page says otherwise. - Forced dark. Put
data-theme="dark"(or Bootstrap'sdata-bs-theme="dark") on<html>or any wrapping element. - Forced light. Put
data-theme="light"ordata-bs-theme="light"on<html>. This stops the automatic switch.
To build a toggle on your site, set the attribute from your own script and remember the choice in a cookie or localStorage. With Bootstrap, the same data-bs-theme attribute also switches Bootstrap's own components.
The article layout#
The article page is laid out by blog.css from tokens, not by utility classes in the views, so Blade (Tailwind and Bootstrap), Livewire, Inertia and the headless sample draw the same page. The views carry only data-cw hooks in this region.
| Measure | Token | Value |
|---|---|---|
| Rail width | --cw-rail-width | 285px |
| Gap between rail and text | --cw-rail-gap | 60px |
| Text column | --cw-measure | 672px |
| Article container | --cw-article | 1017px (rail + gap + text), centred |
| Page width | --cw-page | 1152px |

The rail follows the reader. It is sticky as the page scrolls, and the entry for the section on screen, "Weight, packed size and the poles", is bold with an orange bar on its left. Sub-headings (Pole sleeves and clips, Pole material) are indented under it. Below the contents, Key takeaways and About the authors.
Beside the rail the article is one grid: a 285px rail, a 60px gap and a 672px body. The head (kicker, title, standfirst, byline), the hero image and the rail start at the same left edge. Without a rail, the head, the body and the contents are one 672px column and the hero keeps the article width. Wide and full figures are clamped to the body column when the rail is on, and may bleed to the article width without it.

The top of the same article at 390 pixels. There is no rail: the breadcrumb, title, standfirst, byline and hero image run in one column, then a contents box and the Key takeaways sit in the text.
Below 1024px the rail is hidden and its content moves into the page: the contents become a disclosure, the key takeaways stay in the text, share links sit under the text, and the author box and the related grid follow the body.
Rail or no rail#
Each post has a layout, chosen in the post editor: Article (no rail, the author box below the text) or Article with rail. A post left on Blog default follows the setting template.default, which you change in Settings. Until that setting has been saved, the blade.rail config key decides. The rail shows only the sections that have content, in this order: On this page (the h2 and h3 headings), Key takeaways (the post's first takeaways block), the authors with share links, and Related posts (up to three). With every section empty there is no rail.
Section order on the page#
Breadcrumbs, category kicker, title, standfirst (the excerpt, when set), byline, hero image, rail and text, the post-cta slot, tags, previous and next, the author box, related posts, then the post-after-content slot, where comments appear. The slots are explained in Views you can override.
Listing layout#
The first featured post is a wide lead card (image about 60 percent of the width), then a grid of cards: three columns from 1024px, two from 640px, one below. A card has a 3:2 image, a 22px title, a three-line excerpt and a meta row. An author page shows a 96px avatar, the role and the bio above the grid. The Products block's grid is one column on a phone and two from 640px.
Inertia and shadcn#
In an Inertia app that uses a shadcn theme, point the tokens at its variables in your own CSS instead of editing the published file, for example :root { --cw-accent: var(--primary); --cw-ground: var(--background); --cw-text: var(--foreground); }, and the same under .dark.







