slidev icon indicating copy to clipboard operation
slidev copied to clipboard

CSS child combinator throws error

Open yheuhtozr opened this issue 3 years ago • 1 comments

Describe the bug

If you use a child combinator (>) in an embedded <style> tag, the app immediately throws error and stops. I guess the parser thinks of it as a stray closing tag?

To Reproduce Steps to reproduce the behavior:

  1. yarn create slidev .
  2. directly start with the starter template
  3. for example, edit the line 73 from h1 to h1 > span in slides.md https://github.com/slidevjs/slidev/blob/d81b650a3e4fe196e1f49dbad50807431077e558/demo/starter/slides.md#L73
  4. See the error
[plugin:vite:vue] Tags with side effect (<script> and <style>) are ignored in client component templates.

/@slidev/slides/2.md:21:1

19 |  Learn more: https://sli.dev/guide/syntax#embedded-styles
20 |  -->
21 |  <style scoped>
   |   ^
22 |  
23 |  h1 > span {

AFAIK it never fails without child combinators, nor via external CSS such as in style.css.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 (WSL 1)
  • Browser: N/A
  • Slidev version: 0.28.1

yheuhtozr avatar Jan 17 '22 10:01 yheuhtozr

Is there a workaround for this problem? I'd like to be able to use child combinators in embedded styles.

IanVS avatar Sep 08 '22 03:09 IanVS

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 07 '22 06:11 stale[bot]

Still reproduces as of v0.36.10.

yheuhtozr avatar Nov 07 '22 10:11 yheuhtozr

It sounds like stalebot shouldn't have closed this.

IanVS avatar Nov 14 '22 12:11 IanVS