I think there's a good chance this is related to RT-16215, but since it doesn't require applying custom CSS classes to trigger this error I thought it best to file separately.
If you create a CustomMenuItem whose node references a constant color defined in your CSS .root class via its inline style (set through setStyle()), an error is thrown because it can't resolve the color definition. In my attached sample app, you'll see that I can successfully reference the color/paint definition "-pal-SystemBlue" defined in test.css on my top-level SplitMenuButton, but the HBox that is contained within a CustomMenuItem cannot reference it without causing errors.
If you create a CustomMenuItem whose node references a constant color defined in your CSS .root class via its inline style (set through setStyle()), an error is thrown because it can't resolve the color definition. In my attached sample app, you'll see that I can successfully reference the color/paint definition "-pal-SystemBlue" defined in test.css on my top-level SplitMenuButton, but the HBox that is contained within a CustomMenuItem cannot reference it without causing errors.