From 88cf335f7a22eefff8c874e40d8c4d698f0f4a8b Mon Sep 17 00:00:00 2001 From: mxkae Date: Wed, 4 Oct 2023 15:00:53 +0800 Subject: [PATCH] get theme styles --- .../typography/get-theme-styles.js | 22 +++++++++++++++++++ .../global-settings/typography/index.js | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 src/plugins/global-settings/typography/get-theme-styles.js diff --git a/src/plugins/global-settings/typography/get-theme-styles.js b/src/plugins/global-settings/typography/get-theme-styles.js new file mode 100644 index 000000000..95984ea5c --- /dev/null +++ b/src/plugins/global-settings/typography/get-theme-styles.js @@ -0,0 +1,22 @@ +export const getThemeStyles = () => { + const iframe = document.querySelector( 'iframe[name="editor-canvas"]' ) + let themeStyles = '' + + if ( iframe ) { + const doc = iframe.contentDocument || iframe.contentWindow.document + + // theme styles are stored in { TYPOGRAPHY_TAGS.map( ( { label, selector, help, }, index ) => {