Skip to content

Convenience methods #1

Description

@paulyoung

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions