Skip to content

Slide Scope Styles ​

You can use the <style> tag in your Markdown to define styles for only the current slide.

md
# This is Red

<style>
h1 {
  color: red;
}
</style>

---

# Other slides are not affected

The <style> tag in Markdown is always scoped. As a result, a selector with a child combinator (.a > .b) is unusable as such; see the previous link. To have global styles, check out the customization section.

Powered by UnoCSS, you can directly use nested css and directives:

md
# Slidev

> Hello **world**

<style>
blockquote {
  strong {
    --uno: 'text-teal-500 dark:text-teal-400';
  }
}
</style>

Released under the MIT License.