Skip to content

Provide a method for InlineSpan to override the styles of its children #177952

Open

Description

@Renzo-Olivares

Issue

I'd like to be able to override the styles of all children of an InlineSpan tree. Currently each InlineSpan has a local representation of its TextStyle and InlineSpan children, so you cannot simply wrap an InlineSpan with another InlineSpan and expect the parents InlineSpan.style to override it's child's. This is by design, since nested spans can define their own TextStyles.

Proposal

InlineSpan should have some mechanism to override the TextStyles of its InlineSpan children. Currently textScaler is able to penetrate an entire InlineSpan tree because the InlineSpan.build method has a textScaler member. We can take a similar approach and add individual styling members to the build method as needed or we can add a style argument that is passed down to all children.

Use case

For accessibility use cases like updating text spacing settings to match certain standards like WCAG, it is required to be able to change the spacing settings of all text. Currently with InlineSpans this can only be done at the root of the span tree, and if children spans locally define their own styles there is no method to change their styles outside of recreating the span itself. Recreating the span itself is not a robust solution since you can only do this for InlineSpans subclasses you own.

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    a: typographyText rendering, possibly libtxt
    P2Important issues not at the top of the work list
    on Nov 6, 2025
  2. shivanuj13 commented on Nov 18, 2025

    @shivanuj13
    Contributor

    Since the requested feature has already been merged into master, can we close this issue now?

  3. Renzo-Olivares commented on Nov 18, 2025

    @Renzo-Olivares
    ContributorAuthor

    Hi @shivanuj13, this issue should remain open. The PR that landed did not land this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions