In my current React project, I am facing an issue with the CSS styles being applied globally to all elements within the body. I have a new component that I want to add without inheriting these global styles. Is there a way to exclude this particular component from the global styling?
globalStyle('body', {
WebkitFontSmoothing: 'antialiased',
});
I have attempted various solutions but none have worked:
Tried defining a new global style targeting the component by className with WebkitFontSmoothing set to 'never'
Using globalStyle('body:not(.testing)', { WebkitFontSmoothing: 'antialiased', MozOsxFontSmoothing: 'grayscale'});
Experimented with custom CSS using !important