Font size in label

I have tried to change the font for the label like this:

@import “…/reindeermods/styles.css”;

.smallerFont .v-label-caption {
font-size: 8px;
line-height: normal;
}

Label label = new Label(“Label”);
label.setWidth(LABEL_WIDTH);
label.setStyleName(“smallerFont”);

But for some reason it doesn’t work.

You got quite close. There’s no such element as “.v-label-caption”. The “smallerFont” style is applied directly to the element that contains the label text, so the following will suffice:

.smallerFont {
    font-size: 8px;
    line-height: normal;
}

Note, though, that there might be some more specific selector that overrides the above selector, so adding e.g. “body” or “.v-app” before the “.smallerFont” might be necessary.

Ok. Thanks. That helped. :slight_smile:

How can I change the top spacing for the gridlayout. I’ve tried like this:

.smallerSpacing {
padding-top: 2px;
}

calendarLayout.setStyleName(“smallerSpacing”);

But this doesn’t seem to work.