Questa pagina è generata dai pacchetti Magma, documentati solo in inglese.
<!-- INCORRECT --><mds-toast visible variant="error"> <strong>Errore:</strong> salvataggio fallito <mds-button>Riprova</mds-button></mds-toast>
<!-- CORRECT --><mds-toast visible variant="error"> <mds-icon slot="icon" name="mi/baseline/error-outline"></mds-icon> Salvataggio fallito <mds-button slot="action" size="sm" variant="error" tone="weak">Riprova</mds-button></mds-toast><!-- INCORRECT - disables auto-dismiss unintentionally --><mds-toast visible variant="success" duration="0"> Documento salvato</mds-toast>
<!-- CORRECT - default 5000 ms applies --><mds-toast visible variant="success"> Documento salvato</mds-toast><!-- INCORRECT - presence checks still read the toast as visible --><mds-toast visible="false" variant="info"> Sincronizzazione in corso</mds-toast>
<!-- CORRECT - attribute absent means hidden --><mds-toast variant="info"> Sincronizzazione in corso</mds-toast>// INCORRECT - element may still be animatingconst toast = document.querySelector('mds-toast');const observer = new MutationObserver(() => { if (!toast.hasAttribute('visible')) { toast.remove(); }});observer.observe(toast, { attributes: true });
// CORRECT - fires after the outro animationtoast.addEventListener('mdsToastClose', () => { toast.remove();});<!-- INCORRECT - no color override; looks identical to variant="dark" --><mds-toast visible variant="primary"> Azione confermata</mds-toast>
<!-- CORRECT - uses a variant with full CSS support --><mds-toast visible variant="success"> Azione confermata</mds-toast><!-- INCORRECT - value not in ToneMinimalVariantType --><mds-toast visible variant="info" tone="outline"> Aggiornamento disponibile</mds-toast>
<!-- CORRECT --><mds-toast visible variant="info" tone="weak"> Aggiornamento disponibile</mds-toast>/* INCORRECT */mds-toast >>> .dialog { border-radius: 0;}
/* CORRECT - use the documented custom properties */mds-toast { --mds-toast-background: rgb(var(--magma-surface-inverse)); --mds-toast-color: rgb(var(--magma-on-inverse)); --mds-toast-width: 360px;}