---
title: "Discussion on \"Injecting Micro-Frontend CSS in single-spa\" | Hashnode"
description: "Discussion on \"Injecting Micro-Frontend CSS in single-spa\". Learn a simple and framework-independent way of injecting CSS for micro-frontends in single-spa applications."
url: "https://hashnode.com/posts/injecting-micro-frontend-css-in-single-spa/64d94bdd99cda42d083b00de"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Injecting Micro-Frontend CSS in single-spa](https://webjose.hashnode.dev/injecting-micro-frontend-css-in-single-spa?utm_source=hashnode&utm_medium=feed)

Learn a simple and framework-independent way of injecting CSS for micro-frontends in single-spa applications.

Aug 13, 2023 · 14 min read · webjose.hashnode.dev  
Read the article

-   [#single-spa](https://hashnode.com/tag/single-spa)
-   [#vite](https://hashnode.com/tag/vite)
-   [#microfrontend](https://hashnode.com/tag/microfrontend)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[José Pablo Ramírez Vargas](https://hashnode.com/@webJose)

@webJose

  
[View profile](https://hashnode.com/@webJose)

Senior Software Developer @ Intel

## Responses 1

Markdown supported · ⌘↵ to post

[Björn](https://hashnode.com/@ibjorn)

[Jun 10, 2024](https://hashnode.com/posts/injecting-micro-frontend-css-in-single-spa/64d94bdd99cda42d083b00de/comment/6666aef33f6a7594747a68d1)

Hi José. Thanks for an excellent series. This has actually helped me understand single-spa much better. I've been following along, but instead of setting up a React mife, I set up a Vue mife as this is the scenario that I need it for. After following this article, and having implemented, first the implementation above and also after changing to the new cssLifecycleFactory, I've found that running in `dev` my application inherits the CSS from the root app, however, when navigating to `/mifea`, the mife's CSS takes precedence. When running `build` and then `preview`, it sticks to the root app's CSS. You don't perhaps have an example of a Vue mife implementation?

[José Pablo Ramírez Vargas](https://hashnode.com/@webJose)

[Jun 10, 2024](https://hashnode.com/posts/injecting-micro-frontend-css-in-single-spa/64d94bdd99cda42d083b00de/comment/6666aef33f6a7594747a68d1#reply-66671946acdcaa3769ab640a)

Hello, I don't have any examples on Vue right now, but sounds like you have some CSS bleeding. You probably need to re-think the root CSS as you have it right now. If your root is framework-powered, and that framework can do scoped CSS, make use of that. Other than that, there is no difference between how you use `cssLifecycleFactory` in Vue vs how to use it in other frameworks. If you need more help, open a discussion in GitHub. There we can share information much better than comments in here.
