When I create a role (for rich text box) I am not able to see that role in the dropdown

What I’m trying to do:
Create a role preventing default hover behavior

What I’ve tried and what’s not working:
create a few roles

Code Sample:

# this is a formatted code snippet.
I added these three 
.anvil-role-disable_hover:hover {
text-decoration: none;
color: inherit;
}
.anvi-role-RichText-color {
  a:link {
  color: white;
}

/* visited link */
a:visited {
  color: inherit;
}

}

# paste your code between ``` 

Clone link:
share a copy of your app

Is this a spelling error?

Sure is – but i first tried this one –
.anvil-role-disable_hover:hover {
text-decoration: none;
color: inherit;
}
and it failed – I quickly added the last two – so let me fix that and see if it works, thank you – BRB

Okay I fixed that error and those roles do not show up in the roles field of the richtext component .

Did you make Anvil aware of those roles in the role editor? Anvil doesn’t parse the CSS files looking for role classes automatically - you have to tell it that a role exists!

1 Like