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

Denote Variants in JSON #22

Open
ryanve opened this issue Apr 6, 2013 · 0 comments
Open

Denote Variants in JSON #22

ryanve opened this issue Apr 6, 2013 · 0 comments

Comments

@ryanve
Copy link
Owner

ryanve commented Apr 6, 2013

For Response 1.0, I think JSON may a more resilient way to denote variants in the long term, and would alleviate some of the complexity involved in defining breakpoint sets.

<img src="example-default.png" alt="default example" data-response-attr='{
    "src": {"480":"example-medium.png", "1280":"example-huge.png"}
}'>

This could also accommodate attributes other than [src]:

<img src="example-default.png" alt="default example" data-response-attr='{
    "src": {"480":"example-medium.png", "1280":"example-huge.png"}
  , "alt": {"480":"medium example",     "1280":"huge example"}
}'>

For insertions:

<div data-response-html='{"480":"example medium", "1280":"example huge"}'>
    example default
</div>

Non-numeric keys could also be used:

<div data-response-html='{"medium":"example medium", "huge":"example huge"}'>
    example default
</div>
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

No branches or pull requests

1 participant