Open
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- browser version
- SPFx version
- Node.js version
- etc
Describe the bug / error
Want to use custom react library to the webpart
below is component of the react library
import * as React from 'react';
import './style.css';
interface Props {
text: string
}
export const ExampleComponent = ({ text }: Props) => {
return <div className="heading " >Example Component: {text}</div>
}
below is style.css file
.heading {
color: red !important;
}
above class not change color of the text
text color changes when i apply CSS file from the SPFx webpart or inline CSS only works.
How i can use library CSS class for the styling
Steps to reproduce
npx create-react-library
Cd
Npm pack
Install generated .tgz in SPFx Project
use like other library
Expected behavior
Want to affect style clas from the library stylle.css file