You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to load a style.css file to customize some elements in my Strapi plugin, but the file is not being rendered or loaded in the DOM.
I've created a component with an associated CSS file and imported it into my .tsx file. When I build the project, both files are included in the dist folder, but the styles are not applied in the Strapi admin panel.
Do you have any suggestions on how I can properly load my CSS in Strapi?
To Reproduce
Create a com1ponent with a CSS file
Add a MyComponent.tsx file inside the admin/src/components folder.
Add a style.css file inside the same folder.
Import the CSS file in the component
Import css
import "./style.css";
const MyComponent = () => {
return <div className="custom-style">This is my component</div>;
};
export default MyComponent;
Ensure the CSS file is included in the build output
3/Ensure the CSS file is included in the build output
Run "yarn run watch:link" in the plugin repository to watch for changes.
4.Run Strapi and check the Admin UI
In a separate Strapi project, install the plugin via yalc add strapi-plugin-name.
Start Strapi with "yarn run develop".
Navigate to the plugin interface in the Strapi Admin Panel.
Observe that the styles from style.css are not applied.
Expected Behaviour
The style.css file should be loaded and applied to the component in the Strapi Admin Panel.
The text was updated successfully, but these errors were encountered:
What version of
@strapi/sdk-plugin
are you using?-Strapi V5
-@strapi/[email protected]
[email protected]
What's Wrong?
I'm trying to load a style.css file to customize some elements in my Strapi plugin, but the file is not being rendered or loaded in the DOM.
I've created a component with an associated CSS file and imported it into my .tsx file. When I build the project, both files are included in the dist folder, but the styles are not applied in the Strapi admin panel.
Do you have any suggestions on how I can properly load my CSS in Strapi?
To Reproduce
Add a MyComponent.tsx file inside the admin/src/components folder.
Add a style.css file inside the same folder.
Import the CSS file in the component
Ensure the CSS file is included in the build output
3/Ensure the CSS file is included in the build output
Run "yarn run watch:link" in the plugin repository to watch for changes.
4.Run Strapi and check the Admin UI
In a separate Strapi project, install the plugin via yalc add strapi-plugin-name.
Start Strapi with "yarn run develop".
Navigate to the plugin interface in the Strapi Admin Panel.
Observe that the styles from style.css are not applied.
Expected Behaviour
The style.css file should be loaded and applied to the component in the Strapi Admin Panel.
The text was updated successfully, but these errors were encountered: