Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap into angular cli builders #1134

Open
mackelito opened this issue Oct 22, 2019 · 4 comments
Open

Tap into angular cli builders #1134

mackelito opened this issue Oct 22, 2019 · 4 comments
Labels
discussion Further discussion with the team is needed before proceeding feature P5 Low-priority issue that needs consideration

Comments

@mackelito
Copy link

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?

@RyanTibbetts-OnScale
Copy link

RyanTibbetts-OnScale commented Oct 31, 2019

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.

@mackelito
Copy link
Author

@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.

@CaerusKaru CaerusKaru added feature P5 Low-priority issue that needs consideration discussion Further discussion with the team is needed before proceeding labels Nov 6, 2019
@CaerusKaru
Copy link
Member

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!

@mackelito
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Further discussion with the team is needed before proceeding feature P5 Low-priority issue that needs consideration
Projects
None yet
Development

No branches or pull requests

3 participants