You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In short, when grabbing HTML as a string from an external source, that HTML cannot be styled directly in an .astro component.
A common workflow: get HTML from API/server, save to variable. Then parse the HTML with either set:html or node-html-parser, then add the parsed HTML to the page.
If the variable contents are injected into the page, couldn't this simply be solved by changing the order of when the CSS is applied?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a follow up discussion based on this issue: withastro/astro#4380
In short, when grabbing HTML as a string from an external source, that HTML cannot be styled directly in an
.astro
component.A common workflow: get HTML from API/server, save to variable. Then parse the HTML with either
set:html
ornode-html-parser
, then add the parsed HTML to the page.If the variable contents are injected into the page, couldn't this simply be solved by changing the order of when the CSS is applied?
Beta Was this translation helpful? Give feedback.
All reactions