@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
24 lines (23 loc) • 915 B
JavaScript
import { getComputedFluidTypographyValue } from "@wordpress/block-editor";
import { __ } from "@wordpress/i18n";
import { useStyle } from "../hooks.mjs";
import { jsx } from "react/jsx-runtime";
// packages/global-styles-ui/src/font-sizes/font-size-preview.tsx
function FontSizePreview({ fontSize }) {
const [font] = useStyle("typography");
const input = typeof fontSize?.fluid === "object" && fontSize?.fluid?.min && fontSize?.fluid?.max ? {
minimumFontSize: fontSize.fluid.min,
maximumFontSize: fontSize.fluid.max
} : { fontSize: fontSize.size };
const computedFontSize = getComputedFluidTypographyValue(input);
return /* @__PURE__ */ jsx("div", {
className: "global-styles-ui-typography-preview",
style: {
fontSize: computedFontSize,
fontFamily: font?.fontFamily ?? "serif"
},
children: __("Aa")
});
}
export { FontSizePreview as default };
//# sourceMappingURL=font-size-preview.mjs.map