Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Container/Element based media queries #218

Closed
intellix opened this issue Mar 14, 2017 · 2 comments
Closed

Container/Element based media queries #218

intellix opened this issue Mar 14, 2017 · 2 comments

Comments

@intellix
Copy link

intellix commented Mar 14, 2017

I'm creating a site that has sidebar that can either be shown or hidden. When the sidebar is open, there's less space for the content so it makes sense that I change how things are displayed inside the main area.

Currently as far as I know, the Responsive API is all based off of the Viewport width. Is it possible to use the Responsive API for a specific container's width?

I imagine that it would require a directive to specify which container I'd like to target and then have all children pointing to that.

<sidebar fxFlex="300px" *ngIf="sidebarEnabled"></sidebar>
<section fxMediaContainer>
  <article fxFlex.sm="50%" fxFlex.md="33.333%" fxFlex.lg="25%"></article>
  <article fxFlex.sm="50%" fxFlex.md="33.333%" fxFlex.lg="25%"></article>
  <article fxFlex.sm="50%" fxFlex.md="33.333%" fxFlex.lg="25%"></article>
</section>

Added a plnkr of a dynamically visible navigation and chat. When both items are open, the container is very small and I would like to alter how the items inside are displayed: https://plnkr.co/edit/TENLYtc5BmUZC0sWliW7?p=preview

As a workaround/hack, it looks like I'll have to use the API to reduce the breakpoints when the sidebar is toggled

@intellix intellix changed the title Container based media queries Container/Element based media queries Mar 15, 2017
@ThomasBurleson
Copy link
Contributor

You are interested in Constraint Grid CSS similar to the Mac OS Cassowary Autlayout.

That is not supported within @angular/flex-layout. That would best be done in @angular/constraint-layout... a solution which is already on our radar.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants