EnsembleUI / ensemble

Build native apps 20x faster than Flutter, RN or any other tech
https://ensembleui.com/
BSD 3-Clause "New" or "Revised" License
119 stars 15 forks source link

View > header: styles is not applied from Theme #1565

Open Mohammad-Al-Refai opened 1 month ago

Mohammad-Al-Refai commented 1 month ago

I am trying to style View > header from Theme, example: Theme:

Themes:
  - DefaultTheme:
      default: true

DefaultTheme:
  label: Default theme
  Tokens:
    Colors:
      primary: "#0F216B"
      background: "#fafafa"

  Styles:
    # Defaults
    View:
      backgroundColor: ${Colors.background}
      header:
        styles:
          color: ${Colors.primary}
          backgroundColor: white
          surfaceTintColor: white

View:

View:
    styles:
      scrollableView: true
    header:
      title: Home
    body:
      Column:
        styles:
          padding: 24
          gap: 8
        children:
          - Text:
              text: Hi

The changes doesn't applied to the header image

kmahmood74 commented 1 month ago

currently the only way to style the header in themes is to use classes. For example -

  Styles:
    # Defaults
    .header:
      color: ${Colors.primary}
      backgroundColor: green
      surfaceTintColor: black
View:
  styles:
    useSafeArea: true

  # Optional - set the header for the screen
  header:
    titleText: Home
    className: header

we can keep your ticket open and see when we can get to it. But you shoud not be blocked