Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9ca3768
feat(design-system): add accessible light palette with shared semanti…
rgomids Oct 17, 2026
5de7079
feat(design-system): make header, code and theme toggle theme-aware
rgomids Oct 17, 2026
54e93da
feat(design-system): add shared persisted system-aware appearance con…
rgomids Oct 17, 2026
76eb750
feat(design-system): preview light/dark switch on all design system e…
rgomids Oct 17, 2026
ba7623d
feat(design-system): preview light/dark switch on all design system e…
rgomids Oct 17, 2026
38b44a4
feat(design-system): preview light/dark switch on all design system e…
rgomids Oct 17, 2026
a61c518
feat(design-system): preview light/dark switch on all design system e…
rgomids Oct 17, 2026
539920f
style(design-system): adapt static demo surfaces to both themes
rgomids Oct 17, 2026
e618733
test(design-system): verify light/dark WCAG contrast and theme controls
rgomids Oct 17, 2026
444044f
feat(blog): add persistent light/dark theme switch to all blog pages
rgomids Oct 17, 2026
fe016d6
style(blog): theme-aware code blocks and readable static diagrams in …
rgomids Oct 17, 2026
dabf4a6
fix(test): parse scoped light palette for both-mode contrast validation
rgomids Oct 17, 2026
0c1ba4e
docs(theme): explain shared light mode behavior and accessible palettes
rgomids Oct 17, 2026
ad028e4
docs(theme): explain shared light mode behavior and accessible palettes
rgomids Oct 17, 2026
ef505eb
docs(theme): explain shared light mode behavior and accessible palettes
rgomids Oct 17, 2026
77d34ea
docs(theme): explain shared light mode behavior and accessible palettes
rgomids Oct 17, 2026
23da079
test(blog): guard dark/light toggle, early hydration and system prefe…
rgomids Oct 17, 2026
4990a4e
ci(blog): validate shared theme asset and toggle in published pages
rgomids Oct 17, 2026
b2dd874
style(blog): keep appearance switch usable on tablet and mobile navig…
rgomids Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/blog-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- 'artigos/**'
- 'blog.css'
- 'blog.js'
- 'design-system/tokens/**'
- 'design-system/components/**'
- 'design-system/theme/**'
- 'blog-mermaid.js'
- 'feed.xml'
- 'sitemap.xml'
Expand All @@ -29,6 +32,9 @@ on:
- 'artigos/**'
- 'blog.css'
- 'blog.js'
- 'design-system/tokens/**'
- 'design-system/components/**'
- 'design-system/theme/**'
- 'blog-mermaid.js'
- 'feed.xml'
- 'sitemap.xml'
Expand Down Expand Up @@ -62,6 +68,10 @@ jobs:
test -f _site/sitemap.xml
test -f _site/robots.txt
test -f _site/CNAME
test -f _site/design-system/theme/theme.js
grep -q 'data-theme-toggle' _site/artigos/index.html
grep -q 'design-system/theme/theme.js' _site/artigos/index.html
grep -q 'data-theme-toggle' _site/artigos/chatgpt-como-camada-de-preparacao/index.html
grep -q 'Engineering Notes' _site/artigos/index.html || grep -q 'Publicações' _site/artigos/index.html
test -f _site/artigos/chatgpt-como-camada-de-preparacao/index.html
test -f _site/blog-mermaid.js
Expand Down
4 changes: 3 additions & 1 deletion _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<meta name="color-scheme" content="light dark">
<title>{% if page.title %}{{ page.title | escape }} | {% endif %}Rafael Gomides</title>
<meta name="description" content="{{ page.description | default: site.description | strip_html | escape }}">
<meta name="author" content="Rafael Gomides">
Expand All @@ -26,6 +26,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
<script src="{{ '/design-system/theme/theme.js' | relative_url }}"></script>
<link rel="stylesheet" href="{{ '/design-system/tokens/tokens.css' | relative_url }}">
<link rel="stylesheet" href="{{ '/design-system/components/components.css' | relative_url }}">
<link rel="stylesheet" href="{{ '/blog.css' | relative_url }}">
Expand All @@ -41,6 +42,7 @@
<span class="ds-brand__hint">/ engineering notes</span>
</a>
<nav class="ds-nav" aria-label="Navegação principal">
<button type="button" class="ds-theme-toggle" data-theme-toggle aria-label="Alternar tema" title="Alternar tema"><span class="ds-theme-toggle__icon" data-theme-icon aria-hidden="true">☀</span><span class="ds-theme-toggle__label" data-theme-label>Modo claro</span></button>
<button class="ds-nav__toggle" type="button" data-menu-button aria-expanded="false" aria-controls="blog-navigation" aria-label="Abrir menu">☰</button>
<div class="ds-nav__links" id="blog-navigation" data-menu-panel data-open="false">
<a class="ds-nav__link" href="{{ '/#sobre' | relative_url }}">Sobre</a>
Expand Down
4 changes: 4 additions & 0 deletions artigos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ Para adicionar diagramas a outro artigo, use o mesmo padrão: versionar o arquiv
6. Fazer merge após a revisão e verificar a URL pública e o índice de artigos.

**Importante:** o processo de publicação deve respeitar a fronteira editorial definida pelo autor; não remova parágrafos substantivos do corpo do artigo.

## Modo claro e escuro

O blog lê o controlador compartilhado `/design-system/theme/theme.js` antes do CSS. O botão no header alterna os modos e salva a escolha entre listagem e artigos. Sem preferência manual, segue a configuração clara/escura do sistema. Os diagramas Mermaid já exportados para SVG mantêm contraste na paleta escura original, independentemente do tema de leitura. Ao alterar CSS do blog, utilize tokens semânticos e verifique ambos os modos.
31 changes: 30 additions & 1 deletion blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ html { scroll-behavior: smooth; }
.blog-article-body .ds-prose img { max-width: 100%; height: auto; border-radius: var(--ds-radius-sm); }
.blog-article-body .ds-prose figure { margin-inline: 0; }
.blog-article-body .ds-prose figcaption { font: .73rem/1.5 var(--ds-font-mono); color: var(--ds-color-subtle); }
.blog-article-body .ds-prose .highlight { background: #101713; border: 1px solid var(--ds-color-border); border-radius: var(--ds-radius-sm); overflow: hidden; margin: 1.6rem 0; }
.blog-article-body .ds-prose .highlight { background: var(--ds-color-code-bg); border: 1px solid var(--ds-color-border); border-radius: var(--ds-radius-sm); overflow: hidden; margin: 1.6rem 0; }
.blog-article-body .ds-prose .highlight pre { background: transparent; border: 0; margin: 0; border-radius: 0; overflow-x: auto; }
.blog-article-body .ds-prose :not(pre) > code { overflow-wrap: anywhere; }
.blog-article-body .ds-prose a { text-decoration: underline; text-underline-offset: .2em; }
Expand Down Expand Up @@ -181,3 +181,32 @@ html { scroll-behavior: smooth; }
.blog-article-body .ds-prose .blog-diagram__visual img { min-width: 620px; }
.blog-article-body .ds-prose .blog-diagram__copy { margin-left: 0; }
}

/* Keep static Mermaid SVGs in their authored dark palette in either UI mode.
Unlike navigation/text surfaces, these are static illustrations. */
:root[data-theme="light"] .blog-article-body .blog-diagram__visual {
background: #151b18;
}
:root[data-theme="light"] .blog-article-body .blog-diagram__visual img {
background: #151b18;
}

/* The blog has more navigation destinations than the portfolio. Collapse early
so the added appearance switch never squeezes or wraps desktop links. */
@media (max-width: 1050px) {
.ds-app .ds-nav__toggle { display: inline-flex; }
.ds-app .ds-nav__links {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
flex-direction: column;
align-items: stretch;
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--ds-color-border);
background: var(--ds-color-bg);
}
.ds-app .ds-nav__links[data-open="true"] { display: flex; }
.ds-app .ds-nav__link { padding: .85rem; }
}
19 changes: 17 additions & 2 deletions design-system/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Dark Engineering — Design System

