Skip to content

Commit f7a86e9

Browse files
committed
feat: embedded styles in markdown
1 parent 9598370 commit f7a86e9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

guide/syntax.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,42 @@ console.log('HelloWorld')
114114

115115
Learn more about [configuring Monaco](/custom/config-monaco).
116116

117+
## Embedded Styles
118+
119+
You can use `<style>` tag in your Markdown directly to override styles for the **current slide**.
120+
121+
```md
122+
# This is Red
123+
124+
<style>
125+
h1 {
126+
color: red
127+
}
128+
</style>
129+
130+
---
131+
132+
# Next slide is not affected
133+
```
134+
135+
`<style>` tag in Markdown is always [scoped](https://vue-loader.vuejs.org/guide/scoped-css.html). To have global style overrides, check out the [customization section](/custom/directory-structure#style).
136+
137+
Powered by [Windi CSS](https://windicss.org), you can directly use nested css and [directives](https://windicss.org/features/directives.html) (e.g. `@apply`)
138+
139+
```md
140+
# Slidev
141+
142+
> Hello `world`
143+
144+
<style>
145+
blockquote {
146+
code {
147+
@apply text-teal-500 dark:text-teal-400;
148+
}
149+
}
150+
</style>
151+
```
152+
117153
## Notes
118154

119155
You can also take notes for each slide. They will show up in [Presenter Mode](/guide/presenter-mode) for you to reference during presentations.

0 commit comments

Comments
 (0)