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
{{ message }}
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
In accordance with the announcement in the Medium post about this library's future, this is a tracking issue for requesting assistance in migrating complex usages of Angular Layout.
If you believe that your library falls under this case, you can request (or vote on existing) migration guides to other, supported solutions like Tailwind or Angular CDK.
Please use the +1 reaction wherever applicable, and do not comment +1. Those comments will be ignored/deleted.
I appreciate your patience as we go through this process. Until the campaign is complete, the library will still be actively maintained.
In your request, please include the following details:
How many usages you have in your application/library
Which directives/services from this library you are using
Why it is non-trivial to migrate
This will help us prioritize the guides as they are submitted.
Our layout needs, I feel, are pretty straightforward. We're almost exclusively using the fx directives (e.g. fxLayout, fxFlex, fxLayoutGap, fxLayoutAlign) in our components, along with the breakpoint aliases (e.g. fxFlex.md), and it seems like Tailwind might be a good alternative to migrate to for that. The main issue is that tailwind isn't currently supported for Angular libraries (via ng-packagr). Any advice on how to achieve that in a re-usable way (since it'll be used across our component library) without tailwind?
Also, really sorry to see this close down. Appreciate all your hard work over the years keeping it alive.
Reacted by Gerardo Buenrostro González, David Rinck, Alberto Alvarellos González, Janne, Derek Burgman, Mordechai Senderowitz, Carlos Cabrera, Marcos Tabaj, Franweb79, Stefan Charsley and 24 more
It's sad to see this library go away when it was clearly very good! 😕
For me I have no idea where to migrate and what would be even the benefits, but I foresee it to be a very big pain. Our app has ~370 Components and counting and ~4700 attributes in the templates (and we have 3 of those apps). We heavily use fxLayout (cloumn, rows and wraps), fxLayoutGap, fxFlex (with breakpoints and calc), fxFlexFill, fxLayoutAlign, ngClass.*, fxHide and show mostly...
But Thanks a lot @CaerusKaru for all your time and dedication maintaining this library. It has been extremely helpful!
Reacted by Sourav Bhar, Vadim Cereteu, Alexander Kastil, BillyTheKode, RyslanParhom, Marcos Tabaj, bri1990, Roger Siegenthaler, Jim Mackenzie, Merzough Münker and 16 more
We are using flex-layout heavily in one big and several smaller apps.
I hope Tailwind can be a replacement but right now I have no overview of this.
We use this library in our large app ~1.200 times
Breakpoints heavily used all through the app
These are the main directives we use fxLayout fxLayoutGap fxLayoutAlign fxFlex fxFlexFill fxHide fxShow
Thank you for your work on this library and thank you for the planned transition/shut-down period 👍
Reacted by Merzough Münker, fonlow, Rishabh Jain, paco76, Lieven Janssen, Nijomon Jose and Michael Prentice
So so so so so sad. This project is fantastic, I can't believe it comes to an end...
I use this library massively and It will be very hard to something else. I almost use all fxFlex* and fxLayout* features.
I'm not very okay with using tailwind, I hope someone would like to continue to maintain flex layout.
Anyway thanks for everything @CaerusKaru, the job you have done so far is great :)
I know that the angular team have their thoughts about the web standar but this library offers more than just alternative for css , it makes the flex and grid hell( joke) more easy to implement and it provides some directives for breakpoints i mean, its a bit agressive to declare a library -that is commonly used for a bunch of teams in their productions projects- as deprecated, i think that we can keep those directives and other stuff that the library offers ( breakpoints and declarative simplicity on flex grid) and incorporate as default in the framework, that can give angular more unique identity instead to make it more like react.
Reacted by michael faith, Mickaël Olaria, paco76, Nabilah Zaid and Ralf Hundertmark
Override Tailwind’s default breakpoints to matchwith Angular Flex-Layout. For example,theme: {extend: {screens: {‘sm’: { ‘min’: ‘600px’, ‘max’: ‘959px’ },‘lt-sm’: { ‘max’: ‘599px’ }….},}}I personally I didn't need to do this.
[ngClass.xs]=”{‘first’:false, ‘third’:true}”
Use aforementioned responsive APIclass=”gt-xs:first xs:third”
[ngStyle.sm]=”{‘font-size’: ’16px’}”
Use custom CSS classes as mentioned above.
<img src=”a.ico” src.xs=”b.ico”/>
Use custom CSS classes as mentioned above.
gdAreas.xs=”header header | sidebar content”
Tailwind does not have a support forgrid-template-areas so we have to use grid columnsand then apply Grid Row Start/End or
Grid Column Start/End classes on grid items.For example, xs:grid-cols-2xs:grid-rows-2
Use Grid Template Columns classes along with customclasses overriding tailwind config
gdRows
Use Grid Template Rows classes along with customclasses overriding tailwind config
gdGap
Use Gap classes along with custom classesoverriding tailwind config
Reacted by Sourav Bhar, Twois, Carlos Cabrera, BillyTheKode, Stefan Charsley, Bart, Marius Nesser, imckl, Majid Rafei, Arturo Silvelo and 26 more
Reacted by Mickaël Olaria and Errazgouni Saad
Reacted by Pedro Sanguineti Dieguez and Melroy van den Berg
Reacted by michael faith, Johan Faerch, Ray Megal, Flavien Normand, Twois, Stefan Charsley, Hantsy Bai, Alessandro Prete, Merzough Münker, Bart and 17 more
Reacted by Manuel Villegas and Melroy van den Berg
Just now seeing this. This is upsetting news to say the least. I built an entire JsonSchema/ui-schema based platform around angular flex for one of the biggest hospital chains in the country, which only works because of the way angular flex works (using the directives). There really is no alternative that I am aware of.
Have you all considered handing the project off to the community to maintain? Or is the issue some necessary collaboration with the angular team?
Reacted by michael faith, Bryan Yin, Sourav Bhar, Meow Honk, Alberto Alvarellos González, Christopher Wahl, Alexander Kastil, Marcos Tabaj, Francesco Serra, Franweb79 and 15 more
Reacted by Alexander Kastil, paco76 and Melroy van den Berg
Using tailwind is pointless to me. I personally prefer to write few css lines eventually coupled with CDK layout API than over weight my project with a css framework built for people unable to actually write CSS by themself.
I agree with the previous post, if this lib should be maintained by the community it would be fantastic
Reacted by coreConvention, Sourav Bhar, ginxdroid, Marcos Tabaj, WinterNova5, Jack Wootton, paco76, Lugdunum, Lieven Janssen, Sangay Yonten and 6 more
Reacted by michael faith, Gerardo Buenrostro González, Stefan Charsley, Jeffrey Meyer, Bruno de Freitas, Marian Šimeček and Imtiaz Shakil Siddique
<div fxLayoutAlign="justify-between center"> → <div class="space-between items-center">.
Global CSS for common alignments (& inline CSS for uncommon ones):
// Justify content..space-between { justify-content: space-between; } // Used very often with flex-row..justify-center { justify-content: center; } // Used to center something via flexbox.// Align items. (Naming inspiration: https://tailwindcss.com/docs/align-items.).items-center { align-items: center; } // Used very often with flex-row.
fxFlex
<div fxFlex> → <div class="flex-1">.
Global CSS for common flex values (& inline CSS for uncommon values like flex-basis):
// Flex/grow/shrink properties https://developer.mozilla.org/en-US/docs/Web/CSS/flex..flex-1 { flex: 1 } // Same as flex: 1 1 0 (grow, shrink, basis 0). Has similar effect to width: 100%;.flex-grow { flex-grow: 1; } // Same as flex: 1 1 auto (grow, shrink, basis auto). For spacer, etc.
fxHide, fxShow
<div fxHide.xs> → <div class="hide-xs">.
Global CSS for common hide breakpoints (depending on your app):
// Hide & show for different breakpoints..hide-xs { @mediascreenand (max-width: 599px) { display: none; } } // Hide on mobile..hide-gt-xs { @mediascreenand (min-width: 600px) { display: none; } } // Show only on mobile. Hide on desktop..hide-sm { @mediascreenand (max-width: 959px) { display: none; } } // Hide on mobile/tablet..hide-gt-sm { @mediascreenand (min-width: 960px) { display: none; } } // Show only on mobile/tablet. Hide on desktop.
gdColumns
<div gdColumns="XYZ" gdGap="8px"> → <div class="grid gap-8" style="grid-template-columns: XYZ">.
I.e., re-using grid & gap classes from above, and using inline style for grid-template-columns.
ngStyle.xs, ngClass.xs
These are the most challenging to replace - they're one of the nicest features of the flex-layout library.
I didn't find a straight-forward replacement. I just replaced them with custom CSS classes & breakpoints in the CSS file.
For example, <div style="width: 100px" ngStyle.xs="width: 50px"> → <div class="my-div"> + CSS below
@anisabboud this is great. Thanks. Just a note though, ngStyle and ngClass are not part of flex-layout, and won't be affected by its retirement. They're part of angular core.
Reacted by Jim Mackenzie, ygopensource and kamaral
@anisabboud this is great. Thanks. Just a note though, ngStyle and ngClass are not part of flex-layout, and won't be affected by its retirement. They're part of angular core.
i think that he talk about de .sm .xs after the ngStyle or ngClass
Indeed, I was referring to ngStyle.xs & ngClass.xs, etc. (with breakpoints).
But it's an important clarification to make to avoid confusing others, so I updated my post, thanks @michaelfaith!
Reacted by michael faith, Michael Prentice and kamaral
Just a brief reminder for those looking for migration solutions: I've created an open-source tool to help migrate from ngFlex to TailwindCSS. It's not perfect, but it might make the process a bit easier for some!
I've developed a CLI designed to simplify the migration process from flex-layout to tailwindcss. The primary goal of this CLI is to automate the entire process, minimizing the need for manual intervention. Ideally, you should not have to make any additional changes once the CLI completes its tasks.
Here's what the CLI does for you:
It automatically installs tailwindcss.
Removes the old flex-layout dependency.
Converts all directives into tailwindcss classes.
Since it's a CLI tool, you can install it globally and smoothly execute it across multiple projects.
My objective with this CLI is to offer a comprehensive 1-to-1 migration solution. Some existing solutions in the discussion thread do not adequately handle some specific cases, which I have taken care to address.
Please note that this project is still a work in progress. While you can already use the tool, it's currently in a release candidate state. At present, all flex directives are supported, and my next target is to cover grid directives.
no one mentened about a attribute like the following [fxLayoutAlign]="(settings.menuType=='default') ? 'start center' : 'center center'", any idea on converting the above attribute into Tailwind?
Unfortunately, this part may require manual adjustment for now. I'll continue working on finding a solution, but I cannot guarantee a quick resolution to this particular issue. Same story for custom breakpoints.
Feel free to open issues if you notice any problem, any contribution is also welcomed.
I've developed a CLI designed to simplify the migration process from flex-layout to tailwindcss. The primary goal of this CLI is to automate the entire process, minimizing the need for manual intervention. Ideally, you should not have to make any additional changes once the CLI completes its tasks.
Here's what the CLI does for you:
It automatically installs tailwindcss.
Removes the old flex-layout dependency.
Converts all directives into tailwindcss classes.
Since it's a CLI tool, you can install it globally and smoothly execute it across multiple projects.
My objective with this CLI is to offer a comprehensive 1-to-1 migration solution. Some existing solutions in the discussion thread do not adequately handle some specific cases, which I have taken care to address.
Please note that this project is still a work in progress. While you can already use the tool, it's currently in a release candidate state. At present, all flex directives are supported, and my next target is to cover grid directives.
no one mentened about a attribute like the following [fxLayoutAlign]="(settings.menuType=='default') ? 'start center' : 'center center'", any idea on converting the above attribute into Tailwind?
Unfortunately, this part may require manual adjustment for now. I'll continue working on finding a solution, but I cannot guarantee a quick resolution to this particular issue. Same story for custom breakpoints.
Feel free to open issues if you notice any problem, any contribution is also welcomed.
@synopss I have raised couple of issues/PR for your migration. Among the ones I know it is working best out of them, but it lacks in some specific use cases. I will be happy to contribute to it. Let me know if you have enough time to maintain the codebase.
@kiranbs-github This thread has served as a migration guide of sorts, where this excellent community has provided a number of very easy to use alternatives for migrating, running the gamut from static transforms to drop-in replacements (a la @DuncanFaulkner's fork). Unless there are very specific use cases not captured above, in which the community upvotes for a supported approach, this thread (which will remain in perpetuity on the repo) will be the limit of what is provided.
I want to take this opportunity to send my deep thanks and concrete appreciation for the efforts of everyone above. You came together to solve an unexpected, shared problem, and did so in a manner that is truly admirable. You're one of the best open source communities out there, and that does not go unnoticed.
Reacted by michael faith, Chris and mghaoui-interpulse
Activity
michaelfaith commentedon Oct 19, 2022
Our layout needs, I feel, are pretty straightforward. We're almost exclusively using the fx directives (e.g.
fxLayout,fxFlex,fxLayoutGap,fxLayoutAlign) in our components, along with the breakpoint aliases (e.g.fxFlex.md), and it seems like Tailwind might be a good alternative to migrate to for that. The main issue is that tailwind isn't currently supported for Angular libraries (via ng-packagr). Any advice on how to achieve that in a re-usable way (since it'll be used across our component library) without tailwind?Also, really sorry to see this close down. Appreciate all your hard work over the years keeping it alive.
blogcraft commentedon Oct 19, 2022
It's sad to see this library go away when it was clearly very good! 😕
For me I have no idea where to migrate and what would be even the benefits, but I foresee it to be a very big pain. Our app has ~370 Components and counting and ~4700 attributes in the templates (and we have 3 of those apps). We heavily use
fxLayout(cloumn, rows and wraps),fxLayoutGap,fxFlex(with breakpoints and calc),fxFlexFill,fxLayoutAlign,ngClass.*,fxHideand show mostly...But Thanks a lot @CaerusKaru for all your time and dedication maintaining this library. It has been extremely helpful!
jnfaerch commentedon Oct 20, 2022
Sad to see this project close own :(
We are using flex-layout heavily in one big and several smaller apps.
I hope Tailwind can be a replacement but right now I have no overview of this.
We use this library in our large app ~1.200 times
Breakpoints heavily used all through the app
These are the main directives we use
fxLayoutfxLayoutGapfxLayoutAlignfxFlexfxFlexFillfxHidefxShowThank you for your work on this library and thank you for the planned transition/shut-down period 👍
Mikastark commentedon Oct 27, 2022
So so so so so sad. This project is fantastic, I can't believe it comes to an end...
I use this library massively and It will be very hard to something else. I almost use all fxFlex* and fxLayout* features.
I'm not very okay with using tailwind, I hope someone would like to continue to maintain flex layout.
Anyway thanks for everything @CaerusKaru, the job you have done so far is great :)
ianvink commentedon Oct 30, 2022
We have a huge app with about 900 directives from this project. Mostly these directives:
We also have use of many break points like fxFlex.md etc
Interscope19 commentedon Nov 2, 2022
I know that the angular team have their thoughts about the web standar but this library offers more than just alternative for css , it makes the flex and grid hell( joke) more easy to implement and it provides some directives for breakpoints i mean, its a bit agressive to declare a library -that is commonly used for a bunch of teams in their productions projects- as deprecated, i think that we can keep those directives and other stuff that the library offers ( breakpoints and declarative simplicity on flex grid) and incorporate as default in the framework, that can give angular more unique identity instead to make it more like react.
blogcraft commentedon Nov 3, 2022
I started giving (unwillingly) a try to Tailwind CSS. And I was quite surprised as it is not a bad experience at all.
I found a guide here to help migrate from Flex Layout to Tailwind and it's pretty straight forward.
Also, for people using VS Code I recommend getting the Tailwind CSS IntelliSense extension. It is quite useful.
In a nutshell it is this:
fxLayout=”<direction> <wrap>”flex-<direction>flex-<wrap>classesfxLayoutAlign=”<main-axis> <cross-axis>”justify-<main-axis>items-<cross-axis>content-<cross-axis>classesfxLayoutGap=”% | px | vw | vh”gapon flex itemsfxFlex=”” | px | % | vw | vh | <grow> | <shrink> <basis>flex,grow, andshrinkclasses along with customflex-basis classes overriding tailwind configfxFlexOrder=”int”fxFlexOffset=”% | px | vw | vh”fxFlexAlign=”start | baseline | center | end”fxFlexFillandfxFillw-fullandh-fullclassesfxShowandfxHideblockandhiddenclassestheme: {extend: {screens: {‘sm’: { ‘min’: ‘600px’, ‘max’: ‘959px’ },‘lt-sm’: { ‘max’: ‘599px’ }….},}}I personally I didn't need to do this.[ngClass.xs]=”{‘first’:false, ‘third’:true}”[ngStyle.sm]=”{‘font-size’: ’16px’}”<img src=”a.ico” src.xs=”b.ico”/>gdAreas.xs=”header header | sidebar content”Grid Row Start/EndorGrid Column Start/Endclasses on grid items.For example,xs:grid-cols-2xs:grid-rows-2gdAlignColumns=”<main-axis> <cross-axis>”gdAlignRows=”<main-axis> <cross-axis>”gdAutogdColumnsgdRowsgdGapcoreConvention commentedon Nov 3, 2022
Just now seeing this. This is upsetting news to say the least. I built an entire JsonSchema/ui-schema based platform around angular flex for one of the biggest hospital chains in the country, which only works because of the way angular flex works (using the directives). There really is no alternative that I am aware of.
Have you all considered handing the project off to the community to maintain? Or is the issue some necessary collaboration with the angular team?
Mikastark commentedon Nov 3, 2022
Using tailwind is pointless to me. I personally prefer to write few css lines eventually coupled with CDK layout API than over weight my project with a css framework built for people unable to actually write CSS by themself.
I agree with the previous post, if this lib should be maintained by the community it would be fantastic
anisabboud commentedon Nov 4, 2022
I've successfully migrated from flex-layout (~200 usages) to CSS Flexbox + CSS Grid + Angular CDK layout (without Tailwind).
Here are the replacements I made, in case they are helpful to others.
fxLayout="row", fxLayout="col"
<div fxLayout="row">→<div class="flex-row">.Global CSS:
fxLayoutGap
<div fxLayoutGap="8px">→<div class="gap-8">.Global CSS for common gaps (& inline CSS for uncommon gaps):
fxLayoutAlign
<div fxLayoutAlign="justify-between center">→<div class="space-between items-center">.Global CSS for common alignments (& inline CSS for uncommon ones):
fxFlex
<div fxFlex>→<div class="flex-1">.Global CSS for common flex values (& inline CSS for uncommon values like flex-basis):
fxHide, fxShow
<div fxHide.xs>→<div class="hide-xs">.Global CSS for common hide breakpoints (depending on your app):
gdColumns
<div gdColumns="XYZ" gdGap="8px">→<div class="grid gap-8" style="grid-template-columns: XYZ">.I.e., re-using grid & gap classes from above, and using inline style for grid-template-columns.
ngStyle.xs, ngClass.xs
These are the most challenging to replace - they're one of the nicest features of the flex-layout library.
I didn't find a straight-forward replacement. I just replaced them with custom CSS classes & breakpoints in the CSS file.
For example,
<div style="width: 100px" ngStyle.xs="width: 50px">→<div class="my-div">+ CSS belowMediaObserver
Replaced with Angular CDK Layout's BreakpointObserver (which felt faster to me in run-time).
Before:
After:
michaelfaith commentedon Nov 4, 2022
@anisabboud this is great. Thanks. Just a note though,
ngStyleandngClassare not part of flex-layout, and won't be affected by its retirement. They're part of angular core.Interscope19 commentedon Nov 4, 2022
i think that he talk about de .sm .xs after the ngStyle or ngClass
michaelfaith commentedon Nov 4, 2022
Ah, gotcha. Fair enough
anisabboud commentedon Nov 4, 2022
Indeed, I was referring to ngStyle.xs & ngClass.xs, etc. (with breakpoints).
But it's an important clarification to make to avoid confusing others, so I updated my post, thanks @michaelfaith!
90 remaining items
switch angular/flex-lyaout to ngy-layout
lasimard commentedon Sep 25, 2023
Has anyone found a solution for this issue with fxFlex. Our use looks like
<div fxFlex="1 1 auto">Content</div>.c3-flex-1-1-auto {
flex: 1 1 auto;
}
It does not translate 1:1 wjat fxFlex does
Cylop commentedon Sep 25, 2023
Hello Everyone,
Just a brief reminder for those looking for migration solutions: I've created an open-source tool to help migrate from ngFlex to TailwindCSS. It's not perfect, but it might make the process a bit easier for some!
Flex Layout Migrator
Please don't hesitate to check it out, and any feedback is welcome!
Best,
Nicholas
synopss commentedon Oct 1, 2023
Hello,
I've developed a CLI designed to simplify the migration process from flex-layout to tailwindcss. The primary goal of this CLI is to automate the entire process, minimizing the need for manual intervention. Ideally, you should not have to make any additional changes once the CLI completes its tasks.
Here's what the CLI does for you:
Since it's a CLI tool, you can install it globally and smoothly execute it across multiple projects.
My objective with this CLI is to offer a comprehensive 1-to-1 migration solution. Some existing solutions in the discussion thread do not adequately handle some specific cases, which I have taken care to address.
Please note that this project is still a work in progress. While you can already use the tool, it's currently in a release candidate state. At present, all flex directives are supported, and my next target is to cover grid directives.
Unfortunately, this part may require manual adjustment for now. I'll continue working on finding a solution, but I cannot guarantee a quick resolution to this particular issue. Same story for custom breakpoints.
Feel free to open issues if you notice any problem, any contribution is also welcomed.
Link: https://github.com/synopss/flex-layout-to-tailwind
reuse-ay commentedon Jan 18, 2024
This may work about period.
@media screen and (max-width:600px) { [fxHide\.xs]:not([fxHide\.xs="false"]) { display: none!important; } }ayan-bloomscorp commentedon Jan 20, 2024
@synopss I have raised couple of issues/PR for your migration. Among the ones I know it is working best out of them, but it lacks in some specific use cases. I will be happy to contribute to it. Let me know if you have enough time to maintain the codebase.
synopss commentedon Jan 26, 2024
@ayan-bloomscorp thanks for your inputs, I'll check asap.
melroy89 commentedon Apr 13, 2024
Using flex layout with hot cache (fast rebuild) in my Angular app in around 200-300ms:
When I moved to Tailwind also with hot cache a rebuild takes 6500ms+:
Using
tailwindcss/base,tailwindcss/componentsandtailwindcss/utilities. This is 30 times slower than angular flex layout.Uh no thanks. This make rapid development a no go.
I go with the community fork: https://github.com/alessiobianchini/ng-flex-layout
synopss commentedon Apr 13, 2024
@melroy89 I found that issue if that helps you angular/angular-cli#21228
melroy89 commentedon Apr 13, 2024
No, that issue you mentioned is closed without any solution.
I'm gonna use the ng flex layout fork by alessiobianchini I guess for now.
synopss commentedon Apr 13, 2024
Well, if you examine the commit history, you'll see that they worked on it. So, it wasn't necessarily closed without any solution.
But if the fork works fine for you then it's best to keep using it I guess.
kiranbs-github commentedon Aug 22, 2024
@CaerusKaru , please let us know is there any plan to publish a migration guides/blogs ?
CaerusKaru commentedon Aug 22, 2024
@kiranbs-github This thread has served as a migration guide of sorts, where this excellent community has provided a number of very easy to use alternatives for migrating, running the gamut from static transforms to drop-in replacements (a la @DuncanFaulkner's fork). Unless there are very specific use cases not captured above, in which the community upvotes for a supported approach, this thread (which will remain in perpetuity on the repo) will be the limit of what is provided.
I want to take this opportunity to send my deep thanks and concrete appreciation for the efforts of everyone above. You came together to solve an unexpected, shared problem, and did so in a manner that is truly admirable. You're one of the best open source communities out there, and that does not go unnoticed.
mghaoui-interpulse commentedon Aug 23, 2024
Thanks for pointing out to me @DuncanFaulkner 's fork, which in case anybody else is looking is:
You can remove the dicontinued one:
Install the fork:
And change the import:
melroy89 commentedon Aug 26, 2024
@mghaoui-interpulse That is a possibility, note that there is another fork as well.
Remove the discontinued one:
So alternatively, you can migrate to the other fork:
And change the import:
Which fork is better? I dunno.