How to change the required indicator?

Can I modify it by java code? Can I put the change in my shared-styles.css?
Thanks

You can change it by overriding the default value of the --lumo-required-field-indicator property in your global stylesheet, e.g.

html, body {
  --lumo-required-field-indicator: "x";
}

It works! Many thanks!