flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

Tap into angular cli builders

Open mackelito opened this issue 6 years ago • 4 comments

Feature Request

What is the desired behavior?

Not even sure if this is possible but it would be kind of sweet if the cli could build/generate external css files to be used instead of inline styles.

What is the use-case or motivation for the desired behavior?

When using fxlayout="row" js adds inline styles to the element. Having the cli generating reusable classes would mean less code and less inline css on the pages :)

Is there anything else we should know?

mackelito avatar Oct 22 '19 07:10 mackelito

You can kinda do this already to a degree. I used fx and grid as object data in a component recently by creating a grid object ts class that looked like this:

{
    xs: string;
    sm: string;
    md: string;
    lg: string;
    xl: string;
}

so I would merely make an object:

gridAreas: GridObject = { ... }

and call it in the html like so

[gdAreas.xs]="gridAreas.xs" [gdAreas.sm]="gridAreas.sm" [gdAreas.md]="gridAreas.md" ...

But I do agree that at least allowing for something like this to all be one attribute or something would be a nice feature, I'm not sure it would be easy to understand though as the norm.

I do NOT suggest using grid as the norm for components that take in data like this though. Sadly grid does not support dynamic data interaction with the fxShow, use fx for now until they add the feature.

RyanTibbetts-OnScale avatar Oct 31 '19 19:10 RyanTibbetts-OnScale

@RyanTibbetts-OnScale I think you misunderstood what I'm after :)

My wish is that the build would extract attributes such as fxLayout etc and generate static css instead of writing inline styes on the elements.

mackelito avatar Nov 01 '19 07:11 mackelito

I've discussed this offhand with @mgechev. The current understanding is that we would need to build the entire toolset to accomplish this; there are no shortcuts. That means parsing, outputting, etc. I'm open to community contributions but this is currently out of scope for us. I love the idea though!

CaerusKaru avatar Nov 06 '19 04:11 CaerusKaru

I understand that it would be alot of work.. but the performance would really get a boost for larger and more complexed apps so perhaps it would be worth it..

I'm not even sure where this should even begin so I'm not the man for the job but if others find this interesting then I would contribute in every way I can :)

mackelito avatar Nov 06 '19 12:11 mackelito