Change the style of the captions of TextField, OptionGroup, ComboBox, etc

I want to modify the default caption style of a TextField, OptionGroup, ComboBox , etc. If I use the vaadin css class for caption , .v-caption, it modifies the caption of all the components. I tried to override the default class in the following ways, but it doesn’t work. Can anyone please suggest how it can be done.

  1. //CSS

.v-caption-mystyle {

font-weight: bold;

font-size: 15px;
}

//Java Code

TextField tf=new TextField(“UserName”);

tf.addStyleName(“mystyle”);

  1. //CSS

.v-caption .v-mytextfieldCaption {

font-weight: bold;

font-size: 15px;
}

//Java Code

TextField tf=new TextField(“UserName”);

tf.addStyleName(“v-mytextfieldCaption”);

Thanks in advance