@wordpress/a11y
Version:
Accessibility (a11y) utilities for WordPress.
44 lines (42 loc) • 1.68 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// packages/a11y/src/script/add-intro-text.ts
var add_intro_text_exports = {};
__export(add_intro_text_exports, {
default: () => addIntroText
});
module.exports = __toCommonJS(add_intro_text_exports);
var import_i18n = require("@wordpress/i18n");
function addIntroText() {
const introText = document.createElement("p");
introText.id = "a11y-speak-intro-text";
introText.className = "a11y-speak-intro-text";
introText.textContent = (0, import_i18n.__)("Notifications");
introText.setAttribute(
"style",
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;word-break:normal !important;"
);
introText.setAttribute("hidden", "");
const { body } = document;
if (body) {
body.appendChild(introText);
}
return introText;
}
//# sourceMappingURL=add-intro-text.cjs.map