Component's main text font size

#1

I’ve a UI component like this:

ui module MyModule {
  component MyComponent {
    "component": "MetricTile",
    "icon": "",
    "height": 100,
    "width": 100,
    "noDataText": "{~MyModule.Tile.noDataText~}",
    "mainText": {
      "color": "#06a7e0",
      "precision": 0,
      "postText": "{~MyModule.MyComponent.postText.Alerts~}"
    },
    "data": {
      "record": "MyModule.MyComponentMain"
    }
  }
}

How I could set the font size for the whole text that will be resulted from mainText?

0 Likes

#2

The workaround is to give the component a css class then define use this class to select the element and define the font size. So the changes are:

1- In MyComponent.c3ui add:

ui module MyModule {
  component MyComponent {
    . . .
    "cls": "myComponentClass",
  }
}

2- In index.less or theme.css add:

div.myComponentClass span#content {
  font-size: 24px;
}
0 Likes