Skip to content

fontFamily from className/style classes not applied to Text widgets #2155

@TheNoumanDev

Description

@TheNoumanDev

When a fontFamily is specified inside a style class (className) definition in theme.yaml, it is not applied to Text widgets at runtime. Other properties in the same class (like fontSize, fontWeight) also appear unaffected when fontFamily is present.

Steps to reproduce:

Define a style class in theme.yaml:

Common:
  Styles:
    .myHeaderStyle:
      textStyle:
        fontSize: 24
        fontWeight: w900
        fontFamily: Metric_Black

Apply it to a Text widget:

- Text:
    text: Hello
    className: myHeaderStyle

The text renders with the default font — fontFamily, fontSize, and fontWeight from the className are not applied.
Expected behavior: The Text widget should render with Metric_Black font at size 24 with weight w900.

Workaround: Apply textStyle properties inline on the widget's styles instead of via className:

- Text:
    text: Hello
    styles:
      textStyle:
        fontSize: 24
        fontWeight: w900
        fontFamily: Metric_Black

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions