jackbsteinberg / std-toast

120 stars 4 forks source link

Assorted questions #31

Closed crertel closed 5 years ago

crertel commented 5 years ago
<std-toast id="sample-toast" theme="info">
    Hello World!
</std-toast>
import { showToast } from 'std:elements/toast';

const toast = showToast("Hello World!", {
    theme: "info",
    duration: 3000
});
domenic commented 5 years ago

What is the purpose of the theme attribute? What are the valid values of the theme attribute? Are custom themes supported?

See https://github.com/jackbsteinberg/std-toast#attributes, and #18. An active area of discussion!

What markup is allowed inside elements? The docs suggest that toasts contain an image, some text, and maybe some interaction, but does the markup allow for more interesting things? Text styling? ARIA markup?

See https://github.com/jackbsteinberg/std-toast#contents

How does accessibility work for toasts, anyways?

See #25 for some initial discussion.

What markup is allowed in the first param to showToast? Can we pass a DOM element instead?

See https://github.com/jackbsteinberg/std-toast#showtoastmessage-options, plus #12 (which had a bad name; I just renamed it)

Is there any provision to prevent malicious scripts from filling a user's screen with obnoxious amounts of toast?

Currently there is no intention to prevent an obnoxious amount of toasts, just like there is no part of the platform that prevents an obnoxious amount of divs. Note however that the intention is for it to be an in-page control, so it's not an obtrusive native UI element (#27). Also, if the author doesn't override the default behavior and styles, there should be some stacking or queuing, which can mitigate things a bit (see #19).

What happens to toast created in iframe elements?

Good question. The intention is for them to be constrained inside the iframe (see #27).