From db2f16863b0199cc6d12bd1ac834298a3d53ad1e Mon Sep 17 00:00:00 2001 From: julia-rabello <77292838+julia-rabello@users.noreply.github.com> Date: Thu, 9 Jul 2026 12:05:44 -0300 Subject: [PATCH] fix: render callout icons as inline SVG instead of external asset The vtex-dev-portal-navigation DigitalOcean Space that callout icons (info, warning, danger) were loaded from via CSS background-image no longer exists (404 NoSuchBucket), so icons silently disappeared while the colored background/border still rendered. Icons are now inline SVGs generated in renderBlockquote, removing the external dependency entirely. --- src/styles/font-styles.js | 39 ++++++----------------------------- src/utils/renderBlockquote.js | 25 +++++++++++++++++----- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/src/styles/font-styles.js b/src/styles/font-styles.js index 750700786..4460330e5 100644 --- a/src/styles/font-styles.js +++ b/src/styles/font-styles.js @@ -87,54 +87,27 @@ export default css` grid-template-columns: 20px 1fr; } + .m-markdown .callout-icon { + display: inline-block; + flex-shrink: 0; + grid-row: 1; + } + .m-markdown .info-blockquote { background: #f8f7fc; border: 1px solid #ccced8; } - .m-markdown .info-blockquote:before { - display: inline-block; - height: 20px; - width: 20px; - content: ''; - background: url('https://vtex-dev-portal-navigation.fra1.digitaloceanspaces.com/info.svg') - no-repeat 0 0; - background-size: 20px 20px; - position: absolute; - } - .m-markdown .warning-blockquote { background: #fff2d4; border: 1px solid #ffb100; } - .m-markdown .warning-blockquote:before { - display: inline-block; - height: 20px; - width: 20px; - content: ''; - background: url('https://vtex-dev-portal-navigation.fra1.digitaloceanspaces.com/warning.svg') - no-repeat 0 0; - background-size: 20px 20px; - position: absolute; - } - .m-markdown .danger-blockquote { background: #fdefef; border: 1px solid #dc5a41; } - .m-markdown .danger-blockquote:before { - display: inline-block; - height: 20px; - width: 20px; - content: ''; - background: url('https://vtex-dev-portal-navigation.fra1.digitaloceanspaces.com/danger.svg') - no-repeat 0 0; - background-size: 20px 20px; - position: absolute; - } - blockquote p{ grid-column: 2 / -1; margin: 0; diff --git a/src/utils/renderBlockquote.js b/src/utils/renderBlockquote.js index 4de9444a4..527e34f3f 100644 --- a/src/utils/renderBlockquote.js +++ b/src/utils/renderBlockquote.js @@ -1,3 +1,18 @@ +const calloutColors = { + info: '#8C929D', + warning: '#FFB100', + danger: '#DC5A41', +}; + +function calloutIcon(type) { + const fill = calloutColors[type] || calloutColors.info; + const glyph = type === 'info' + ? '' + : ''; + + return `${glyph}`; +} + export default function renderBlockquote(text) { const infoMarker = 'â„šī¸'; const bookMarker = '📘'; @@ -6,18 +21,18 @@ export default function renderBlockquote(text) { if (text.startsWith(`

${infoMarker}`)) { // Apply custom styling for the info blockquote - return `

${text.replace(infoMarker, '').trim()}
`; + return `
${calloutIcon('info')}${text.replace(infoMarker, '').trim()}
`; } if (text.startsWith(`

${bookMarker}`)) { // Apply custom styling for the info blockquote - return `

${text.replace(bookMarker, '').trim()}
`; + return `
${calloutIcon('info')}${text.replace(bookMarker, '').trim()}
`; } if (text.startsWith(`

${warningMarker} `)) { // Apply custom styling for the warning blockquote - return `

${text.replace(warningMarker, '').trim()}
`; + return `
${calloutIcon('warning')}${text.replace(warningMarker, '').trim()}
`; } if (text.startsWith(`

${dangerMarker} `)) { // Apply custom styling for the danger blockquote - return `

${text.replace(dangerMarker, '').trim()}
`; + return `
${calloutIcon('danger')}${text.replace(dangerMarker, '').trim()}
`; } // Default rendering for regular blockquotes - return `
${text}
`; + return `
${calloutIcon('info')}${text}
`; }