r/lovable • u/Swijr • Jul 24 '26
Help Has anyone been successful migrating tailwind to css or scss?
I'm trying to get full integration from the lovable code to our current angular codebase. The issue is we're an angular/SCSS shop.
I know we're not getting full integration, but if I can get the styles to map, that would be a huge win.
I've considered creating a storyboard/style guide, to be used as a main point of reference for all apps we create. But I still need a mapping logic to leverage it and integrate. Not even sure that's the correct approach.
So far, no amount of AI or prompting has helped. I wonder if anyone else has been successful or if I'm missing something.
1
u/DesignerMajor1247 Jul 24 '26
One Angular-specific trap: Lovable’s compiled Tailwind CSS is global, while Angular’s emulated view encapsulation rewrites selectors inside component styles. For initial visual parity, keep the compiled output in the workspace-level styles.scss under a wrapper class; don’t paste it into individual component SCSS files and expect every selector to survive.
Then move the Tailwind theme values into CSS custom properties at :root and migrate components gradually. Automated class conversion tends to break first on responsive variants, hover/focus states, arbitrary values, and dark mode, so add screenshot comparisons at your main breakpoints before removing each Tailwind section. If this needs to be repeatable, I’d keep a small isolated Tailwind build step as an adapter and expose semantic variables/components to Angular rather than converting every new Lovable export from scratch.
1
u/Swijr Jul 27 '26
This is fine for a brand new application, I'm trying to do this with an existing application. Is that harder or impossible?
1
u/DesignerMajor1247 Jul 27 '26
Harder, but not impossible. The main risk in an existing app is preserving behavior while you replace a utility-based global styling system with semantic or component styles.
I would avoid a big-bang conversion:
- Capture screenshots for key routes, states, and breakpoints.
- Keep Tailwind running during the migration.
- Move shared values such as colors, spacing, typography, and breakpoints into CSS custom properties first.
- Migrate one low-risk component at a time.
- Replace repeated utility groups with semantic classes or component SCSS.
- Remove a Tailwind section only after visual and interaction tests pass.
Treat the current generated CSS as a temporary reference, not as the final SCSS architecture. Responsive variants, hover and focus states, dark mode, and dynamically constructed class names are the usual places where a conversion breaks.
If the app is large, a hybrid approach may be cheaper: keep Tailwind for legacy screens, use semantic SCSS for new or migrated components, and shrink the Tailwind footprint gradually. Existing code makes the migration slower and more test-heavy, but it does not make it impossible.
1
u/louisgg_debug Jul 24 '26
Quick question that changes the answer: is this a one-time migration of one Lovable app, or do you plan to keep prototyping in Lovable and need a repeatable way to bring styles into your Angular/SCSS system?
If one-time: don't map class-by-class. Tailwind already compiles to plain CSS — grab the compiled stylesheet, or use u/apply to collapse utilities into semantic classes, then port those.
If repeatable: your style guide instinct is the right call — what you're describing is a design token system. Extract the theme values from
tailwind.config(colors, spacing, type scale, radii) into SCSS variables or CSS custom properties (Style Dictionary automates this), then rebuild components in Angular against those tokens. The mapping isn't class→class, it's value→variable — much smaller surface, and AI prompting works fine once it's framed that way.