File size: 526 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
export function styleToString(style) {
return Object.keys(style).reduce((str, key) => {
if (style[key] === undefined)
return str;
return str + `${key}:${style[key]};`;
}, "");
}
export function getSrOnlyStyles() {
return styleToString({
position: "absolute",
width: "1px",
height: "1px",
padding: "0",
margin: "-1px",
overflow: "hidden",
clip: "rect(0, 0, 0, 0)",
whiteSpace: "nowrap",
borderWidth: "0",
});
}
|