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

Adding responsive feature to the element #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sandro-k
Copy link

@sandro-k sandro-k commented Aug 5, 2015

Thanks for wrapping the Dygraphs within a Polymer element. I needed the element to be responsive and adapt to the size of the container.

@timeu
Copy link
Owner

timeu commented Aug 5, 2015

@sandro-k
Thanks for the pull-requests.
I actually planned to use a custom CSS mixin to allow users of dy-graphs to modify the display. I was thinking of adding something along these lines:

<dom-module id="dy-graphs">
  <style>
    :host {
      display:block
      /* apply a mixin */
      @apply(--dy-graphs-container);
    }
   #chart {
      @apply(--dy-graphs-chart);
  }
  </style>

And then you could make it responsive this way:

<dom-module id="my-element">
  <style>
      .responsive {
            --dy-graphs-container: {
               display:flex;
               flex: 1;   
           };
          --dy-graphs-chart: {
               flex:1;
          };
      } 
  </style>
  <template>
     <dy-graphs class="responsive"></dy-graphs>
  </template>
</dom-module>

This would be a more flexible solution. Would you mind to update the pull-request ?

@sandro-k
Copy link
Author

sandro-k commented Aug 5, 2015

I thought about that and I agree that it is more flexible. I will play around with some custom CSS mixins and update my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants