Skip to content

Refactor: Add spacing, typos and colors to theme#467

Merged
isaquebock merged 6 commits intomainfrom
refactor-theme
Mar 23, 2026
Merged

Refactor: Add spacing, typos and colors to theme#467
isaquebock merged 6 commits intomainfrom
refactor-theme

Conversation

@isaquebock
Copy link
Copy Markdown
Collaborator

PR Description

Summary

This PR refactors the @aziontech/theme package to simplify CSS variable names and adds new Tailwind plugins for semantic colors, typography, and spacing.


Changes

🔄 CSS Variables Refactor

Simplified semantic token names to generate cleaner CSS variables:

Before After
--text-textDefault --text-default
--text-textMuted --text-muted
--background-bgDanger --background-danger
--border-borderDefault --border-default

Files changed:

  • src/tokens/semantic/text.js
  • src/tokens/semantic/backgrounds.js
  • src/tokens/semantic/borders.js
  • src/tokens/build/preset.js

✨ New Tailwind Plugins

1. semantic-colors-plugin.js - Semantic color utilities

<p class="text-muted">Muted text</p>
<div class="bg-surface">Surface background</div>
<div class="border-default">Default border</div>

2. semantic-texts-plugin.js - Typography utilities

<h1 class="text-heading-2xl">Heading</h1>
<p class="text-body-md">Body text</p>
<span class="text-overline-sm">OVERLINE</span>

3. semantic-spacing-plugin.js - Spacing utilities

<div class="max-container-width px-container">
  <div class="gap-elements-base">...</div>
</div>

📦 Package Exports

Added new exports in package.json:

"./tailwind/semantic-colors-plugin.js": "./src/tailwind/semantic-colors-plugin.js",
"./tailwind/semantic-texts-plugin.js": "./src/tailwind/semantic-texts-plugin.js",
"./tailwind/semantic-spacing-plugin.js": "./src/tailwind/semantic-spacing-plugin.js"

Usage

// tailwind.config.js
import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
import semanticColors from '@aziontech/theme/tailwind/semantic-colors-plugin.js';
import semanticTexts from '@aziontech/theme/tailwind/semantic-texts-plugin.js';
import semanticSpacing from '@aziontech/theme/tailwind/semantic-spacing-plugin.js';

export default {
  theme,
  plugins: [
    semanticColors(),
    semanticTexts(),
    semanticSpacing(),
  ],
};
// main.js - Inject CSS variables
import { injectCssVars } from '@aziontech/theme/tokens';
injectCssVars();

Breaking Changes

⚠️ CSS variable names have changed. If you were using CSS variables directly (e.g., var(--text-textMuted)), you'll need to update to the new names (var(--text-muted)).


Commits

refactor(tokens): simplify semantic token names
refactor(tailwind): update theme to use simplified CSS variable names
feat(tailwind): add semantic plugins for colors, texts and spacing
feat(package): add exports for semantic plugins
docs: update README with new CSS variable names

Copy link
Copy Markdown
Contributor

@egermano egermano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

por mim ta OK, mas acho que deveria ser tudo TS.

Comment thread packages/theme/src/tailwind/semantic-colors-plugin.js
@isaquebock isaquebock merged commit b306d50 into main Mar 23, 2026
3 checks passed
@robsongajunior
Copy link
Copy Markdown
Collaborator

robsongajunior commented Mar 23, 2026

@egermano vamos por ts na stack... O que pedi é para apenas pegar o tema e fazer rodar na mesma versão do site, estavamos 0.2 atrás.

@robsongajunior
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@robsongajunior
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@robsongajunior
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@robsongajunior robsongajunior deleted the refactor-theme branch April 17, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants