-
-
Notifications
You must be signed in to change notification settings - Fork 182
Callout css does not work when importing to frontend #569
Comments
@jackcmeyer I would like to try solving this, but I'm not exactly sure how to test it. Since the front end and component libraries are separate repos, how can I test what effect the changes to the component library have on the front end? This seems tricky since they are running on completely separate dev servers. At first glance, it seems that the SCSS isn't being imported or compiled correctly in the build files, either due to a configuration issue with Webpack, or possibly due to an issue with the structure of the class names. The only components that have their own SCSS files are the callout and the toaster. Comparing the two files, it seems that the toaster follows a different naming convention (BEM) than the callout. The toaster uses selectors like |
Checkout the |
@jackcmeyer One other question: this is the first project I've worked on where the components and main front end codebase are separate repos. Is it possible to enable live reloading between repos? Meaning that if I change a component in the component repo, the front end updates that component immediately? Or do I need to rebuild the project and relink it every time there is a change? Thanks. |
Once you link it, every time you rebuild it should pick up the changes. You should be able to run the components repo in watch mode, so I think you should get a near live reload experience. I believe the only thing you'd need to do is restart frontend repo. |
@jackcmeyer I finally figured out how to link the two repos. It was not straightforward and involved several steps. Perhaps we should add some instructions to the readme? In case anyone is wondering these were the steps I took:
The reason you are seeing this message is because the component library is trying to run React from it's own node_modules folder, when it should be running the same copy as the front-end repo. To fix this you should:
Let me know if you have a simpler way of doing this. This is just what worked for me. |
|
🎉 This issue has been resolved in version 2.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@fox1t Yes I can take a look at that over the weekend. |
…also relate to HospitalRun#254 HospitalRun#569) Ship components package with header injected styles (also relate to "fix HospitalRun#254" "fix HospitalRun#569"). We inject SCSS as <style> into <head> including bootstrap styles during the build process. This way we can skip shipping & referencing of .scss files. Please note: now that there's no need for a .scss references in the front-end, the main.scss reference in the front-end must be removed. BREAKING CHANGE: we skip shipping & referencing of main.scss files. Now that there's no need for a .scss references in the front-end, the main.scss reference in the front-end must be removed. "fix HospitalRun#254", "fix HospitalRun#569"
Ship components package with header injected styles (also relate to "fix #254" "fix #569"). We inject SCSS as <style> into <head> including bootstrap styles during the build process. This way we can skip shipping & referencing of .scss files. Please note: now that there's no need for a .scss references in the front-end, the main.scss reference in the front-end must be removed. BREAKING CHANGE: we skip shipping & referencing of main.scss files. Now that there's no need for a .scss references in the front-end, the main.scss reference in the front-end must be removed. "fix #254", "fix #569"
# [3.0.0](v2.0.1...v3.0.0) (2020-09-15) ### Bug Fixes * **component:** ship components package with header injected styles ([afee9ff](afee9ff)), closes [#254](#254) [#569](#569) [#254](#254) [#569](#569) ### BREAKING CHANGES * **component:** we skip shipping & referencing of main.scss files. Now that there's no need for a .scss references in the front-end, the main.scss reference in the front-end must be removed.
🎉 This issue has been resolved in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🐛 Bug Report
When trying to use the Callout component in the @hospitalrun/frontend, the CSS does not work.
To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: