I’m having a bit of an trouble getting the sp-
elements to work with CSS/SASS in React.
I can tell my CSS/SASS is building properly (bundled by Webpack) as classes work fine on vanilla HTML elements, but no joy with sp-
elements.
Here’s an example of rendering a div
, sp-body
, sp-label
, and sp-button
each in turn using SASS classes, then CSS classes, and finally with an inline style object : style={{color: 'red', backgroundColor: 'green}}
.
Inline styling works, but neither SASS or SCSS does on any sp-
element I’ve tried.
I’ve also tried this approach:
// Works
sp-body{
color: yellow;
background-color: pink;
}
// Doesn't work
sp-body.variant {
color: yellow;
background-color: pink;
}
It’s not specifically color I’m really interested in, just CSS in general.
I’ve only ever changed CSS in UXP programmatically by directly targeting element styles - is what I’m experiencing the expected behaviour of sp-
elements or am I missing something?