Govan
Govan

Reputation: 2129

Is it possible to change the style of CustomComponent caption in Vaadin 8

I am using a CustomComponent inside a VerticalLayout in Vaadin. I want to change the style of caption to bold But it is not working.

My calss as below:

public class MyTab extends CustomComponent implements UpdatableComponent {

    public MyTab() {

        HorizontalSplitPanel panel = new HorizontalSplitPanel();
        panel.setSplitPosition(218, Unit.PIXELS);
        panel.setFirstComponent(createFirstPanelComponent());
        panel.setSecondComponent(createSecondPanelComponent());
        panel.setLocked(true);
        panel.addStyleName("has_border");
        setCaption("This is my title");
        addStyleName("padding-bottom-10px");
        addStyleName("bold-caption");
        }
        setSizeFull();
        setCompositionRoot(panel);
    }

}

I have tried these definitions for "bold-caption" inside my scss file . None of them has worked:

The main question is also how to style caption of custom component in Vaadin inside different layout? Any solution?

Upvotes: 1

Views: 137

Answers (1)

Govan
Govan

Reputation: 2129

I figured this out. I used:

.v-caption.bold-caption {
    font-weight: bolder !important;
  }

Don't forget to remvoe cache and build the application if you are using Vaadin add-ones.

Upvotes: 0

Related Questions