Styling a injected HTML #1000
Answered
by
askoufis
victorkardel
asked this question in
Q&A
-
Hello everyone, I want to style a property coming from my parent that already has predefined HTML tags.
My HTML is come from an API, and is in a .md format, with HTML tags like h1,h2,ol, etc. How I can style just only for this component "PostWrapper" my children's html tags with vanilla extract? |
Beta Was this translation helpful? Give feedback.
Answered by
askoufis
Feb 10, 2023
Replies: 1 comment 1 reply
-
If I'm understanding correctly, you're trying to style descendant elements of your To achieve this you can use a So you could do something like this: // style.css.ts
import { style, globalStyle } from '@vanilla-extract/css';
export const stylePostWrapper = style({});
globalStyle(`${stylePostWrapper} h1`, {
color: 'pink'
});
globalStyle(`${stylePostWrapper} h2`, {
color: 'blue'
});
// etc... |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
victorkardel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I'm understanding correctly, you're trying to style descendant elements of your
PostWrapper
.To achieve this you can use a
style
in combination with theglobalStyle
API.So you could do something like this: