Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions resources/js/build/wordpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function wordpressThemeJson({
const rootContent = themeContent.slice(themeContent.indexOf('{') + 1, themeContent.lastIndexOf('}'))
const colorVariables = {}

const colorVarRegex = /--color-([^:]+):\s*([^;]+);/g
const colorVarRegex = /--color-([^:]+):\s*([^;}]+)[;}]?/g
let match

while ((match = colorVarRegex.exec(rootContent)) !== null) {
Expand Down Expand Up @@ -250,7 +250,7 @@ export function wordpressThemeJson({
})

const fontFamilies = []
const fontVarRegex = /--font-([^:]+):\s*([^;]+);/g
const fontVarRegex = /--font-([^:]+):\s*([^;}]+)[;}]?/g
while ((match = fontVarRegex.exec(rootContent)) !== null) {
const [, name, value] = match
if (!name.includes('-feature-settings') && !name.includes('-variation-settings')) {
Expand All @@ -263,7 +263,7 @@ export function wordpressThemeJson({
}

const fontSizes = []
const fontSizeVarRegex = /--text-([^:]+):\s*([^;]+);/g
const fontSizeVarRegex = /--text-([^:]+):\s*([^;}]+)[;}]?/g
while ((match = fontSizeVarRegex.exec(rootContent)) !== null) {
const [, name, value] = match
if (!name.includes('--line-height')) {
Expand Down