Saltar al contenido principal

Reference · Variables CSS

Listado canónico de variables --nrn-* que el widget expone dentro del Shadow DOM. Fuente de verdad: el bundle CSS embebido en https://cdn.neuroon.ai/widget@0.9.10/widget.js (los valores aquí son los de esa versión). Si quieres verificar puntualmente uno, inspecciona el shadow root con DevTools y revisa el bloque .neuroon-widget.

Convenciones

  • Colores en formato RGB-triplet (6 182 212, no #06b6d4). El widget compone con rgb(var(--nrn-primary)) y permite alpha runtime: rgb(var(--nrn-primary) / 0.18).
  • Spacings, radii, shadows, motion son valores CSS estándar (rem, ms, cubic-bezier(...)).
  • Z-index son enteros.
  • Las variables se inyectan dentro de .neuroon-widget (host del shadow root). Si sobrescribes desde fuera, anclalo al host: .neuroon-widget { --nrn-primary: 16 206 199; }.

Surfaces

VariableDefault light
--nrn-surface-base255 255 255 (white)
--nrn-surface-elevated248 250 252 (slate-50)
--nrn-surface-overlay241 245 249 (slate-100)
--nrn-surface-hover226 232 240 (slate-200)
--nrn-surface-subtle241 245 249 (slate-100)
--nrn-surface-sunken241 245 249 (slate-100)
--nrn-surface-float250 251 252 (floating elements)

Text

VariableDefault light
--nrn-text-primary15 23 42 (slate-900)
--nrn-text-secondary30 41 59 (slate-800)
--nrn-text-tertiary51 65 85 (slate-700)
--nrn-text-muted71 85 105 (slate-600 — WCAG AA)
--nrn-text-disabled148 163 184 (slate-400)

Border

VariableDefault light
--nrn-border-default226 232 240 (slate-200)
--nrn-border-emphasis203 213 225 (slate-300)
--nrn-border-subtle241 245 249 (slate-100)

Brand primary

VariableDefaultComentario
--nrn-primary8 145 178cyan-600 (4.5:1 sobre blanco)
--nrn-primary-light6 182 212cyan-500
--nrn-primary-dark14 116 144cyan-700
--nrn-primary-hover6 182 212cyan-500 (estado hover)
--nrn-primary-text255 255 255texto sobre primary

Escala completa (para componer fondos, hovers, bordes):

VariableDefaultUso típico
--nrn-primary-50236 254 255fondos sutiles
--nrn-primary-100207 250 254hover backgrounds
--nrn-primary-200165 243 252active backgrounds
--nrn-primary-300103 232 249bordes claros
--nrn-primary-40034 211 238decorativos
--nrn-primary-5006 182 212= primary-light
--nrn-primary-6008 145 178= primary
--nrn-primary-70014 116 144= primary-dark
--nrn-primary-80021 94 117accents heavy
--nrn-primary-90022 78 99muy oscuro
--nrn-primary-9508 51 68casi negro

Brand secondary

VariableDefault
--nrn-secondary37 99 235 (blue-600)
--nrn-secondary-light59 130 246 (blue-500)
--nrn-secondary-dark29 78 216 (blue-700)

Accent

VariableDefaultUso
--nrn-accent-purple147 51 234 (purple-600)AI suggestions, image search
--nrn-accent-emerald4 120 87 (emerald-700, WCAG AA)filtros aplicados por IA, success
--nrn-accent-amber217 119 6 (amber-600)warnings, confianza media
--nrn-accent-purple-strong109 40 217 (violet-700)énfasis purple
--nrn-accent-emerald-strong6 95 70 (emerald-800)énfasis emerald
--nrn-accent-amber-strong180 83 9 (amber-700)énfasis amber

Semantic

VariableDefault
--nrn-success22 163 74 (green-600)
--nrn-success-strong21 128 61 (green-700)
--nrn-warning202 138 4 (yellow-600)
--nrn-warning-strong161 98 7 (yellow-700)
--nrn-error220 38 38 (red-600)
--nrn-error-strong185 28 28 (red-700)
--nrn-info37 99 235 (blue-600)

Decorativas y status

VariableDefaultUso
--nrn-rating245 158 11 (amber-500)estrellas/ratings
--nrn-rating-light251 191 36 (amber-400)rating background
--nrn-trending236 72 153 (pink-500)badges trending
--nrn-premium139 92 246 (violet-500)badges premium
--nrn-winner245 158 11 (amber-500)comparator winner
--nrn-importance-essential244 63 94 (rose-500)importancia esencial
--nrn-importance-high245 158 11 (amber-500)importancia alta
--nrn-importance-medium6 182 212 (cyan-500)importancia media
--nrn-importance-low100 116 139 (slate-500)importancia baja

Glass / overlay

VariableDefault
--nrn-overlay0 0 0
--nrn-overlay-opacity0.5
--nrn-glass-background255 255 255
--nrn-glass-border226 232 240
--nrn-ring-offset255 255 255
--nrn-glass-blur20px
--nrn-glass-blur-lg32px
--nrn-glass-bgrgba(255, 255, 255, 0.65)
--nrn-glass-bg-hoverrgba(255, 255, 255, 0.85)

Tipografía

VariableDefault
--nrn-font-size-xs0.75rem
--nrn-font-size-sm0.875rem
--nrn-font-size-base1rem
--nrn-font-size-lg1.125rem
--nrn-font-size-xl1.25rem
--nrn-font-weight-normal400
--nrn-font-weight-medium500
--nrn-font-weight-semibold600
--nrn-font-weight-bold700
--nrn-font-weight-display800
--nrn-font-letter-spacing-tight-0.02em
--nrn-font-letter-spacing-display-0.03em

Spacing

VariableDefault
--nrn-spacing-xs0.25rem
--nrn-spacing-sm0.5rem
--nrn-spacing-md0.75rem
--nrn-spacing-lg1rem
--nrn-spacing-xl1.5rem

Radius

VariableDefault
--nrn-radius-sm0.25rem
--nrn-radius-md0.375rem
--nrn-radius-lg0.5rem
--nrn-radius-xl0.75rem
--nrn-radius-2xl1rem

Shadow

VariableDefault
--nrn-shadow-xs0 1px 2px rgb(0 0 0 / 0.05)
--nrn-shadow-sm0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06)
--nrn-shadow-md0 4px 6px rgb(0 0 0 / 0.07), 0 2px 4px rgb(0 0 0 / 0.06)
--nrn-shadow-lg0 10px 15px rgb(0 0 0 / 0.1), 0 4px 6px rgb(0 0 0 / 0.05)
--nrn-shadow-xl0 20px 25px rgb(0 0 0 / 0.1), 0 10px 10px rgb(0 0 0 / 0.04)
--nrn-shadow-2xl0 25px 50px rgb(0 0 0 / 0.25)
--nrn-shadow-primary0 4px 14px rgb(8 145 178 / 0.25)
--nrn-shadow-primary-lg0 8px 24px rgb(8 145 178 / 0.35)

Motion (duration + easing)

VariableDefaultUso
--nrn-duration-instant50msfeedback de tap
--nrn-duration-fast150mshover states
--nrn-duration-normal250mstransitions estándar
--nrn-duration-slow400msaparición de modals
--nrn-duration-slower600msaparición pesada
--nrn-ease-outcubic-bezier(0.16, 1, 0.3, 1)entrada suave
--nrn-ease-incubic-bezier(0.4, 0, 1, 1)salida rápida
--nrn-ease-in-outcubic-bezier(0.65, 0, 0.35, 1)balanceado
--nrn-ease-springcubic-bezier(0.34, 1.56, 0.64, 1)bounce sutil
--nrn-ease-bouncecubic-bezier(0.68, -0.6, 0.32, 1.6)bounce más pronunciado
--nrn-motion-entrance300ms var(--nrn-ease-out)preset entrada
--nrn-motion-exit200ms var(--nrn-ease-in)preset salida
--nrn-motion-hover150ms var(--nrn-ease-out)preset hover
--nrn-motion-stagger40msdelay entre items

Z-index

VariableDefault
--nrn-z-dropdown1000
--nrn-z-sticky1020
--nrn-z-fixed1030
--nrn-z-drawer1040
--nrn-z-modal1050
--nrn-z-popover1060
--nrn-z-tooltip1070
--nrn-z-toast1080
--nrn-z-modal-fullscreen9999

Override desde tu host

Sobrescribe directamente con la sintaxis RGB-triplet:

.neuroon-widget {
--nrn-primary: 16 206 199; /* tu color de marca */
--nrn-primary-hover: 13 165 159;
--nrn-radius-md: 0.5rem;
}

No uses #06b6d4 ni rgb(6, 182, 212) — el widget envuelve la variable con rgb(var(--nrn-primary) / <alpha>) y necesita el formato sin función. Si tu design system sólo expone hex, conviértelo a triplete antes de inyectar.

Modo oscuro

El widget detecta el tema vía data-theme="dark" (manual) o por prefers-color-scheme (auto, si theme="auto"). Las variables anteriores son las del modo claro. Para ver los defaults del modo oscuro inspecciona el shadow root con DevTools y revisa el bloque .neuroon-widget[data-theme="dark"]. La forma más portable de adaptar tu marca a ambos modos es definir las dos versiones en el host:

.neuroon-widget { --nrn-primary: 16 206 199; }
.neuroon-widget[data-theme="dark"] { --nrn-primary: 102 240 234; }

Próximas lecturas