@hansgfixed I've tried to repro, running this command to create my PCF component:
pac pcf init --namespace Long.NameSpace.For --name MyControl --template field
And when rendered, I get this class attribute on my container DIV:
class="customControl Long NameSpace.For.MyControl Long.NameSpace.For.MyControl"
So the container has:
- The customControl indicator class
- The Long root namespace class
- The NameSpace.For.MyControl child namespace class
- The Long.NameSpace.For.MyControl full namespace class
From what you've posted in this thread:
MyPcf.Foo.Bar\.FooBarControl #inputid {background-color: red;}
The issue I'm seeing is the missing . at the beginning of your CSS selector indicating that you're looking for a class not an element named MyPcf, and the other \ characters indicating that this is a long class name that uses dots, not a string of classes on the same element, so this should work:
.MyPcf\.Foo\.Bar\.FooBarControl #inputid {background-color: red;}
Visual Studio Code showing what this CSS selector would match