DEV.to strips <style> tags and inline style="" attributes, so you cannot paint a div pink and call it a day. What you can do is let images carry the color and let fenced code blocks carry the texture. Two rules make it work: images are block-level on DEV, so anything that must sit side by side goes in a table row; and a divider is a single wide bar, not four small ones.
🧱 The eight blocks
| # | Block | What it does | Renders on DEV? |
|---|---|---|---|
| 1 | Cover band | 1000×420 PNG, palette + title | ✅ |
| 2 | Palette band | one-row table, one colour per cell | ✅ |
| 3 | Color rule | one wide 1000×10 bar instead of ---
|
✅ |
| 4 | Swatch table | color + HEX + RGB + HSL + contrast | ✅ |
| 5 | Code tab | filename line above a fenced block | ✅ |
| 6 | Diff block | red/green "before → after" | ✅ |
| 7 | Terminal block | a console fence for a shell look |
✅ |
| 8 | Collapsible | the details liquid tag for long code | ✅ |
| — |
<style>, inline style attributes, <script>
|
sanitized away | 🚫 |
1 · Palette band — use a table row, not a line of images
This is the mistake worth learning from. DEV renders every article image as a block element, so four
images on one line do not butt together into a bar — they stack vertically down the page.
-  ← stacks vertically on DEV
+ | `#0F172A` | `#00F5D4` | `#F15BB5` | `#9B5DE5` |
+ | :--: | :--: | :--: | :--: |
+ |  |  |  |  |
Table cells are the reliable way to force horizontal layout, and you get the hex codes as a header row
for free:
#0F172A |
#00F5D4 |
#F15BB5 |
#9B5DE5 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
The URL shape is placehold.co/{W}x{H}/{background}/{textColor}.png. Passing the same hex twice hides
the auto-generated size label, so you get a clean solid block. dummyimage.com/120x56/0f172a/0f172a.png
is a drop-in fallback if placehold.co is ever down.
Keep swatches at 120×56 or smaller inside tables — four columns of 210px overflow the article width
on mobile.
🚧 Trap — the same rule applies inside a cell. Four images in one cell stack too. One colour per
cell, always.
2 · Color rule — one wide bar
A divider wants to be a single image, for exactly the same reason:

It scales down to any screen width, and it beats a grey --- for keeping the article's palette present.
3 · Swatch table
| Swatch | HEX | RGB | HSL | On #0F172A
|
Role |
|---|---|---|---|---|---|
#0F172A |
15, 23, 42 |
222° 47% 11% |
— | Base | |
#00F5D4 |
0, 245, 212 |
172° 100% 48% |
12.76:1 ✅ | Primary | |
#F15BB5 |
241, 91, 181 |
324° 84% 65% |
5.87:1 ✅ | Accent | |
#9B5DE5 |
155, 93, 229 |
267° 72% 63% |
4.33:1 🟡 | Support |
4 · Code tabs — five looks for five jobs
Give each block a tab line right above it. The bold monospace filename plus an em-dash caption reads like an editor tab and visually separates one code look from the next.
tokens.css ⌁ the source of truth
:root {
--color-surface: #0F172A;
--color-primary: #00F5D4;
}
tailwind.config.js ⌁ the framework mirror
module.exports = {
theme: { extend: { colors: { palette: { surface: '#0F172A' } } } },
};
patch ⌁ before → after, in red and green
- background: #1e1e1e;
- color: #cccccc;
+ background: var(--color-surface);
+ color: var(--color-primary);
terminal ⌁ no syntax highlighting, all vibe
$ npx palette-tokens 0F172A 00F5D4 F15BB5 9B5DE5
✔ wrote tokens.css (4 custom properties)
✔ wrote tokens.json (4 design tokens)
data ⌁ machine-readable
{
// one palette, four tokens
"surface": "#0F172A",
"primary": "#00F5D4"
}
5 · Liquid tags worth using
Long snippets, alternate framework versions and "the boring full config" belong in here so the article keeps its rhythm.💡 Click to expand a collapsible
$surface: #0F172A;
$primary: #00F5D4;
{% details Summary text %} hidden content {% enddetails %}
{% embed https://codepen.io/your/pen %}
{% katex inline %} L = 0.2126R + 0.7152G + 0.0722B {% endkatex %}
6 · Front matter template
---
title: "Your title — max ~60 chars for the card"
published: false
description: "One sentence, 120-160 chars, shows up in the feed and in OG cards."
tags: css, webdev, design, beginners
canonical_url: https://your-site.com/original-post
series: "Color for Developers"
---
🧪 Lab note —
tagsis a maximum of four, comma separated, no#.cover_imagelooks best at exactly 1000×420. Keeppublished: falseuntil the preview looks right, then flip it.
7 · Generate all of it
Every band, table and token block in this series came out of one script:
$ python3 tools/palette_kit.py swatches \
--name "Neon Diner Harmony" --slug neon-diner-harmony \
--colors 0F172A 00F5D4 F15BB5 9B5DE5
The palettes used in these examples come from ColorFiind — 34,000+ named palettes with HEX codes, CSS variables and downloadable swatch images on every page.




Top comments (0)