**Versão:** 0.1.0 (proposta para revisão)
**Versão:** 0.2.0 (suporte a light/dark mode)
**Escopo:** portfólio pessoal + blog técnico de Rafael Gomides
**Status:** biblioteca visual v0.1 integrada ao portfólio na branch de redesign; a página do Axion permanece independente

Design system dark-first com linguagem de engenharia: legibilidade editorial, hierarquia de informação, acentos verde-pastel e amarelo, tipografia sans com monoespaçada aplicada a contexto técnico.
Design system dark-first, com modo claro opcional e linguagem de engenharia: legibilidade editorial, hierarquia de informação, acentos verde-pastel e amarelo, tipografia sans com monoespaçada aplicada a contexto técnico.

## Explorar

Expand Down Expand Up @@ -121,3 +121,18 @@ python3 -m http.server 8000
```

**Escopo:** mesmo conteúdo das seis seções existentes, novo layout e navegação. A implementação de páginas reais do blog não faz parte dessa entrega.

## Temas — Dark / Light

O tema escuro original permanece como a base do design system. Os tokens claros são aplicados com `<html data-theme="light">`, mantendo as mesmas classes `.ds-*` e componentes. A paleta clara usa texto escuro, superfícies suaves e acentos verde/amarelo adaptados para contraste. Para uma interface interativa, carregue `design-system/theme/theme.js` de forma síncrona no `<head>`, **antes** das folhas de estilo, e inclua no cabeçalho:

```html
<button type="button" class="ds-theme-toggle" data-theme-toggle aria-label="Alternar tema">
<span class="ds-theme-toggle__icon" data-theme-icon aria-hidden="true">☀</span>
<span class="ds-theme-toggle__label" data-theme-label>Modo claro</span>
</button>
```

**Comportamento:** sem preferência salva, segue `prefers-color-scheme`; clique alterna claro/escuro e salva o modo escolhido em `localStorage` (`rgomids-color-theme`). Caso armazenamento ou JavaScript esteja indisponível, o site permanece utilizável. O controle só aparece depois que o JS inicializa. A preferência vale para todas as páginas que carregam o controlador (no momento, o blog e as demonstrações). O portfólio principal permanece no layout escuro, sem controle de tema nesta entrega, e a página do Axion permanece independente.

Use os tokens semânticos `--ds-color-*` em vez de cores fixas nas superfícies do blog. Para cada novo componente, verifique os dois temas. Ilustrações SVG Mermaid mantêm sua paleta escura própria em ambos os modos por legibilidade.
12 changes: 10 additions & 2 deletions design-system/components/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.ds-container { width: min(var(--ds-content-width), calc(100% - 3rem)); margin-inline: auto; }
.ds-skip-link { position: absolute; z-index: 99; top: -100px; left: 1rem; padding: .7rem 1rem; background: var(--ds-color-highlight); color: var(--ds-color-highlight-contrast) !important; }
.ds-skip-link:focus { top: .5rem; }
.ds-header { position: relative; z-index: 20; border-bottom: 1px solid var(--ds-color-border); background: rgb(11 15 14 / .92); }
.ds-header { position: relative; z-index: 20; border-bottom: 1px solid var(--ds-color-border); background: var(--ds-color-header-bg); }
.ds-header__inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.ds-brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ds-color-text); font-weight: 700; letter-spacing: -.05em; white-space: nowrap; font-size: 1.4rem; }
.ds-brand__mark { display: inline-grid; place-items: center; border: 1px solid var(--ds-color-border-strong); width: 43px; height: 43px; border-radius: .65rem; }
Expand Down Expand Up @@ -71,7 +71,7 @@ a.ds-post-item:hover { background: var(--ds-color-surface); }
.ds-prose ul, .ds-prose ol { padding-left: 1.4rem; }
.ds-prose a { color: var(--ds-color-accent); text-decoration: underline; text-underline-offset: .2em; }
.ds-prose code { font-family: var(--ds-font-mono); font-size: .83em; background: var(--ds-color-surface-raised); border: 1px solid var(--ds-color-border); border-radius: .25rem; padding: .15rem .3rem; overflow-wrap: anywhere; }
.ds-prose pre { overflow-x: auto; background: #101713; border: 1px solid var(--ds-color-border); padding: 1.4rem; border-radius: var(--ds-radius-sm); margin-bottom: 1.6rem; line-height: 1.5; font-size: .88rem; }
.ds-prose pre { overflow-x: auto; background: var(--ds-color-code-bg); border: 1px solid var(--ds-color-border); padding: 1.4rem; border-radius: var(--ds-radius-sm); margin-bottom: 1.6rem; line-height: 1.5; font-size: .88rem; }
.ds-prose pre code { padding: 0; border: 0; background: transparent; overflow-wrap: normal; }
.ds-prose blockquote { margin: 1.5rem 0; padding: .2rem 1.2rem; border-left: 2px solid var(--ds-color-highlight); color: var(--ds-color-muted); }
.ds-prose :is(img,video) { max-width: 100%; height: auto; border-radius: var(--ds-radius-sm); }
Expand Down Expand Up @@ -102,3 +102,11 @@ a.ds-post-item:hover { background: var(--ds-color-surface); }

/* Explicitly preserve native hidden semantics on display-based components. */
.ds-app [hidden] { display: none !important; }

/* Theme control: opt-in by host. Hidden without JS, visible when the theme
controller has initialized. The native button stays keyboard accessible. */
.ds-theme-toggle { display: none; align-items: center; justify-content: center; flex: 0 0 auto; gap: .55rem; min-width: 44px; min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--ds-color-border-strong); border-radius: var(--ds-radius-xs); background: var(--ds-color-surface); color: var(--ds-color-text); font: 500 .72rem/1.4 var(--ds-font-mono); }
html[data-theme-ready] .ds-theme-toggle { display: inline-flex; }
.ds-theme-toggle:hover { border-color: var(--ds-color-accent); background: var(--ds-color-surface-raised); }
.ds-theme-toggle__icon { font: 1.15rem/1 var(--ds-font-sans); }
@media (max-width: 520px) { .ds-theme-toggle__label { display: none; } }
14 changes: 14 additions & 0 deletions design-system/foundations/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,17 @@ As bordas decorativas não devem ser o único indicador de estado. Para estados
- [ ] Imagens de conteúdo têm `alt` descritivo e ícones decorativos são ocultados de tecnologia assistiva.
- [ ] Verificar novamente o contraste após adicionar realces, imagens ou estados.
- [ ] Avaliar sem JavaScript e com redução de movimento.

## Tema claro (v0.2)

As cores claras adicionadas aos tokens são testadas pelo script `design-system/scripts/validate.mjs` com razão mínima **4.5:1** para os pares de texto relevantes:

| Par no tema claro | Razão aproximada |
| --- | ---: |
| Texto `#15231b` / fundo `#f7f8f4` | 15.28:1 |
| Muted `#466050` / fundo | 6.46:1 |
| Accent `#23633d` / fundo | 6.73:1 |
| Highlight `#755500` / fundo | 6.44:1 |
| Texto branco / accent | 7.18:1 |

