Is there any CSS to change the tab label dynamically?
@Himaladin any help would be appreciated ![]()
Here I’m only providing an example for the top-side tab layout, since you didn’t specify the appearance settings you’re using:
<div class="flag" data-status="unChange"></div>
#page-root:has([data-status="Change"]) #nav-root nav > button:nth-child(2)::after {
content: "My Label";
}
#page-root:has([data-status="Change"]) #nav-root nav > button:nth-child(2) > div:nth-child(2) {
display: none ;
}

I modified the previous code so that the button width automatically adjusts to the text width.
This is an addition to the Side-bar and mobile nav menu.
Side Menu
#page-root:has([data-status="Change"]) nav li:nth-child(2) > button > span {
display: none;
}
#page-root:has([data-status="Change"]) nav li:nth-child(2) > button::after {
content: "My Label";
}
Bottom Nav (mobile)
#page-root:has([data-status="Change"]) .main-nav button:nth-child(2)::after {
content: "My Label";
font-size: 10px;
color: var(--gv-text-contextual-accent);
margin-top: 0.125rem;
}
#page-root:has([data-status="Change"])
.main-nav button:nth-child(2) > p {
display: none;
}
KING!
Thank you so much. I will test and let you know.
@Himaladin, could you please share a screen recording doing this? It didn’t work for me
Not sure what am I doing wrong.
@Hassan_Nadeem,
Place your <div class="flag" data-status="Change"></div> inside a Rich Text component (or one sourced from a user profile table), and make sure it exists on every screen where your tab label needs to appear.
Then, copy the rest of the code into the Custom CSS box.
Please refer to:
CSS Hack: Dynamic CSS in Glide
Additionally, for your information — the **data-status** (attribute) approach allows for more complex conditional styling. However, if your condition only has two states (`Change` and `unChange`), you can simplify the setup by using a **permanent class name** and control visibility directly through the Rich Text component itself.
In that case, within the CSS code I shared earlier, simply replace every
#page-root:has([data-status="Change"]) with #page-root:has(.flag)
If you’ve done the same thing above, then I suspect you have “use compiled CSS” enabled. If so, turn it off so you can embrace the broader future of CSS.
I offer two options to solve your problem:
- Add #page-root in front of all your non-functioning CSS selectors if you want to use my suggestion.
- Remove #page-root from my code if you still want to use the button enabled option.
However, I still recommend using the first option.
I have a very little knowledge about CSS so not really sure where to add #page-root in my other CSS?
I don’t want my entire app to be RTL. I have applied it on selected screens. Does the #page-root mean it will be applied on the entire app regardless of any class?
You just need to add #page-root in front of your selector to make your CSS rule work again. Replace:
.rtl-form * {
direction: rtl;
text-align: right;
}
with:
#page-root .rtl-form * {
direction: rtl;
text-align: right;
}
Note: Turn off the “Use compiled CSS” toggle.
A little experiment for you, if you want all your applications to use rtl:
#page-root {
direction: rtl;
}
or
#main-root {
direction: rtl;
}
Looks like it worked. Thank you so much boss.
