[bug]:
Maintainers usually reply within 6 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- css, react, typescript
- Domain
- frontend
Research direction
Start with admin/src/components/MyComponent.tsx and its imported style.css, then reproduce the issue using yarn run watch:link, yalc add strapi-plugin-name, and yarn run develop. Inspect the built plugin and Strapi Admin UI to determine why the CSS is present in dist but not applied. Done means the custom-style rules from style.css are loaded and visible in the Admin Panel.
Written by the indexing model from the issue text.
Description
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
- 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.
- Dominant language
- TypeScript
- Stars
- 24
- Forks
- 13
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from strapi/sdk-plugin
-
Difficulty 4/5 Half a day Newbie friendliness 15/100
strapi/sdk-plugin#244 ·
Maintainers usually reply within 6 days
-
[bug]: build ignores exports file names and package.json#type, breaking "type": "module" pluginsPossibly taken @unrevised6419 claimed this 43 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
strapi/sdk-plugin#242 ·
Maintainers usually reply within 6 days
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
strapi/sdk-plugin#241 ·
Maintainers usually reply within 6 days
-
[feat]: build a subset of bundles with --bundle, for per-bundle task cachingPossibly taken @unrevised6419 claimed this 51 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
strapi/sdk-plugin#238 ·
Maintainers usually reply within 6 days
-
[bug]: When building with latest sdk-plugin version, I loose sub folders typesMay be free again @jhoward1994 claimed this 247 days ago, and no pull request is open. Openissue: bug
strapi/sdk-plugin#115 · 2 comments · 1 assignee ·
Maintainers usually reply within 6 days
All issues in strapi/sdk-plugin
Similar issues
-
Add: BOM CineOpenapproved check:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug platform-android
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Termix-SSH/Mobile#146 · 1 comment ·
Maintainers usually reply within 2 days
-
MCP mcp-feedback-pattern
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/toolkit#2276 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
devswha/herdr-web-ui#3875 ·