O botão para alternar tema é nativo, acessível pelo teclado, com ação em `aria-label` atualizada. Quando não há preferência salva, o sistema escolhe pela preferência de cores do SO; a escolha manual é preservada entre páginas. Navegação, foco, seleção e campos herdam os tokens dos dois modos.
4 changes: 2 additions & 2 deletions design-system/foundations/principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Identidade

**Dark Engineering:** portfólio de engenharia de software com expressão técnica, caráter editorial e futurismo discreto.
**Dark Engineering:** portfólio de engenharia de software com expressão técnica, caráter editorial e futurismo discreto, agora com opção de leitura clara no blog.

Inspirado na precisão dos sites técnicos minimalistas, na leitura confortável de blogs editoriais e em interfaces modernas sem excesso visual. Não copiar layouts ou assets de terceiros.

### Decisões

1. **Conteúdo primeiro:** arquitetura, problemas, resultados e raciocínio mais visíveis que efeitos.
2. **Clareza de interação:** links parecem links; botões têm hierarquia evidente; foco e hover distinguíveis.
3. **Dark-first, não neon-first:** verde-pastel identifica ações; amarelo destaca uma pequena área por vez.
3. **Dark-first, não neon-first:** verde-pastel identifica ações; amarelo destaca uma pequena área por vez. No light mode, acentos tornam-se mais escuros para manter contraste.
4. **Monoespaçada sem saturação:** reservar para metadados, labels, código, navegação e indicadores.
5. **Componentes por responsabilidade:** cards não devem carregar lógica de filtros, tema ou navegação.
6. **Portfólio = blog:** mesmo header, footer, tokens, largura e linguagem visual.
Expand Down
7 changes: 4 additions & 3 deletions design-system/preview/article.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!doctype html>
<html lang="pt-BR"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="dark"><meta name="description" content="Exemplo de leitura técnica no design system Dark Engineering."><title>Artigo técnico — Dark Engineering</title>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><meta name="description" content="Exemplo de leitura técnica no design system Dark Engineering."><title>Artigo técnico — Dark Engineering</title>
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../tokens/tokens.css"><link rel="stylesheet" href="../components/components.css"><link rel="stylesheet" href="./preview.css"><script defer src="./preview.js"></script>
<script src="../theme/theme.js"></script>
<link rel="stylesheet" href="../tokens/tokens.css"><link rel="stylesheet" href="../components/components.css"><link rel="stylesheet" href="./preview.css"><script defer src="./preview.js"></script>
</head><body class="ds-app">
<a class="ds-skip-link" href="#conteudo">Pular para o conteúdo</a>
<header class="ds-header"><div class="ds-container ds-header__inner"><a class="ds-brand" href="./index.html" aria-label="Dark Engineering — início"><span class="ds-brand__mark">RG<span class="ds-brand__dot">.</span></span><span class="ds-brand__hint">/ engineering notes</span></a>
<nav class="ds-nav" aria-label="Principal"><button type="button" class="ds-nav__toggle" data-menu-button aria-expanded="false" aria-controls="menu-principal" aria-label="Abrir menu">☰</button><div class="ds-nav__links" id="menu-principal" data-menu-panel data-open="false"><a class="ds-nav__link" href="./index.html">Sistema</a><a class="ds-nav__link" href="./projects.html">Projetos</a><a class="ds-nav__link" aria-current="page" href="./blog.html">Artigos</a><a class="ds-nav__link ds-nav__link--accent" href="/axiom/">Axion ↗</a></div></nav></div></header>
<nav class="ds-nav" aria-label="Principal"><button type="button" class="ds-theme-toggle" data-theme-toggle aria-label="Alternar tema" title="Alternar tema"><span class="ds-theme-toggle__icon" data-theme-icon aria-hidden="true">☀</span><span class="ds-theme-toggle__label" data-theme-label>Modo claro</span></button><button type="button" class="ds-nav__toggle" data-menu-button aria-expanded="false" aria-controls="menu-principal" aria-label="Abrir menu">☰</button><div class="ds-nav__links" id="menu-principal" data-menu-panel data-open="false"><a class="ds-nav__link" href="./index.html">Sistema</a><a class="ds-nav__link" href="./projects.html">Projetos</a><a class="ds-nav__link" aria-current="page" href="./blog.html">Artigos</a><a class="ds-nav__link ds-nav__link--accent" href="/axiom/">Axion ↗</a></div></nav></div></header>
<main id="conteudo">
<section class="demo-page-intro"><div class="ds-container"><a class="ds-btn ds-btn--ghost" href="./blog.html">← Todos os artigos</a><div class="ds-article__meta" style="margin-top:2rem"><span class="ds-chip">Architecture</span><span>Exemplo de conteúdo</span><span>8 min de leitura (ilustrativo)</span></div><h1 class="ds-article__title">Da issue ao agente: arquitetura antes de automação<span class="ds-highlight">.</span></h1><p class="ds-article__intro">Uma página-modelo para avaliar hierarquia, links, blocos de código, notas e o ritmo de leitura. Este artigo é fictício e não deve ser publicado como conteúdo editorial final.</p><div class="ds-article__meta" style="margin-top:1.5rem"><span>Rafael Gomides</span><span>•</span><span>Engineering notes / Demo</span></div></div></section>
<div class="ds-container demo-article-wrap">
Expand Down
Loading
Loading