1.0.2 • Published 4 months ago

@sula-tech/sula-tailwind-css v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

🎨 Design System Tailwind Plugin - SulAmérica

Versão npm

📑 Índice

Instalação

O processo de instalação e configuração do plugin é simples e direto. Siga os passos abaixo:

  1. Adicione o plugin ao array de plugins no seu arquivo de configuração do Tailwind CSS (tailwind.config.js)
  2. Importe o plugin conforme demonstrado no exemplo abaixo:
/** @type {import('tailwindcss').Config} */
const plugin = require("@sula-tech/sula-tailwind-css/src/tailwind-design-system-plugin");

module.exports = {
  // Define os arquivos que serão processados pelo Tailwind
  content: ["./src/**/*.{html,ts}"],
  
  // Configurações personalizadas do tema (se necessário)
  theme: {},
  
  // Adiciona o plugin ao array de plugins
  plugins: [plugin],
};

Após essa configuração, todos os estilos e utilitários do plugin estarão disponíveis para uso em seu projeto.

Nota: Certifique-se de que o plugin está corretamente instalado via npm ou yarn antes de adicioná-lo à configuração.

🎨 Cores

Cores da Marca

ClasseValor (Light)Valor (Dark)Token
.text-brand-primary#f05223#f0693ecolor.brand.primary
.text-brand-secondary#001d5f#5959a1color.brand.secondary
.text-brand-tertiary-1#1769e0#1769e0color.brand.tertiary-1
.text-brand-tertiary-2#f98900#f98900color.brand.tertiary-2

Cores de Feedback

ClasseValor (Light)Valor (Dark)Token
.text-feedback-success#04843f#85ae8fcolor.feedback.success
.text-feedback-error#c80505#c80505color.feedback.error
.text-feedback-informational#145abf#adbdefcolor.feedback.informational
.text-feedback-alert#ef9928#f3ba89color.feedback.alert

Cores de Texto

ClasseValor (Light)Valor (Dark)Token
.text-text-primary#323232#e6e6e6color.text.primary
.text-text-secondary#5c5c5c#b9b9b9color.text.secondary
.text-text-disabled#949494#5c5c5ccolor.text.disabled
.text-text-link#145abf#adbdefcolor.text.link

📝 Tipografia

Família Tipográfica

ClasseValorToken
.font-baseAesteticofont.base

Escalas Tipográficas - Display

ClasseValorToken
.text-base-display-large120px/120pxdesktop.display.large
.text-base-display-medium80px/80pxdesktop.display.medium
.text-base-display-small60px/60pxdesktop.display.small

Escalas Tipográficas - Títulos

ClasseValorToken
.text-base-title-large48px/48pxdesktop.title.large
.text-base-title-medium32px/32pxdesktop.title.medium
.text-base-title-small24px/24pxdesktop.title.small

Escalas Tipográficas - Parágrafos

ClasseValorToken
.text-base-paragraph-large-regular20px/28pxdesktop.paragraph.large.regular
.text-base-paragraph-large-bold20px/28px bolddesktop.paragraph.large.bold
.text-base-paragraph-small-regular16px/24pxdesktop.paragraph.small.regular
.text-base-paragraph-small-bold16px/24px bolddesktop.paragraph.small.bold

Escalas Tipográficas - Rótulos

ClasseValorToken
.text-base-label-large-regular20px/20pxdesktop.label.large.regular
.text-base-label-large-bold20px/20px bolddesktop.label.large.bold
.text-base-label-small-regular14px/14pxdesktop.label.small.regular
.text-base-label-small-bold14px/14px bolddesktop.label.small.bold

📏 Espaçamento

ClasseValorToken
.p-11pxspace.1
.p-22pxspace.2
.p-44pxspace.4
.p-88pxspace.8
.p-1616pxspace.16
.p-2424pxspace.24
.p-3232pxspace.32
.p-4040pxspace.40
.p-4848pxspace.48
.p-6464pxspace.64
.p-8080pxspace.80
.p-9696pxspace.96
.p-120120pxspace.120

Nota: Disponível para padding (p-), margin (m-), gap (gap-), etc.

🔲 Bordas

ClasseValorToken
.rounded-xs8pxborder-radius.xs
.rounded-sm12pxborder-radius.sm
.rounded-md20pxborder-radius.md
.rounded-lg40pxborder-radius.lg
.rounded-xxl300pxborder-radius.xxl

📐 Dimensões

ClasseValorToken
.w-11pxsize.1
.w-44pxsize.4
.w-88pxsize.8
.w-342342pxsize.342
.w-390390pxsize.390
.w-645645pxsize.645

Nota: Disponível para width (w-), height (h-), max-width (max-w-), max-height (max-h-)

💡 Exemplos

Card Básico

<div class="bg-surface-body p-24 rounded-md">
  <!-- Token: color.surface.body, space.24, border-radius.md -->
  <h1 class="text-base-title-large text-brand-primary mb-16">
    <!-- Token: desktop.title.large, color.brand.primary, space.16 -->
    Título do Card
  </h1>
  <p class="text-base-paragraph-regular text-text-secondary">
    <!-- Token: desktop.paragraph.regular, color.text.secondary -->
    Conteúdo do card com texto secundário.
  </p>
  <button
    class="bg-brand-primary text-neutral-neutral-1 px-24 py-12 rounded-sm mt-24"
  >
    <!-- Token: color.brand.primary, space.24, space.12, border-radius.sm, space.24 -->
    Botão de Ação
  </button>
</div>

Banner Informativo

<div class="bg-surface-on-body-blue p-16 rounded-sm">
  <div class="flex items-center gap-8">
    <span class="text-feedback-informational">
      <!-- Ícone de Informação -->
    </span>
    <p class="text-base-label-medium-regular text-text-primary">
      Mensagem informativa para o usuário
    </p>
  </div>
</div>

📚 Observações

  • Todas as cores podem ser utilizadas com os prefixos:

    • text- (cor do texto)
    • bg- (cor de fundo)
    • border- (cor da borda)
    • ring- (cor do outline)
    • divide- (cor de divisores)
    • placeholder- (cor do placeholder)
  • O plugin gera automaticamente variáveis CSS (custom properties) para todas as cores, tornando-as disponíveis globalmente em sua aplicação.

1.0.2

4 months ago

1.0.1

5 months ago

1.0.0

5 months ago