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

Conditionally show live examples based on feature detection #33

Closed
schalkneethling opened this issue May 26, 2017 · 6 comments
Closed
Assignees
Labels
enhancement Improves an existing feature.
Milestone

Comments

@schalkneethling
Copy link
Contributor

schalkneethling commented May 26, 2017

[Schalk]

Do we want to do feature detection for certain examples and only show those that are supported by the browser? Is there a baseline we want to define and say, if the feature does not meet our baseline, do not add it or, is there another way you would suggest?

[Stephanie]

The samples are meant to showcase the technology. For example: I would not include the -ms- prefix to make a flexbox demo work in IE 10… I would suggest we:

  • Show a plain text version of the example (I assume we have a plain text version already? since we need to serve something to our users with js disabled)
  • Put a small note beneath it that their browser does not support the feature. Thoughts?
@schalkneethling schalkneethling added question enhancement Improves an existing feature. labels May 26, 2017
@schalkneethling
Copy link
Contributor Author

If any of the syntax variants are not supported in the current browser, show the static code example within the iframe. This will then be accompanied by a message to the user to indicate that their browser does not support the current feature or parts thereof.

Perhaps with an in-document link to the support tables? @stephaniehobson @wbamberg

@schalkneethling
Copy link
Contributor Author

@stephaniehobson On this one, should we include a custom build of https://modernizr.com/download?setclasses or should we roll our own that we build up over time as we need extra checks?

@schalkneethling
Copy link
Contributor Author

Here is the final decision on how we are going to implement this:
https://github.com/mdn/interactive-examples/wiki/Weekly-Meeting-Notes#conclusion

@schalkneethling
Copy link
Contributor Author

@stephaniehobson @wbamberg Before this one out, what is our definition of supported? Is it as per spec non vendor prefixed?

@stephaniehobson
Copy link
Contributor

I think the stated preference is to write examples without vendor prefixes which means they won't run without the vendor prefix. But maybe we do want to have some kind of allowance for vendor prefixes in interactive examples? But that means showing the -webkit- prefix to the Firefox users and that normally won't work in FF and we'll have to update the example as support evolves....

I think the short answer here is I don't know either.

@wbamberg
Copy link
Contributor

I think for a first version we should not use prefixes. Do you have a feeling for how big an issue this is? Would it cause us to exclude a lot of properties that we could otherwise include?

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

No branches or pull requests

3 participants