Skip to content

Banner: info-status icon is hard-coded to Icon color="accent", unreachable by 'status:info' theme overrides #4166

Description

@josephfarina

Summary

Banner renders its status="info" icon as <Icon color="accent">. The banner surface itself can be themed via the documented component overrides ('astryx-banner' / 'astryx-banner-icon' with 'status:info'), but those only style the wrapper elements — the inner .astryx-icon span carries data-color="accent" and keeps the accent color.

On themes whose accent is not a calm blue this breaks the semantics of the status system: our theme's accent is red (#DC2626), so every info banner ships a red (i) icon — visually indistinguishable from an alert. The same accent-fallback applies to Badge variant="info", though Badge at least is fully recoverable via 'variant:info' overrides; the Banner icon is not.

Repro

// theme
export const theme = defineTheme({
  tokens: { "--color-accent": "#DC2626" /* red accent */ },
  components: {
    banner: { "status:info": { backgroundColor: "#67E8F91A" } },
    "banner-icon": { "status:info": { color: "#67E8F9" } },
  },
});
<Banner status="info" title="Mode: shadow" description="Nothing actually delivers." />

Rendered DOM (core 0.1.2):

<div class="astryx-banner card info ..." data-container="card" data-status="info">
  <div class="astryx-banner-icon info ...">              <!-- override applies: color #67E8F9 -->
    <span class="astryx-icon md accent ..." data-color="accent">  <!-- stays red -->
      <svg stroke="currentColor" ...>

getComputedStyle confirms: banner-icon wrapper color: rgb(103, 232, 249) (override works), inner svg stroke: rgb(220, 38, 38) (accent, unreachable).

Expected

Either of:

  • the status icon uses currentColor / inherits from .astryx-banner-icon so 'status:info' overrides reach it, or
  • info status resolves through a dedicated token (e.g. --color-info, accent as fallback) that themes can set.

Workaround

A descendant rule outside the theme DSL:

.astryx-banner-icon.info .astryx-icon { color: #67e8f9; }

…which has to be hand-maintained since astryx theme build output can't express it.

Related: the accent-fallback for info semantics generally (Badge variant="info", Banner status="info") might deserve a --color-info token — happy to split that into a separate issue if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions