cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

change css style of menu bar(Vuforia studio)

IB_10645210
12-Amethyst

change css style of menu bar(Vuforia studio)

Hi PTC Community,

Please, advise how I can set CSS for the prebuilt navigation menu tab. 

IB_10645210_0-1689101727929.png

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
aletenti2
6-Contributor
(To:IB_10645210)

To change font properties you should use this classes:

 

.list > .item > .button {
  font-size: 20px; 
  font-family: Poppins-ExtraLight;
}

 

 

"Poppins" font is not a default font, so you need to import it into Vuforia Studio. To do that, you should do the following steps:

  1. Create a "Fonts" folder in "..\PROJECT_NAME\src\phone\resources" folder
  2. Import all the .ttf files of the font
  3. Add this CSS code:

 

@font-face {
  font-family: Poppins-ExtraLight;
  src: url('#{$resources}/Fonts/Poppins-ExtraLight.ttf');
}​

 

In my example I selected the "ExtraLight" font version

 

View solution in original post

11 REPLIES 11
aletenti2
6-Contributor
(To:IB_10645210)

Hello,

you can go to the preview mode, right click on the menù and select "Inspect". From there you will see the HTML code of the webpage, in particular the code of the menu. You can play with the existing classes and then add in the CSS section in Vuforia Studio.

aletenti2_0-1689157967221.png

 

Hi, I tried to change the style within the app-theme.css file but the app-theme.css file reset all changes to the original settings and never saves my changes.

Every time I restart the Vuforia Studio project it resets the app-theme.css file to original fonts and etc.

How do you change the CSS ?

aletenti2
6-Contributor
(To:IB_10645210)

You don't need to edit any file in the project folder. You can just click on the "Styles --> Application" menu in Vuforia Studio.

aletenti2_0-1689172152486.png

 

There you can write CSS code.

aletenti2_1-1689172196972.png

 

 

@aletenti2 I am struggling with identifying CSS IDs from all Ionic elements.

Spent too much time yesterday trying to apply CSS to different IDs but I didn't really succeed.

I was able to identify only .menu-content ID.

Do you know the ID for the "Menu" and List of Views on the left side menu?

aletenti2
6-Contributor
(To:IB_10645210)

Hi, try to add the following code in the CSS section.

.bar-stable.bar.bar-header { 
    //CSS rules for Menu header
}

.list > .item {
    //CSS rules for Menu items
}

 

@aletenti2 

For some reason, Typography hasn't changed the style.-only the background color changed.

Please advise how I can change CSS for the Typography of "Menu" and Views.

IB_10645210_1-1689256998289.png

IB_10645210_2-1689257050562.png

 

aletenti2
6-Contributor
(To:IB_10645210)

Try to use only these classes:

aletenti2_0-1689257396148.png

 

The result of my code is this:

aletenti2_1-1689257420685.png

 

Try to add CSS rules to customize your style

I mean background color is changed-it works.

The Typography: font-family -doesn't change.

IB_10645210_0-1689257703439.png

IB_10645210_1-1689257792495.png

 

Update: finally .button ID worked for styling menu buttons for list of Views on a left side.

But... "Menu" didn't work( ......yet

aletenti2
6-Contributor
(To:IB_10645210)

To change font properties you should use this classes:

 

.list > .item > .button {
  font-size: 20px; 
  font-family: Poppins-ExtraLight;
}

 

 

"Poppins" font is not a default font, so you need to import it into Vuforia Studio. To do that, you should do the following steps:

  1. Create a "Fonts" folder in "..\PROJECT_NAME\src\phone\resources" folder
  2. Import all the .ttf files of the font
  3. Add this CSS code:

 

@font-face {
  font-family: Poppins-ExtraLight;
  src: url('#{$resources}/Fonts/Poppins-ExtraLight.ttf');
}​

 

In my example I selected the "ExtraLight" font version

 

@aletenti2 Thank you so much for your guidance. It helps a lot 🙂

Top Tags