How to use Font icons in scss

Hi, I want to use new font icons in scss like below

.split .v-button-wrap:before
content: “\e683”;

I installed addon but failed to get proper icon as per shown in
This link
. It displays some chineese icons. What should I do?

Thanks in advance.

Hi Kshitij,

you don’t need to use scss to add the Icons to your button.

As described in your link (Vaadin Icons Add-on > step 4) you can do the following:


just follow the steps in your Link. (

best regards


Thank You JohannesL,
But what if i want to make my application responsive? I wanna show caption as well as Icon when application opened on laptop or desktop device with small icons… but when same app is opened in Tablet it will show big icon without caption. Is that possible?

Thanking you in advance

if I use following code

split = new Button("Departments"); split.setIcon(VaadinIcons.AIRPLANE); split.setStyleName(ValoTheme.BUTTON_BORDERLESS); see what i get from this (Please find attachment)
it must display Airplane ICON i guess…


Yes you can make your application responsive.

There is an scss approach and a plain Java approach.


Plain Java:

Project example:

“if I use following code
split = new Button(“Departments”);
see what i get from this (Please find attachment)”

I don’t know what result you expect but be careful with using “component.setStyleName(…)”, because it overrides your other styles set on your component as described in the javadoc (
​"Sets one or more user-defined style names of the component, replacing any previous user-defined styles."
) .



EDIT: also check the valo demo for examples

I was expecting
This ICON. I
t shows me bold arrow instead. And I am not fully satisfied with your solution.
BTW thank you for other Important links.

Is there a specific reason why you don’t want to use the build in icons (FontAwesome). You only need to import different font icons when you are not satisfied with the default ones.

see also for icon styling/usage:

for example:


Yeah. I did it using FontAwesome but I wanted to do it using SCSS as explained by Jouni Koivuviita in Responsive Layout webinar

I don’t know what your current problem is. You can get all information you need for creating a responsive layout with the links i provided.

Since it seems that you don’t even glance through the links i posted, i wrote a quick example for creating a responsive Icon.

Java code:

 Label responsiveIcon = new Label(FontAwesome.PLANE.getHtml(), ContentMode.HTML);





/* Basic settings for all sizes */
.responsive {
padding: 5px;
line-height: 36pt;

/* Small size */
color: blue;
font-size: 16px;

/* Medium size */
color: pink;
font-size: 24px;

/* Anything bigger */
color: green;
font-size: 36px;
[/code]Please check the vaadin wiki / project links and search the forums for more info about responsive layouts/icons/components or post a more detailed question. :slight_smile:

best regards


This is better example. Thank you very much…

“Since it seems that you don’t even glance through the links i posted, i wrote a quick example for creating a responsive Icon.”

I already went through the links you posted earlier but I couldent construct the proper solution. I actually wanted to set icons to button using Hex codes as jouni did in his workshop. (Please find attachment below… see the scss theme in eclipse… “\e004” etc are used to generate icons )

Thank You and Sorry for so much trouble :slight_smile:

Hey Kshitij,

You were most likely missing “font-family”. You can do the following:


Button btn1 = new Button("Testing");

Button btn2 = new Button("Testing");


.test .v-button-wrap:before {
  content: "\f042";
  font-family: FontAwesome;

Added attachment. Btn1 at top, btn2 at the bottom.

Hello All,

I want to add font awesome icon for one button.
and I have tried both the options:

  1. pdf.setIcon(FontAwesome.DOWNLOAD);

  2. pdf.addStyleName(“icon”);
    .icon .v-button-wrap:before {
    content: “\f019”;
    font-family: FontAwesome;

But both of them are not working.
Please help me . I really need to find out the solution.

Anjali Jain

Hello All,
now its working. Actually i have added icon in design also. Thats why it was not working . I have removed the icon from design and apply the above mentioned solution and its working. Sorry for the above post.
Anjali Jain