@maizzle/framework
Version:
Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.
29 lines (28 loc) • 1.08 kB
JavaScript
import { inject, provide } from "vue";
//#region src/composables/useOutlookFallback.ts
const OutlookFallbackKey = Symbol("OutlookFallback");
/**
* Toggle whether descendants emit Outlook (MSO) and VML fallback markup.
*
* Call once in a Layout/template's `<script setup>` to disable for the
* whole tree:
* `useOutlookFallback(false)`
*
* Components inheriting `false` skip MSO ghost tables, VML rectangles,
* `xmlns:v`/`xmlns:o`, mso-specific CSS, and Button's `<Outlook>`
* spacers. Each MSO-aware component still accepts an `outlook-fallback`
* prop that overrides inheritance for its subtree.
*
* @param value Pass `true`/`false` to set; omit to just read the
* inherited value (defaults to `true` at the root).
* @returns The resolved boolean for the current component.
*/
function useOutlookFallback(value) {
const inherited = inject(OutlookFallbackKey, true);
const enabled = value == null ? inherited : value;
provide(OutlookFallbackKey, enabled);
return enabled;
}
//#endregion
export { useOutlookFallback };
//# sourceMappingURL=useOutlookFallback.js.map