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

Convenience methods #1

Open
1 of 2 tasks
paulyoung opened this issue Oct 15, 2014 · 2 comments
Open
1 of 2 tasks

Convenience methods #1

paulyoung opened this issue Oct 15, 2014 · 2 comments

Comments

@paulyoung
Copy link
Contributor

The API is pretty clunky at the moment, but necessarily so.

For specific graphs, the API could be simplified to something like:

css = rig.passthrough block, config, [{
  selector: '#background'
  query: '(max-width: 503px)'
  width: 400
}]
  • specific graphs

For simple media query breakpoints with the same selector, the API could be something like:

css = rig.breakpoints block, config, graph, params,
  selector: '#background'
  breakpoints: [504, 1008]
  widths: [500, 1000, 1200] # or heights

This means that the 500px width image would be used for the media queries like so:

@media (min-width: 503px) { /* 500px wide image */ }
@media (min-width: 504px) and (max-width: 1007px)  { /* 1000px wide image */ }
@media (min-width: 1008px)  { /* 1200px wide image */ }

Any number of breakpoints could be supported as long as breakpoints.length == widths.length + 1.

  • breakpoints
@jonnor
Copy link
Contributor

jonnor commented Oct 15, 2014

I got code for this

@paulyoung
Copy link
Contributor Author

Convenience for breakpoints was added in 9571e0f.

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

Successfully merging a pull request may close this issue.

2 participants