Steve Waters
Steve Waters

Reputation: 3548

How to make ComboBox caption bold in Vaadin?

I created my own style in styles.scss:

.p-bold-caption .v-caption .v-captiontext {
    font-weight: bold;
}

Then in the code I add the style like so:

myComboBox.setStyleName("p-bold-caption");

Nothing happens. It's still not bolded. How to do this? I suck at css, but I've managed to make and use my own styles in the styles.scss. Not sure if I'm doing the css-selector syntax correctly here.

Upvotes: 2

Views: 1376

Answers (2)

Omar Palaming
Omar Palaming

Reputation: 19

    ComboBox cbDropdown = new ComboBox();
    cbDropdown.setCaptionAsHtml(true);
    cbDropdown.setCaption("<h2><b>"+ pDisplayName +"</b></h2>");

Upvotes: 1

Dragan Radevic
Dragan Radevic

Reputation: 801

Css can be:

.v-caption-p-bold-caption .v-captiontext {
    font-weight: bold;
}

and please don't forget to recompile theme and clean browser cache.

Upvotes: 4

Related Questions